Skip to content

Commit

Permalink
Vulkan PostVS ignore primmitive restart indexes when restart is active
Browse files Browse the repository at this point in the history
Compute primitive restart using VulkanRenderState not pipeline, to account for dynamic state.
Ignore primitive restart indexes, handles primitive restart indexes being used when there are no active vertex buffer bindings
  • Loading branch information
Zorro666 committed Jul 27, 2023
1 parent 831ed40 commit a6fed12
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion renderdoc/driver/vulkan/vk_postvs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,7 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state)

if(action->flags & ActionFlags::Indexed)
{
const bool restart = pipeCreateInfo.pInputAssemblyState->primitiveRestartEnable == VK_TRUE;
const bool restart = state.primRestartEnable != VK_FALSE;
bytebuf idxdata;
rdcarray<uint32_t> indices;
uint8_t *idx8 = NULL;
Expand Down Expand Up @@ -1838,6 +1838,10 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state)
// buffers which is generally much more reasonable
i32 = RDCMIN(maxIdx, i32);

// ignore primitive restart indices
if(restart && i32 == (0xffffffff >> ((4 - idxsize) * 8)))
continue;

auto it = std::lower_bound(indices.begin(), indices.end(), i32);

if(it != indices.end() && *it == i32)
Expand Down

0 comments on commit a6fed12

Please sign in to comment.