Vulkan PostVS ignore primmitive restart indexes when restart is active

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
This commit is contained in:
Jake Turner
2023-07-27 13:51:01 +01:00
parent 831ed40484
commit a6fed120ac
+5 -1
View File
@@ -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;
@@ -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)