Check for appropriate storage features before applying shader feedback

This commit is contained in:
baldurk
2021-05-07 16:10:28 +01:00
parent aec2f8db79
commit 968fd249c0
2 changed files with 32 additions and 4 deletions
@@ -626,6 +626,16 @@ void VulkanReplay::FetchShaderFeedback(uint32_t eventId)
if(offsetMap.empty())
return;
if(!result.compute)
{
// if we don't have any stores supported at all, we can't do feedback on the graphics pipeline
if(!m_pDriver->GetDeviceEnabledFeatures().vertexPipelineStoresAndAtomics &&
!m_pDriver->GetDeviceEnabledFeatures().fragmentStoresAndAtomics)
{
return;
}
}
// we go through the driver for all these creations since they need to be properly
// registered in order to be put in the partial replay state
VkResult vkr = VK_SUCCESS;
@@ -790,6 +800,17 @@ void VulkanReplay::FetchShaderFeedback(uint32_t eventId)
VkPipelineShaderStageCreateInfo &stage =
(VkPipelineShaderStageCreateInfo &)graphicsInfo.pStages[i];
if(stage.stage & VK_SHADER_STAGE_FRAGMENT_BIT)
{
if(!m_pDriver->GetDeviceEnabledFeatures().fragmentStoresAndAtomics)
continue;
}
else
{
if(!m_pDriver->GetDeviceEnabledFeatures().vertexPipelineStoresAndAtomics)
continue;
}
int idx = StageIndex(stage.stage);
const VulkanCreationInfo::ShaderModule &moduleInfo =
@@ -2821,9 +2821,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
if(availFeatures.shaderInt64)
enabledFeatures.shaderInt64 = true;
else
RDCWARN(
"shaderInt64 = false, feedback from bindless shader access will use less reliable "
"fallback.");
RDCWARN("shaderInt64 = false, feedback from shaders will use less reliable fallback.");
if(availFeatures.shaderStorageImageWriteWithoutFormat)
enabledFeatures.shaderStorageImageWriteWithoutFormat = true;
@@ -2847,7 +2845,16 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
if(availFeatures.fragmentStoresAndAtomics)
enabledFeatures.fragmentStoresAndAtomics = true;
else
RDCWARN("fragmentStoresAndAtomics = false, quad overdraw overlay will not be available");
RDCWARN(
"fragmentStoresAndAtomics = false, quad overdraw overlay will not be available and "
"feedback from shaders will not be fetched for fragment stage");
if(availFeatures.vertexPipelineStoresAndAtomics)
enabledFeatures.vertexPipelineStoresAndAtomics = true;
else
RDCWARN(
"vertexPipelineStoresAndAtomics = false, feedback from shaders will not be fetched for "
"vertex stages");
if(availFeatures.sampleRateShading)
enabledFeatures.sampleRateShading = true;