From bd401a14074477698bada9e76b6e3f9439f2388a Mon Sep 17 00:00:00 2001 From: nmzik Date: Fri, 4 Sep 2026 06:48:41 +0200 Subject: [PATCH] shader: ignore inactive auxiliary position exports --- src/graphics/shader/recompiler/ir/ShaderIR.h | 2 -- .../recompiler/ir/passes/ShaderInfoCollection.cpp | 4 ---- tests/shaderCfgTests.cpp | 15 ++++++++++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/graphics/shader/recompiler/ir/ShaderIR.h b/src/graphics/shader/recompiler/ir/ShaderIR.h index 0ddc30a51..909f260a7 100644 --- a/src/graphics/shader/recompiler/ir/ShaderIR.h +++ b/src/graphics/shader/recompiler/ir/ShaderIR.h @@ -184,7 +184,6 @@ enum class StageOutputKind { struct PositionExportComponent { uint32_t clip_distance = UINT32_MAX; uint32_t cull_distance = UINT32_MAX; - bool valid = false; bool point_size = false; bool layer = false; bool viewport = false; @@ -213,7 +212,6 @@ inline PositionExportComponent DecodePositionExportComponent(uint32_t control, return result; } - result.valid = true; if (vector == 0) { result.point_size = component == 0 && (control & (1u << 16u)) != 0; result.layer = component == 2 && (control & (1u << 18u)) != 0; diff --git a/src/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cpp b/src/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cpp index f26f309c8..7d77b9cbf 100644 --- a/src/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cpp +++ b/src/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cpp @@ -311,10 +311,6 @@ void CollectOutputs(const Program& program, const ShaderVertexInputInfo* vertex, } const auto output = DecodePositionExportComponent( vertex->pa_cl_vs_out_cntl, export_info.index, component); - if (!output.valid) { - return Fail(fmt::format("unsupported POS{} auxiliary/stereo export", - export_info.index)); - } if (output.viewport) { return Fail("vertex viewport-index export is unsupported"); } diff --git a/tests/shaderCfgTests.cpp b/tests/shaderCfgTests.cpp index b59f212b0..0154c2571 100644 --- a/tests/shaderCfgTests.cpp +++ b/tests/shaderCfgTests.cpp @@ -9062,6 +9062,18 @@ void TestNewShaderRecompilerAuxPositionExports() { std::vector({0u}), "CCDIST1 did not shift across a disabled CCDIST0 vector"); + const uint32_t unmapped[] = { + EncodeExp0(0x0d, 0x4, false), EncodeExp1(0, 0, 8, 0), + EncodeExp0(0x0c, 0xf), EncodeExp1(0, 1, 2, 3), + 0xbf810000u, + }; + const auto ignored = compile(unmapped, 0u); + CheckSpirvBinaryValidates(ignored.spirv); + Check(ignored.program.info.outputs.size() == 1u && + ignored.program.info.outputs[0].kind == + ShaderRecompiler::IR::StageOutputKind::Position, + "unmapped auxiliary position export was not ignored"); + #if KYTY_PLATFORM != KYTY_PLATFORM_WINDOWS const auto rejects = [](uint32_t control, uint32_t en, const char *message) { @@ -9080,9 +9092,6 @@ void TestNewShaderRecompilerAuxPositionExports() { rejects(0x00280000u, 0x4u, "viewport-index auxiliary position export did not terminate " "compilation"); - rejects(0u, 0x1u, - "unsupported auxiliary/stereo position export did not terminate " - "compilation"); #endif ShaderVertexInputInfo key0{};