mesa: Rename MESA_shader_integer_mix to EXT_shader_integer_mix
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 12 Sep 2013 16:40:00 +0000 (11:40 -0500)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 13 Sep 2013 14:56:36 +0000 (09:56 -0500)
Everyone at the Khronos meeting was as surprised that GLSL didn't
already support this as we were.  Several vendors said they'd ship it,
but there didn't seem to be enough interest to put in the effort to make
it ARB or KHR.

v2: Fix a couple typos and rename the spec file to
EXT_shader_integer_mix.spec.  Suggested by Roland.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
docs/specs/EXT_shader_integer_mix.spec [new file with mode: 0644]
docs/specs/MESA_shader_integer_mix.spec [deleted file]
src/glsl/builtin_functions.cpp
src/glsl/glcpp/glcpp-parse.y
src/glsl/glsl_parser_extras.cpp
src/glsl/glsl_parser_extras.h
src/mesa/drivers/dri/i965/intel_extensions.c
src/mesa/main/extensions.c
src/mesa/main/mtypes.h

diff --git a/docs/specs/EXT_shader_integer_mix.spec b/docs/specs/EXT_shader_integer_mix.spec
new file mode 100644 (file)
index 0000000..92cec64
--- /dev/null
@@ -0,0 +1,138 @@
+Name
+
+    EXT_shader_integer_mix
+
+Name Strings
+
+    GL_EXT_shader_integer_mix
+
+Contact
+
+    Matt Turner (matt.turner 'at' intel.com)
+
+Contributors
+
+    Matt Turner, Intel
+    Ian Romanick, Intel
+
+Status
+
+    Shipping
+
+Version
+
+    Last Modified Date:         09/12/2013
+    Author Revision:            6
+
+Number
+
+    TBD
+
+Dependencies
+
+    OpenGL 3.0 or OpenGL ES 3.0 is required. This extension interacts with
+    GL_ARB_ES3_compatibility.
+
+    This extension is written against the OpenGL 4.4 (core) specification
+    and the GLSL 4.40 specification.
+
+Overview
+
+    GLSL 1.30 (and GLSL ES 3.00) expanded the mix() built-in function to
+    operate on a boolean third argument that does not interpolate but
+    selects. This extension extends mix() to select between int, uint,
+    and bool components.
+
+New Procedures and Functions
+
+    None.
+
+New Tokens
+
+    None.
+
+Additions to Chapter 8 of the GLSL 4.40 Specification (Built-in Functions)
+
+    Modify Section 8.3, Common Functions
+
+    Additions to the table listing common built-in functions:
+
+      Syntax                       Description
+      ---------------------------  --------------------------------------------------
+      genIType mix(genIType x,     Selects which vector each returned component comes
+                   genIType y,     from. For a component of a that is false, the
+                   genBType a)     corresponding component of x is returned. For a
+      genUType mix(genUType x,     component of a that is true, the corresponding
+                   genUType y,     component of y is returned.
+                   genBType a)
+      genBType mix(genBType x,
+                   genBType y,
+                   genBType a)
+
+Additions to the AGL/GLX/WGL Specifications
+
+    None.
+
+Modifications to The OpenGL Shading Language Specification, Version 4.40
+
+    Including the following line in a shader can be used to control the
+    language features described in this extension:
+
+      #extension GL_EXT_shader_integer_mix : <behavior>
+
+    where <behavior> is as specified in section 3.3.
+
+    New preprocessor #defines are added to the OpenGL Shading Language:
+
+      #define GL_EXT_shader_integer_mix        1
+
+Interactions with ARB_ES3_compatibility
+
+    On desktop implementations that support ARB_ES3_compatibility,
+    GL_EXT_shader_integer_mix can be enabled (and the new functions
+    used) in shaders declared with '#version 300 es'.
+
+GLX Protocol
+
+    None.
+
+Errors
+
+    None.
+
+New State
+
+    None.
+
+New Implementation Dependent State
+
+    None.
+
+Issues
+
+    1) Should we allow linear interpolation of integers via a non-boolean
+       third component?
+
+    RESOLVED: No.
+
+    2) Should we allow mix() to select between boolean components?
+
+    RESOLVED: Yes. Implementing the same functionality using casts would be
+    possible but ugly.
+
+Revision History
+
+    Rev.    Date      Author    Changes
+    ----  --------    --------  ---------------------------------------------
+      6   09/12/2013  idr       After discussions in Khronos, change vendor
+                                prefix to EXT.
+
+      5   09/09/2013  idr       Add ARB_ES3_compatibility interaction.
+
+      4   09/06/2013  mattst88  Allow extension on OpenGL ES 3.0.
+
+      3   08/28/2013  mattst88  Add #extension/#define changes.
+
+      2   08/26/2013  mattst88  Change vendor prefix to MESA. Add mix() that
+                                selects between boolean components.
+      1   08/26/2013  mattst88  Initial revision
diff --git a/docs/specs/MESA_shader_integer_mix.spec b/docs/specs/MESA_shader_integer_mix.spec
deleted file mode 100644 (file)
index d381ddd..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-Name
-
-    MESA_shader_integer_mix
-
-Name Strings
-
-    GL_MESA_shader_integer_mix
-
-Contact
-
-    Matt Turner (matt.turner 'at' intel.com)
-
-Contributors
-
-    Matt Turner, Intel
-    Ian Romanick, Intel
-
-Status
-
-    Shipping
-
-Version
-
-    Last Modified Date:         09/09/2013
-    Author Revision:            5
-
-Number
-
-    
-
-Dependencies
-
-    OpenGL 3.0 or OpenGL ES 3.0 is required. This extension interacts with
-    GL_ARB_ES3_compatibility.
-
-    This extension is written against the OpenGL 4.4 (core) specification
-    and the GLSL 4.40 specification.
-
-Overview
-
-    GLSL 1.30 (and GLSL ES 3.00) expanded the mix() built-in function to
-    operate on a boolean third argument that does not interpolate but
-    selects. This extension extends mix() to select between int, uint,
-    and bool components.
-
-New Procedures and Functions
-
-    None.
-
-New Tokens
-
-    None.
-
-Additions to Chapter 8 of the GLSL 4.40 Specification (Built-in Functions)
-
-    Modify Section 8.3, Common Functions
-
-    Additions to the table listing common built-in functions:
-
-      Syntax                       Description
-      ---------------------------  --------------------------------------------------
-      genIType mix(genIType x,     Selects which vector each returned component comes
-                   genIType y,     from. For a component of a that is false, the
-                   genBType a)     corresponding component of x is returned. For a
-      genUType mix(genUType x,     component of a that is true, the corresponding
-                   genUType y,     component of y is returned.
-                   genBType a)
-      genBType mix(genBType x,
-                   genBType y,
-                   genBType a)
-
-Additions to the AGL/GLX/WGL Specifications
-
-    None.
-
-Modifications to The OpenGL Shading Language Specification, Version 4.40
-
-    Including the following line in a shader can be used to control the
-    language features described in this extension:
-
-      #extension GL_MESA_shader_integer_mix : <behavior>
-
-    where <behavior> is as specified in section 3.3.
-
-    New preprocessor #defines are added to the OpenGL Shading Language:
-
-      #define GL_MESA_shader_integer_mix        1
-
-Interactions with ARB_ES3_compatibility
-
-    On desktop implementations that support ARB_ES3_compatibility,
-    GL_MESA_shader_integer_mix can be enabled (and the new functions
-    used) in shaders declared with '#version 300 es'.
-
-GLX Protocol
-
-    None.
-
-Errors
-
-    None.
-
-New State
-
-    None.
-
-New Implementation Dependent State
-
-    None.
-
-Issues
-
-    1) Should we allow linear interpolation of integers via a non-boolean
-       third component?
-
-    RESOLVED: No.
-
-    2) Should we allow mix() to select between boolean components?
-
-    RESOLVED: Yes. Implementing the same functionality using casts would be
-    possible but ugly.
-
-Revision History
-
-    Rev.    Date      Author    Changes
-    ----  --------    --------  ---------------------------------------------
-      5   09/09/2013  idr       Add ARB_ES3_compatibility interaction.
-
-      4   09/06/2013  mattst88  Allow extension on OpenGL ES 3.0.
-
-      3   08/28/2013  mattst88  Add #extension/#define changes.
-
-      2   08/26/2013  mattst88  Change vendor prefix to MESA. Add mix() that
-                                selects between boolean components.
-      1   08/26/2013  mattst88  Initial revision
index eb661f115ee4369b70b04d98eb19d9a754a82357..c468bd505aba64c7e92f9d9d4a03482a7990d60f 100644 (file)
@@ -190,7 +190,7 @@ shader_bit_encoding(const _mesa_glsl_parse_state *state)
 static bool
 shader_integer_mix(const _mesa_glsl_parse_state *state)
 {
-   return v130(state) && state->MESA_shader_integer_mix_enable;
+   return v130(state) && state->EXT_shader_integer_mix_enable;
 }
 
 static bool
