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
2025-04-01 01:55:16 +02:00
committed by Sam Lantinga
parent 2103451d00
commit 9109e05f3f

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;
}
}