[Fix] (Shader): keep ESSL 3.10 block-array indexing and image-uniform rules for sources that declared an es version

This commit is contained in:
2026-10-12 08:32:49 -04:00
parent e98c5b4a6a
commit 1469022b53
11 changed files with 220 additions and 7 deletions
@@ -61,6 +61,16 @@ namespace MobileGL {
// GetNormalizedVersionDirective records why that has not happened.
String CollectEsPreambleMacroDefines(const String& preprocessedSource);
// What an ES-profile source declared before PreprocessShaderSource rewrote its
// #version to desktop - recovered from the marker the rewrite leaves on the directive -
// or nullopt for a source that did not declare an `es` version. The few rules ESSL has
// and desktop GLSL does not are enforced off this, and only for such sources.
struct EsOrigin {
Uint version = 0; // 300, 310, 320
Bool gpuShader5 = false; // GL_EXT_gpu_shader5 / GL_OES_gpu_shader5 turned on
};
std::optional<EsOrigin> FindEsOrigin(const String& preprocessedSource);
// The uniforms a shader declared as samplerExternalOES (GL_OES_EGL_image_external),
// which PreprocessShaderSource turned into sampler2D and named in a marker: the
// reflection reports them as GL_SAMPLER_EXTERNAL_OES. Empty for every other shader.