mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-14 18:27:50 +00:00
fix vulkan vertex buffer indexing
this was causing problems when i was specifying non-zero buffer slots in
`SDL_BindGPUVertexBuffers`, `SDL_GPUVertexAttribute` and
`SDL_GPUVertexBufferDescription`.
`firstSlot + 1` is simply copied over from metal and d3d12 backends.
(cherry picked from commit 512485869c)
This commit is contained in:
parent
2103451d00
commit
9109e05f3f
1 changed files with 3 additions and 3 deletions
|
|
@ -7943,11 +7943,11 @@ static void VULKAN_BindVertexBuffers(
|
|||
|
||||
for (Uint32 i = 0; i < numBindings; i += 1) {
|
||||
VulkanBuffer *buffer = ((VulkanBufferContainer *)bindings[i].buffer)->activeBuffer;
|
||||
if (vulkanCommandBuffer->vertexBuffers[i] != buffer->buffer || vulkanCommandBuffer->vertexBufferOffsets[i] != bindings[i].offset) {
|
||||
if (vulkanCommandBuffer->vertexBuffers[firstSlot + i] != buffer->buffer || vulkanCommandBuffer->vertexBufferOffsets[firstSlot + i] != bindings[i].offset) {
|
||||
VULKAN_INTERNAL_TrackBuffer(vulkanCommandBuffer, buffer);
|
||||
|
||||
vulkanCommandBuffer->vertexBuffers[i] = buffer->buffer;
|
||||
vulkanCommandBuffer->vertexBufferOffsets[i] = bindings[i].offset;
|
||||
vulkanCommandBuffer->vertexBuffers[firstSlot + i] = buffer->buffer;
|
||||
vulkanCommandBuffer->vertexBufferOffsets[firstSlot + i] = bindings[i].offset;
|
||||
vulkanCommandBuffer->needVertexBufferBind = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue