mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[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).
This commit is contained in:
@@ -225,6 +225,13 @@ namespace MobileGL {
|
|||||||
// using e.g. layout(binding=...) without the matching #extension line compiles on real
|
// 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
|
// drivers but is rejected here. Retry once at 460 before reporting failure; a genuinely
|
||||||
// broken shader fails both attempts and keeps its original diagnostics.
|
// 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;
|
String retrySource = source;
|
||||||
if (!MG_Util::ShaderTranspiler::RetargetLegacyVersionDirectiveTo460(retrySource)) {
|
if (!MG_Util::ShaderTranspiler::RetargetLegacyVersionDirectiveTo460(retrySource)) {
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user