mesa: Expose EXT_texture_query_lod and add support for its use shaders
authorGert Wollny <gert.wollny@collabora.com>
Mon, 25 Feb 2019 18:12:07 +0000 (19:12 +0100)
committerGert Wollny <gert.wollny@collabora.com>
Sun, 3 Mar 2019 20:50:42 +0000 (21:50 +0100)
EXT_texture_query_lod provides the same functionality for GLES like
the ARB extension with the same name for GL.

v2: Set ES 3.0 as minimum GLES version as required by the extension

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/glsl/builtin_functions.cpp
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/glsl_parser_extras.h
src/mesa/main/extensions_table.h

index 0f747b9475713a4f2fcd5a16cb131656d5175305..aba1a14bd9025981cccfe9e11577e477d13bd9b3 100644 (file)
@@ -405,7 +405,8 @@ static bool
 texture_query_lod(const _mesa_glsl_parse_state *state)
 {
    return state->stage == MESA_SHADER_FRAGMENT &&
-          state->ARB_texture_query_lod_enable;
+          (state->ARB_texture_query_lod_enable ||
+           state->EXT_texture_query_lod_enable);
 }
 
 static bool
index bde93dd3f37ee170868d19bb51782d765b6fdad7..fd3e9e55af1b2c55e3f08e69c451b86bd2dc7fb3 100644 (file)
@@ -730,6 +730,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(EXT_texture_array),
    EXT_AEP(EXT_texture_buffer),
    EXT_AEP(EXT_texture_cube_map_array),
+   EXT(EXT_texture_query_lod),
    EXT(INTEL_conservative_rasterization),
    EXT(INTEL_shader_atomic_float_minmax),
    EXT(MESA_shader_integer_functions),
index b17b5125e0b983e87b3d3ad9ed3882b48b0ae36d..f404efd9610977f90a0b1e6c42a9053443fd159b 100644 (file)
@@ -834,6 +834,8 @@ struct _mesa_glsl_parse_state {
    bool EXT_texture_buffer_warn;
    bool EXT_texture_cube_map_array_enable;
    bool EXT_texture_cube_map_array_warn;
+   bool EXT_texture_query_lod_enable;
+   bool EXT_texture_query_lod_warn;
    bool INTEL_conservative_rasterization_enable;
    bool INTEL_conservative_rasterization_warn;
    bool INTEL_shader_atomic_float_minmax_enable;
index 05ed418d750090ae7a57892d4d3017c1987e2a55..a9773f701b61022917f19ab2f2372b1aca07ae6a 100644 (file)
@@ -301,6 +301,7 @@ EXT(EXT_texture_lod_bias                    , dummy_true
 EXT(EXT_texture_mirror_clamp                , EXT_texture_mirror_clamp               , GLL, GLC,  x ,  x , 2004)
 EXT(EXT_texture_norm16                      , dummy_true                             ,  x ,  x ,  x ,  31, 2014)
 EXT(EXT_texture_object                      , dummy_true                             , GLL,  x ,  x ,  x , 1995)
+EXT(EXT_texture_query_lod                   , ARB_texture_query_lod                  ,  x ,  x ,  x ,  30, 2019)
 EXT(EXT_texture_rectangle                   , NV_texture_rectangle                   , GLL,  x ,  x ,  x , 2004)
 EXT(EXT_texture_rg                          , ARB_texture_rg                         ,  x ,  x ,  x , ES2, 2011)
 EXT(EXT_texture_sRGB                        , EXT_texture_sRGB                       , GLL, GLC,  x ,  x , 2004)