From 91a77c1698610b5cd54fc5f7151941d1930794ec Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 28 Oct 2022 14:12:51 +0100 Subject: [PATCH] Re-order builtin inputs to try and avoid suspected AMD driver bug * In principle the fake SV_ inputs should be able to come in any order, but it seems if SV_IsFrontFace is last it can get undefined/wrong results (e.g. returning 1 when front-face culling is enabled or vice-versa). Moving it to the first seems to fix the issue, and at least shouldn't make anything any worse. --- renderdoc/driver/d3d12/d3d12_shaderdebug.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp index 7531a06fa..f22abd9a8 100644 --- a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp +++ b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp @@ -2052,18 +2052,23 @@ struct PSInitialData if(usePrimitiveID) { extractHlsl += R"( -void ExtractInputsPS(PSInput IN, float4 debug_pixelPos : SV_Position, uint prim : SV_PrimitiveID, - uint sample : SV_SampleIndex, uint covge : SV_Coverage, - bool fface : SV_IsFrontFace) +void ExtractInputsPS(PSInput IN, + float4 debug_pixelPos : SV_Position, + uint prim : SV_PrimitiveID, + uint fface : SV_IsFrontFace, + uint sample : SV_SampleIndex, + uint covge : SV_Coverage) { )"; } else { extractHlsl += R"( -void ExtractInputsPS(PSInput IN, float4 debug_pixelPos : SV_Position, - uint sample : SV_SampleIndex, uint covge : SV_Coverage, - bool fface : SV_IsFrontFace) +void ExtractInputsPS(PSInput IN, + float4 debug_pixelPos : SV_Position, + uint fface : SV_IsFrontFace, + uint sample : SV_SampleIndex, + uint covge : SV_Coverage) { )"; }