Request memory with VK_MEMORY_PROPERTY_HOST_COHERENT_BIT enabled for model staging buffers.
There is no guarantee in the spec on the order of the following memory types:
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
which means we can't assume that the first memory type with VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT is going to be coherent.
This commit is contained in:
parent
1f1613a224
commit
ebf0a34ae7
1 changed files with 2 additions and 2 deletions
|
|
@ -314,7 +314,7 @@ namespace vks
|
|||
// Vertex buffer
|
||||
VK_CHECK_RESULT(device->createBuffer(
|
||||
VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
|
||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
|
||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
|
||||
&vertexStaging,
|
||||
vBufferSize,
|
||||
vertexBuffer.data()));
|
||||
|
|
@ -322,7 +322,7 @@ namespace vks
|
|||
// Index buffer
|
||||
VK_CHECK_RESULT(device->createBuffer(
|
||||
VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
|
||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
|
||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
|
||||
&indexStaging,
|
||||
iBufferSize,
|
||||
indexBuffer.data()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue