Set firstInstance to zero

Fixes #1159
This commit is contained in:
Sascha Willems 2024-10-10 17:26:25 +02:00
parent add736f6fa
commit 128b096b6e
2 changed files with 4 additions and 4 deletions

View file

@ -979,7 +979,7 @@ public:
scissor.offset.x = 0; scissor.offset.x = 0;
scissor.offset.y = 0; scissor.offset.y = 0;
vkCmdSetScissor(commandBuffer, 0, 1, &scissor); vkCmdSetScissor(commandBuffer, 0, 1, &scissor);
// Bind descriptor set for the currrent frame's uniform buffer, so the shader uses the data from that buffer for this draw // Bind descriptor set for the current frame's uniform buffer, so the shader uses the data from that buffer for this draw
vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &uniformBuffers[currentFrame].descriptorSet, 0, nullptr); vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &uniformBuffers[currentFrame].descriptorSet, 0, nullptr);
// Bind the rendering pipeline // Bind the rendering pipeline
// The pipeline (state object) contains all states of the rendering pipeline, binding it will set all the states specified at pipeline creation time // The pipeline (state object) contains all states of the rendering pipeline, binding it will set all the states specified at pipeline creation time
@ -990,7 +990,7 @@ public:
// Bind triangle index buffer // Bind triangle index buffer
vkCmdBindIndexBuffer(commandBuffer, indices.buffer, 0, VK_INDEX_TYPE_UINT32); vkCmdBindIndexBuffer(commandBuffer, indices.buffer, 0, VK_INDEX_TYPE_UINT32);
// Draw indexed triangle // Draw indexed triangle
vkCmdDrawIndexed(commandBuffer, indices.count, 1, 0, 0, 1); vkCmdDrawIndexed(commandBuffer, indices.count, 1, 0, 0, 0);
vkCmdEndRenderPass(commandBuffer); vkCmdEndRenderPass(commandBuffer);
// Ending the render pass will add an implicit barrier transitioning the frame buffer color attachment to // Ending the render pass will add an implicit barrier transitioning the frame buffer color attachment to
// VK_IMAGE_LAYOUT_PRESENT_SRC_KHR for presenting it to the windowing system // VK_IMAGE_LAYOUT_PRESENT_SRC_KHR for presenting it to the windowing system

View file

@ -740,7 +740,7 @@ public:
// Update dynamic scissor state // Update dynamic scissor state
VkRect2D scissor{ 0, 0, width, height }; VkRect2D scissor{ 0, 0, width, height };
vkCmdSetScissor(commandBuffer, 0, 1, &scissor); vkCmdSetScissor(commandBuffer, 0, 1, &scissor);
// Bind descriptor set for the currrent frame's uniform buffer, so the shader uses the data from that buffer for this draw // Bind descriptor set for the current frame's uniform buffer, so the shader uses the data from that buffer for this draw
vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &uniformBuffers[currentFrame].descriptorSet, 0, nullptr); vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &uniformBuffers[currentFrame].descriptorSet, 0, nullptr);
// The pipeline (state object) contains all states of the rendering pipeline, binding it will set all the states specified at pipeline creation time // The pipeline (state object) contains all states of the rendering pipeline, binding it will set all the states specified at pipeline creation time
vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
@ -750,7 +750,7 @@ public:
// Bind triangle index buffer // Bind triangle index buffer
vkCmdBindIndexBuffer(commandBuffer, indexBuffer.handle, 0, VK_INDEX_TYPE_UINT32); vkCmdBindIndexBuffer(commandBuffer, indexBuffer.handle, 0, VK_INDEX_TYPE_UINT32);
// Draw indexed triangle // Draw indexed triangle
vkCmdDrawIndexed(commandBuffer, indexCount, 1, 0, 0, 1); vkCmdDrawIndexed(commandBuffer, indexCount, 1, 0, 0, 0);
// Finish the current dynamic rendering section // Finish the current dynamic rendering section
vkCmdEndRendering(commandBuffer); vkCmdEndRendering(commandBuffer);