[Mesa-dev] [PATCH 02/24] MESA_shader_integer_functions: Boiler plate extension tracking

Ian Romanick idr at freedesktop.org
Wed Jun 29 21:04:09 UTC 2016


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/compiler/glsl/glcpp/glcpp-parse.y        | 3 +++
 src/compiler/glsl/glsl_parser_extras.cpp     | 1 +
 src/compiler/glsl/glsl_parser_extras.h       | 2 ++
 src/compiler/glsl/standalone_scaffolding.cpp | 2 ++
 src/mesa/main/extensions_table.h             | 1 +
 src/mesa/main/mtypes.h                       | 1 +
 6 files changed, 10 insertions(+)

diff --git a/src/compiler/glsl/glcpp/glcpp-parse.y b/src/compiler/glsl/glcpp/glcpp-parse.y
index 2cfa6a6..a159761 100644
--- a/src/compiler/glsl/glcpp/glcpp-parse.y
+++ b/src/compiler/glsl/glcpp/glcpp-parse.y
@@ -2479,6 +2479,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
 
       if (extensions->EXT_shader_samples_identical)
          add_builtin_define(parser, "GL_EXT_shader_samples_identical", 1);
+
+      if (extensions->MESA_shader_integer_functions)
+         add_builtin_define(parser, "GL_MESA_shader_integer_functions", 1);
    }
 
    if (version >= 150)
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index 09f7477..f76ee69 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -651,6 +651,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(EXT_shader_samples_identical,   true,  true,      EXT_shader_samples_identical),
    EXT(EXT_texture_array,              true,  false,     EXT_texture_array),
    EXT(EXT_texture_buffer,             false, true,      OES_texture_buffer),
+   EXT(MESA_shader_integer_functions,  true,  true,      MESA_shader_integer_functions),
 };
 
 #undef EXT
diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
index 8c43292..a740689 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -680,6 +680,8 @@ struct _mesa_glsl_parse_state {
    bool EXT_texture_array_warn;
    bool EXT_texture_buffer_enable;
    bool EXT_texture_buffer_warn;
+   bool MESA_shader_integer_functions_enable;
+   bool MESA_shader_integer_functions_warn;
    /*@}*/
 
    /** Extensions supported by the OpenGL implementation. */
diff --git a/src/compiler/glsl/standalone_scaffolding.cpp b/src/compiler/glsl/standalone_scaffolding.cpp
index 396965a..82976a8 100644
--- a/src/compiler/glsl/standalone_scaffolding.cpp
+++ b/src/compiler/glsl/standalone_scaffolding.cpp
@@ -159,6 +159,8 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
    ctx->Extensions.EXT_shader_integer_mix = true;
    ctx->Extensions.EXT_texture_array = true;
 
+   ctx->Extensions.MESA_shader_integer_functions = true;
+
    ctx->Extensions.NV_texture_rectangle = true;
 
    ctx->Const.GLSLVersion = 120;
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index ad3bffc..a89ccc2 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -287,6 +287,7 @@ EXT(KHR_texture_compression_astc_hdr        , KHR_texture_compression_astc_hdr
 EXT(KHR_texture_compression_astc_ldr        , KHR_texture_compression_astc_ldr       , GLL, GLC,  x , ES2, 2012)
 
 EXT(MESA_pack_invert                        , MESA_pack_invert                       , GLL, GLC,  x ,  x , 2002)
+EXT(MESA_shader_integer_functions           , MESA_shader_integer_functions          , GLL, GLC,  x ,  30, 2016)
 EXT(MESA_texture_signed_rgba                , EXT_texture_snorm                      , GLL, GLC,  x ,  x , 2009)
 EXT(MESA_window_pos                         , dummy_true                             , GLL,  x ,  x ,  x , 2000)
 EXT(MESA_ycbcr_texture                      , MESA_ycbcr_texture                     , GLL, GLC,  x ,  x , 2002)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 73ae55d..e30c2ce 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3920,6 +3920,7 @@ struct gl_extensions
    GLboolean KHR_texture_compression_astc_hdr;
    GLboolean KHR_texture_compression_astc_ldr;
    GLboolean MESA_pack_invert;
+   GLboolean MESA_shader_integer_functions;
    GLboolean MESA_ycbcr_texture;
    GLboolean NV_conditional_render;
    GLboolean NV_fog_distance;
-- 
2.5.5



More information about the mesa-dev mailing list