From ad805e811755cff42de820599f1eb7cd009806de Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 26 Oct 2015 19:13:08 +0100 Subject: [PATCH] Allow excess VS sig system value elements versus IA bytecode. Refs #167 * The VS can consume system value semantics at the end of the signature that weren't present in the IA layout's bytecode. Note that if the order changes (ie. the system value element is first) then that's not OK. Only trailing elements are allowed. --- .../PipelineState/D3D11PipelineStateViewer.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/renderdocui/Windows/PipelineState/D3D11PipelineStateViewer.cs b/renderdocui/Windows/PipelineState/D3D11PipelineStateViewer.cs index b159240be..d6c9f3cfc 100644 --- a/renderdocui/Windows/PipelineState/D3D11PipelineStateViewer.cs +++ b/renderdocui/Windows/PipelineState/D3D11PipelineStateViewer.cs @@ -632,7 +632,25 @@ namespace renderdocui.Windows.PipelineState // VS wants more elements if (state.m_IA.Bytecode.InputSig.Length < state.m_VS.ShaderDetails.InputSig.Length) - mismatchDetails += "IA bytecode provides fewer elements than VS wants.\n"; + { + int excess = state.m_VS.ShaderDetails.InputSig.Length - state.m_IA.Bytecode.InputSig.Length; + + bool allSystem = true; + + // The VS signature can consume more elements as long as they are all system value types + // (ie. SV_VertexID or SV_InstanceID) + for (int e = 0; e < excess; e++) + { + if(state.m_VS.ShaderDetails.InputSig[state.m_VS.ShaderDetails.InputSig.Length - 1 - e].systemValue == SystemAttribute.None) + { + allSystem = false; + break; + } + } + + if (!allSystem) + mismatchDetails += "IA bytecode provides fewer elements than VS wants.\n"; + } { var IA = state.m_IA.Bytecode.InputSig;