mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Expand out arrays of shader resources at lower priority than non-arrays
* An array of resources like SamplerState foo[8]; or Texture2D blah[8]; show up as one entry in the reflection data, so need to be expanded out to several entries. * Normally it's OK to overlap two resources in the same bind, as long as only one gets used - this doesn't matter to us since only the used one will show up in the reflection data. Unless there's an array e.g: SamplerState foo[8] : register(s0); // [0] and [5] used; SamplerState bar : register(s3); in which case foo[] appears in the reflection data for the sake of [0] and [5], and bar will appear too (causing an overlap between foo[3] and bar. Since we know the reflection data is unambiguous, we prioritise individual entries over array entries by listing them first and using the first match for any bindpoint.
This commit is contained in:
@@ -259,7 +259,10 @@ namespace renderdocui.Windows.PipelineState
|
||||
foreach (var bind in shaderDetails.Resources)
|
||||
{
|
||||
if (bind.IsSRV && bind.bindPoint == i)
|
||||
{
|
||||
shaderInput = bind;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,7 +383,10 @@ namespace renderdocui.Windows.PipelineState
|
||||
foreach (var bind in shaderDetails.Resources)
|
||||
{
|
||||
if (bind.IsSampler && bind.bindPoint == i)
|
||||
{
|
||||
shaderInput = bind;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -891,7 +897,10 @@ namespace renderdocui.Windows.PipelineState
|
||||
foreach (var bind in state.m_CS.ShaderDetails.Resources)
|
||||
{
|
||||
if (bind.IsReadWrite && bind.bindPoint == i)
|
||||
{
|
||||
shaderInput = bind;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1205,7 +1214,10 @@ namespace renderdocui.Windows.PipelineState
|
||||
foreach (var bind in state.m_PS.ShaderDetails.Resources)
|
||||
{
|
||||
if (bind.IsReadWrite && bind.bindPoint == i + state.m_OM.UAVStartSlot)
|
||||
{
|
||||
shaderInput = bind;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2424,7 +2436,10 @@ namespace renderdocui.Windows.PipelineState
|
||||
foreach (var bind in refl.Resources)
|
||||
{
|
||||
if (bind.IsReadWrite && bind.bindPoint == i)
|
||||
{
|
||||
shaderInput = bind;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user