Skip to content

Commit 5124858

Browse files
blukaislouken
authored andcommitted
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.
1 parent 2e494fd commit 5124858

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/gpu/vulkan/SDL_gpu_vulkan.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7905,11 +7905,11 @@ static void VULKAN_BindVertexBuffers(
79057905

79067906
for (Uint32 i = 0; i < numBindings; i += 1) {
79077907
VulkanBuffer *buffer = ((VulkanBufferContainer *)bindings[i].buffer)->activeBuffer;
7908-
if (vulkanCommandBuffer->vertexBuffers[i] != buffer->buffer || vulkanCommandBuffer->vertexBufferOffsets[i] != bindings[i].offset) {
7908+
if (vulkanCommandBuffer->vertexBuffers[firstSlot + i] != buffer->buffer || vulkanCommandBuffer->vertexBufferOffsets[firstSlot + i] != bindings[i].offset) {
79097909
VULKAN_INTERNAL_TrackBuffer(vulkanCommandBuffer, buffer);
79107910

7911-
vulkanCommandBuffer->vertexBuffers[i] = buffer->buffer;
7912-
vulkanCommandBuffer->vertexBufferOffsets[i] = bindings[i].offset;
7911+
vulkanCommandBuffer->vertexBuffers[firstSlot + i] = buffer->buffer;
7912+
vulkanCommandBuffer->vertexBufferOffsets[firstSlot + i] = bindings[i].offset;
79137913
vulkanCommandBuffer->needVertexBufferBind = true;
79147914
}
79157915
}

0 commit comments

Comments
 (0)