index fb1c1d0466d39040913f998fe898604eab6c04cc..6eaa5f95ef1190fb8ac6506e513c6724d966b82c 100644 (file)
@@ -1246,8 +1246,8 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
              if (extensions->ARB_shading_language_420pack)
                 add_builtin_define(parser, "GL_ARB_shading_language_420pack", 1);
 
-             if (extensions->MESA_shader_integer_mix)
-                add_builtin_define(parser, "GL_MESA_shader_integer_mix", 1);
+             if (extensions->EXT_shader_integer_mix)
+                add_builtin_define(parser, "GL_EXT_shader_integer_mix", 1);
           }
        }
 
index 1e4d7c7abf0730203190c6ecb15f5e1a96f4df27..cac5a18e474f0befc19104d9761f4e6dcd738e0f 100644 (file)
@@ -517,7 +517,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(ARB_texture_query_lod,          true,  false,     ARB_texture_query_lod),
    EXT(ARB_gpu_shader5,                true,  false,     ARB_gpu_shader5),
    EXT(AMD_vertex_shader_layer,        true,  false,     AMD_vertex_shader_layer),
-   EXT(MESA_shader_integer_mix,        true,   true,     MESA_shader_integer_mix),
+   EXT(EXT_shader_integer_mix,         true,  true,      EXT_shader_integer_mix),
 };
 
 #undef EXT
