Don't fetch resource lists for unbound shader stages

* This is a minor optimisation when there are large numbers of bound resources
  that are available (duplicated) to all shader stages. There's no point
  fetching them when there's no shader bound there.
This commit is contained in:
baldurk
2021-01-21 11:30:50 +00:00
parent a4fd53af8f
commit ba06717842
+13 -4
View File
@@ -3116,10 +3116,19 @@ void TextureViewer::OnEventChanged(uint32_t eventId)
{
ShaderStage stage = stages[i];
m_ReadWriteResources[(uint32_t)stage] =
Following::GetReadWriteResources(m_Ctx, stage, !m_ShowUnused);
m_ReadOnlyResources[(uint32_t)stage] =
Following::GetReadOnlyResources(m_Ctx, stage, !m_ShowUnused);
const ShaderBindpointMapping &mapping = Following::GetMapping(m_Ctx, stage);
if(!mapping.readOnlyResources.empty())
m_ReadOnlyResources[(uint32_t)stage] =
Following::GetReadOnlyResources(m_Ctx, stage, !m_ShowUnused);
else
m_ReadOnlyResources[(uint32_t)stage].clear();
if(!mapping.readWriteResources.empty())
m_ReadWriteResources[(uint32_t)stage] =
Following::GetReadWriteResources(m_Ctx, stage, !m_ShowUnused);
else
m_ReadWriteResources[(uint32_t)stage].clear();
}
UI_UpdateCachedTexture();