[Feat, Fix, Test] (MG_Util, MG_Backend/DirectGLES, MG_IntegrationTest): bake the bound image format into the ESSL a format-less image declaration needs

This commit is contained in:
2026-08-12 18:56:31 -04:00
parent bce34d7fac
commit b7557d6615
16 changed files with 1976 additions and 1 deletions
@@ -912,6 +912,9 @@ namespace MobileGL::MG_Util::BackendLoader {
if (std::strcmp(extension, "GL_NV_shader_noperspective_interpolation") == 0) {
caps.SupportsNoperspectiveInterpolation = true;
}
if (std::strcmp(extension, "GL_NV_image_formats") == 0) {
caps.SupportsExtendedImageFormats = true;
}
if (std::strcmp(extension, "GL_OES_shader_multisample_interpolation") == 0) {
caps.SupportsShaderMultisampleInterpolation = true;
}
@@ -1138,6 +1138,14 @@ namespace MobileGL {
// SPIRV-Cross's `#extension ... : require` would fail to compile and MobileGL falls back
// to stripping the NoPerspective decoration (smooth interpolation) via StripNoPerspectivePass.
Bool SupportsNoperspectiveInterpolation = false;
// GL_NV_image_formats is present: the driver accepts the image format qualifiers GL
// has and GLSL ES core does not (the one- and two-channel formats, the 16-bit and
// snorm ones - r8ui, rg16f, rgba16 and the rest of GL table 8.26). GLSL ES core has
// only thirteen, so without this an image whose bound format is outside that set has
// no legal spelling in the generated ESSL at all, and the directive must not be
// emitted either - `#extension` on a name the driver does not advertise is itself a
// compile error.
Bool SupportsExtendedImageFormats = false;
// GLES 3.2 core or GL_OES_shader_multisample_interpolation exposes
// interpolateAtOffset and the three fragment-offset limit queries.
Bool SupportsShaderMultisampleInterpolation = false;