Fix crash in postvs on vulkan with NULL vertex buffers bound

This commit is contained in:
baldurk
2021-06-07 11:02:50 +01:00
parent 81ebf46cad
commit 003ab7469c
+9 -3
View File
@@ -2023,6 +2023,10 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state)
{
origVBBegin = origVBs[vb].data() + attrDesc.offset;
origVBEnd = origVBs[vb].data() + origVBs[vb].size();
if(origVBs[vb].empty())
origVBBegin = origVBEnd = NULL;
stride = vbDesc.stride;
if(vbDesc.inputRate == VK_VERTEX_INPUT_RATE_INSTANCE)
instDivisor = pipeInfo.vertexBindings[vbDesc.binding].instanceDivisor;
@@ -2035,9 +2039,6 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state)
if(attrDesc.binding < state.vbuffers.size())
stride = (size_t)state.vbuffers[attrDesc.binding].stride;
if(origVBBegin == NULL)
continue;
// in some limited cases, provided we added the UNIFORM_TEXEL_BUFFER usage bit, we could use
// the original buffers here as-is and read out of them. However it is likely that the offset
// is not a multiple of the minimum texel buffer offset for at least some of the buffers if
@@ -2518,6 +2519,11 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state)
modifiedstate.compute.descSets[i].descSet = GetResID(descSets[i]);
}
}
else
{
for(size_t i = 0; i < modifiedstate.compute.descSets.size(); i++)
modifiedstate.compute.descSets[i].pipeLayout = GetResID(pipeLayout);
}
{
VkCommandBuffer cmd = m_pDriver->GetNextCmd();