diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp index 22dd78221..3cafa97d8 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp @@ -4952,8 +4952,7 @@ void GatherPSInputDataForInitialValues(const DXBC::DXBCContainer *dxbc, bool included = true; // handled specially to account for SV_ ordering - if(sig.systemValue == ShaderBuiltin::PrimitiveIndex || - sig.systemValue == ShaderBuiltin::MSAACoverage || + if(sig.systemValue == ShaderBuiltin::MSAACoverage || sig.systemValue == ShaderBuiltin::IsFrontFace || sig.systemValue == ShaderBuiltin::MSAASampleIndex) { @@ -4961,6 +4960,15 @@ void GatherPSInputDataForInitialValues(const DXBC::DXBCContainer *dxbc, included = false; } + // it seems sometimes primitive ID can be included within inputs and isn't subject to the SV_ + // ordering restrictions - possibly to allow for geometry shaders to output the primitive ID as + // an interpolant. Only comment it out if it's the last input. + if(i + 1 == numInputs && sig.systemValue == ShaderBuiltin::PrimitiveIndex) + { + psInputDefinition += "//"; + included = false; + } + int arrayIndex = -1; for(size_t a = 0; a < arrays.size(); a++)