mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
vulkan: improve negated bit syntax
This commit is contained in:
@@ -220,7 +220,7 @@ bool Buffer::fill(size_t offset, size_t size, const void *data)
|
|||||||
|
|
||||||
VkMemoryPropertyFlags memoryProperties;
|
VkMemoryPropertyFlags memoryProperties;
|
||||||
vmaGetAllocationMemoryProperties(allocator, fillAllocation, &memoryProperties);
|
vmaGetAllocationMemoryProperties(allocator, fillAllocation, &memoryProperties);
|
||||||
if (!(memoryProperties & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT))
|
if (~memoryProperties & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)
|
||||||
vmaFlushAllocation(allocator, fillAllocation, 0, size);
|
vmaFlushAllocation(allocator, fillAllocation, 0, size);
|
||||||
|
|
||||||
VkBufferCopy bufferCopy{};
|
VkBufferCopy bufferCopy{};
|
||||||
@@ -239,12 +239,7 @@ bool Buffer::fill(size_t offset, size_t size, const void *data)
|
|||||||
|
|
||||||
void Buffer::unmap(size_t usedoffset, size_t usedsize)
|
void Buffer::unmap(size_t usedoffset, size_t usedsize)
|
||||||
{
|
{
|
||||||
if (dataUsage == BUFFERDATAUSAGE_READBACK)
|
if (dataUsage != BUFFERDATAUSAGE_READBACK)
|
||||||
{
|
|
||||||
if (!coherent)
|
|
||||||
vmaFlushAllocation(allocator, allocation, usedoffset, usedsize);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
VkBufferCopy bufferCopy{};
|
VkBufferCopy bufferCopy{};
|
||||||
bufferCopy.srcOffset = usedoffset - mappedRange.getOffset();
|
bufferCopy.srcOffset = usedoffset - mappedRange.getOffset();
|
||||||
@@ -253,7 +248,7 @@ void Buffer::unmap(size_t usedoffset, size_t usedsize)
|
|||||||
|
|
||||||
VkMemoryPropertyFlags memoryProperties;
|
VkMemoryPropertyFlags memoryProperties;
|
||||||
vmaGetAllocationMemoryProperties(allocator, stagingAllocation, &memoryProperties);
|
vmaGetAllocationMemoryProperties(allocator, stagingAllocation, &memoryProperties);
|
||||||
if (!(memoryProperties & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT))
|
if (~memoryProperties & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)
|
||||||
vmaFlushAllocation(allocator, stagingAllocation, bufferCopy.srcOffset, usedsize);
|
vmaFlushAllocation(allocator, stagingAllocation, bufferCopy.srcOffset, usedsize);
|
||||||
|
|
||||||
vkCmdCopyBuffer(vgfx->getCommandBufferForDataTransfer(), stagingBuffer, buffer, 1, &bufferCopy);
|
vkCmdCopyBuffer(vgfx->getCommandBufferForDataTransfer(), stagingBuffer, buffer, 1, &bufferCopy);
|
||||||
|
|||||||
Reference in New Issue
Block a user