From 75a0cd6e2cdcb32b0ff12be42175c0c4ba286459 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Sat, 30 May 2026 14:11:29 +0200 Subject: [PATCH] mesa: Allow GL_TEXTURE_IMMUTABLE_LEVELS query on GLES3 GL_TEXTURE_IMMUTABLE_LEVELS is core state in OpenGL ES 3.0 (it comes with immutable textures / glTexStorage), queryable through glGetTexParameter. The getter only allowed it when ARB_texture_view or OES_texture_view is present, so a GLES3 driver without texture views returns GL_INVALID_ENUM for a valid query. Its sibling GL_TEXTURE_IMMUTABLE_FORMAT is correctly ungated. Allow the query on any GLES3 context, matching the spec. Fixes 8 dEQP-GLES3.functional.state_query.texture.*_immutable_levels_* cases on etnaviv (which exposes neither texture-view extension). Fixes: 214fd4e40db ("mesa/main: fix texture view enum checks") Signed-off-by: Christian Gmeiner Reviewed-by: Adam Jackson Reviewed-by: Erik Faye-Lund Part-of: --- src/freedreno/ci/freedreno-a306-fails.txt | 10 ---------- src/mesa/main/texparam.c | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/freedreno/ci/freedreno-a306-fails.txt b/src/freedreno/ci/freedreno-a306-fails.txt index 9b945c2cc25..29f724153ad 100644 --- a/src/freedreno/ci/freedreno-a306-fails.txt +++ b/src/freedreno/ci/freedreno-a306-fails.txt @@ -1111,16 +1111,6 @@ dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_out_of_bounds_mag,Fail # New failures with ES CTS 3.2.11.0 dEQP-GLES2.functional.polygon_offset.fixed16_render_with_units,Fail -# Regressions while the device was offline -dEQP-GLES3.functional.state_query.texture.texture_2d_array_texture_immutable_levels_gettexparameterf,Fail -dEQP-GLES3.functional.state_query.texture.texture_2d_array_texture_immutable_levels_gettexparameteri,Fail -dEQP-GLES3.functional.state_query.texture.texture_2d_texture_immutable_levels_gettexparameterf,Fail -dEQP-GLES3.functional.state_query.texture.texture_2d_texture_immutable_levels_gettexparameteri,Fail -dEQP-GLES3.functional.state_query.texture.texture_3d_texture_immutable_levels_gettexparameterf,Fail -dEQP-GLES3.functional.state_query.texture.texture_3d_texture_immutable_levels_gettexparameteri,Fail -dEQP-GLES3.functional.state_query.texture.texture_cube_map_texture_immutable_levels_gettexparameterf,Fail -dEQP-GLES3.functional.state_query.texture.texture_cube_map_texture_immutable_levels_gettexparameteri,Fail - # Regressions while the device was offline spec@!opengl es 3.0@texture-immutable-levels,Fail spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_argb8888,Fail diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 690693b92ed..a3639667d73 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -2499,7 +2499,7 @@ get_tex_parameterfv(struct gl_context *ctx, break; case GL_TEXTURE_IMMUTABLE_LEVELS: - if (_mesa_has_texture_view(ctx)) + if (_mesa_is_gles3(ctx) || _mesa_has_texture_view(ctx)) *params = (GLfloat) obj->Attrib.ImmutableLevels; else goto invalid_pname; @@ -2792,7 +2792,7 @@ get_tex_parameteriv(struct gl_context *ctx, break; case GL_TEXTURE_IMMUTABLE_LEVELS: - if (_mesa_has_texture_view(ctx)) + if (_mesa_is_gles3(ctx) || _mesa_has_texture_view(ctx)) *params = obj->Attrib.ImmutableLevels; else goto invalid_pname;