index 15abbbc99163c16bbc7ad5d25444ab095caba305..2e2440a9eedd2671c173419cdcf1f1b7c7731a75 100644 (file)
@@ -315,8 +315,8 @@ struct _mesa_glsl_parse_state {
    bool AMD_vertex_shader_layer_warn;
    bool ARB_shading_language_420pack_enable;
    bool ARB_shading_language_420pack_warn;
-   bool MESA_shader_integer_mix_enable;
-   bool MESA_shader_integer_mix_warn;
+   bool EXT_shader_integer_mix_enable;
+   bool EXT_shader_integer_mix_warn;
    /*@}*/
 
    /** Extensions supported by the OpenGL implementation. */
index 8cb3f1b68d64ab0f47dfe4d6e73a7e7ea4652210..aef78051e628411ff1dc2da866daa7efd7454e79 100644 (file)
@@ -157,7 +157,7 @@ intelInitExtensions(struct gl_context *ctx)
    if (brw->gen >= 5) {
       ctx->Extensions.ARB_texture_query_lod = true;
       ctx->Extensions.EXT_timer_query = true;
-      ctx->Extensions.MESA_shader_integer_mix = ctx->Const.GLSLVersion >= 130;
+      ctx->Extensions.EXT_shader_integer_mix = ctx->Const.GLSLVersion >= 130;
    }
 
    if (ctx->API == API_OPENGL_CORE)
index 88fcde3b90bfaf7dd5f35ca7e0aa149bfc99b87a..34615e3e0bc3a1465b61eb212f57bac4126a09cc 100644 (file)
@@ -201,6 +201,7 @@ static const struct extension extension_table[] = {
    { "GL_EXT_secondary_color",                     o(dummy_true),                              GLL,            1999 },
    { "GL_EXT_separate_shader_objects",             o(EXT_separate_shader_objects),             GLL,            2008 },
    { "GL_EXT_separate_specular_color",             o(dummy_true),                              GLL,            1997 },
+   { "GL_EXT_shader_integer_mix",                  o(EXT_shader_integer_mix),                  GL       | ES3, 2013 },
    { "GL_EXT_shadow_funcs",                        o(ARB_shadow),                              GLL,            2002 },
    { "GL_EXT_stencil_two_side",                    o(EXT_stencil_two_side),                    GLL,            2001 },
    { "GL_EXT_stencil_wrap",                        o(dummy_true),                              GLL,            2002 },
@@ -311,7 +312,6 @@ static const struct extension extension_table[] = {
    { "GL_IBM_texture_mirrored_repeat",             o(dummy_true),                              GLL,            1998 },
    { "GL_INGR_blend_func_separate",                o(EXT_blend_func_separate),                 GLL,            1999 },
    { "GL_MESA_pack_invert",                        o(MESA_pack_invert),                        GL,             2002 },
-   { "GL_MESA_shader_integer_mix",                 o(MESA_shader_integer_mix),                 GL       | ES3, 2013 },
    { "GL_MESA_texture_array",                      o(MESA_texture_array),                      GLL,            2007 },
    { "GL_MESA_texture_signed_rgba",                o(EXT_texture_snorm),                       GL,             2009 },
    { "GL_MESA_window_pos",                         o(dummy_true),                              GLL,            2000 },
index b9625e8e72b322a58d81d6070f6a6b04da402b89..6d700ece89eb0caf75c8b8e8cefcad2f8912bf22 100644 (file)
@@ -3133,6 +3133,7 @@ struct gl_extensions
    GLboolean EXT_point_parameters;
    GLboolean EXT_provoking_vertex;
    GLboolean EXT_separate_shader_objects;
+   GLboolean EXT_shader_integer_mix;
    GLboolean EXT_stencil_two_side;
    GLboolean EXT_texture3D;
    GLboolean EXT_texture_array;
@@ -3162,7 +3163,6 @@ struct gl_extensions
    GLboolean ATI_fragment_shader;
    GLboolean ATI_separate_stencil;
    GLboolean MESA_pack_invert;
-   GLboolean MESA_shader_integer_mix;
    GLboolean MESA_texture_array;
    GLboolean MESA_ycbcr_texture;
    GLboolean NV_conditional_render;