From 1bb736c57e3fa7e0a99f8050bfd7c494c54da4c8 Mon Sep 17 00:00:00 2001 From: BZLZHH Date: Fri, 31 Jul 2026 15:51:40 -0400 Subject: [PATCH] [Fix] (ShaderTranspiler): keep arrays-of-arrays illegal below GLSL 430 The legacy-shader retry that retargets a failed parse to #version 460 also re-legalized multidimensional arrays, which every desktop driver rejects below 430 and KHR-GL33.shaders.arrays.invalid.* requires to fail. Skip the retry when the original failure is glslang's arrays-of-arrays error; other legacy rescues (e.g. layout(binding=...)) keep working. KHR-GL33.shaders.arrays.invalid.multidimensional_array* now report the required compile failure (4 cases). --- MobileGL/MG_Util/ShaderTranspiler/ShaderCompiler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MobileGL/MG_Util/ShaderTranspiler/ShaderCompiler.cpp b/MobileGL/MG_Util/ShaderTranspiler/ShaderCompiler.cpp index 02f513fd..dd1d36ba 100644 --- a/MobileGL/MG_Util/ShaderTranspiler/ShaderCompiler.cpp +++ b/MobileGL/MG_Util/ShaderTranspiler/ShaderCompiler.cpp @@ -225,6 +225,13 @@ namespace MobileGL { // using e.g. layout(binding=...) without the matching #extension line compiles on real // drivers but is rejected here. Retry once at 460 before reporting failure; a genuinely // broken shader fails both attempts and keeps its original diagnostics. + // + // Arrays of arrays are the exception: every desktop driver rejects them below 430 + // (the GL33 CTS requires the compile failure), so re-legalizing them at 460 would + // trade a conformance failure for no real-world shader gain. + if (result.error().log.find("arrays of arrays") != String::npos) { + return result; + } String retrySource = source; if (!MG_Util::ShaderTranspiler::RetargetLegacyVersionDirectiveTo460(retrySource)) { return result;