Skip to content

Commit

Permalink
Fix VK validation error when setting 0 vertex buffers. (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
csyonghe authored Dec 30, 2024
1 parent 3172dba commit 655d955
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/vulkan/vk-command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,16 @@ void CommandRecorder::cmdSetRenderState(const commands::SetRenderState& cmd)
vertexBuffers[i] = buffer->m_buffer.m_buffer;
offsets[i] = state.vertexBuffers[i].offset;
}
api.vkCmdBindVertexBuffers(m_cmdBuffer, (uint32_t)0, (uint32_t)state.vertexBufferCount, vertexBuffers, offsets);
if (state.vertexBufferCount > 0)
{
api.vkCmdBindVertexBuffers(
m_cmdBuffer,
(uint32_t)0,
(uint32_t)state.vertexBufferCount,
vertexBuffers,
offsets
);
}
}

if (updateIndexBuffer)
Expand Down

0 comments on commit 655d955

Please sign in to comment.