Handle geometryShader feature being unavailable - disable lit mesh mode

This commit is contained in:
baldurk
2018-01-10 20:50:47 +00:00
parent 464c9ad02a
commit 1592426da5
3 changed files with 20 additions and 3 deletions
+10 -3
View File
@@ -322,9 +322,12 @@ MeshDisplayPipelines VulkanDebugManager::CacheMeshDisplayPipelines(VkPipelineLay
stages[2].stage = VK_SHADER_STAGE_GEOMETRY_BIT;
pipeInfo.stageCount = 3;
vkr = vt->CreateGraphicsPipelines(Unwrap(m_Device), VK_NULL_HANDLE, 1, &pipeInfo, NULL,
&cache.pipes[MeshDisplayPipelines::ePipe_Lit]);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
if(stages[2].module != VK_NULL_HANDLE)
{
vkr = vt->CreateGraphicsPipelines(Unwrap(m_Device), VK_NULL_HANDLE, 1, &pipeInfo, NULL,
&cache.pipes[MeshDisplayPipelines::ePipe_Lit]);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
}
for(uint32_t i = 0; i < MeshDisplayPipelines::ePipe_Count; i++)
if(cache.pipes[i] != VK_NULL_HANDLE)
@@ -553,6 +556,10 @@ void VulkanReplay::RenderMesh(uint32_t eventId, const vector<MeshFormat> &second
case SolidShade::Secondary: pipe = cache.pipes[MeshDisplayPipelines::ePipe_Secondary]; break;
}
// can't support lit rendering without the pipeline - maybe geometry shader wasn't supported.
if(solidShadeMode == SolidShade::Lit && pipe == VK_NULL_HANDLE)
pipe = cache.pipes[MeshDisplayPipelines::ePipe_SolidDepth];
uint32_t uboOffs = 0;
MeshUBOData *data = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
@@ -147,6 +147,9 @@ VulkanShaderCache::VulkanShaderCache(WrappedVulkan *driver)
}
}
if(config.stage == SPIRVShaderStage::Geometry && !features.geometryShader)
continue;
std::string defines = "";
if(driverVersion.TexelFetchBrokenDriver())
defines += "#define NO_TEXEL_FETCH\n";
@@ -1082,6 +1082,13 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
// we have a fallback for this case, so no warning
if(availFeatures.geometryShader)
enabledFeatures.geometryShader = true;
else
RDCWARN(
"geometryShader = false, lit mesh rendering will not be available if rendering on this "
"device.");
if(availFeatures.robustBufferAccess)
enabledFeatures.robustBufferAccess = true;
else