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:
blukai authored and Sam Lantinga committed 2025-03-31 18:42:03 -07:00
1 parent 2103451d00
commit 9109e05f3f
1 file changed
+3 -3
+3 -3
View File
@@ -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;
}
}