[Mesa-dev] [PATCH 01/16] mesa: Add infrastructure for ARB_gpu_shader5.

Matt Turner mattst88 at gmail.com
Mon Apr 22 17:08:17 PDT 2013


---
 src/glsl/builtins/tools/generate_builtins.py |    1 +
 src/glsl/glcpp/glcpp-parse.y                 |    3 +++
 src/glsl/glsl_parser_extras.cpp              |    1 +
 src/glsl/glsl_parser_extras.h                |    2 ++
 src/glsl/standalone_scaffolding.cpp          |    1 +
 src/mesa/main/extensions.c                   |    1 +
 src/mesa/main/mtypes.h                       |    1 +
 7 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
index 75d3c21..85bd5dd 100755
--- a/src/glsl/builtins/tools/generate_builtins.py
+++ b/src/glsl/builtins/tools/generate_builtins.py
@@ -192,6 +192,7 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne
    st->ARB_shading_language_packing_enable = true;
    st->ARB_texture_multisample_enable = true;
    st->ARB_texture_query_lod_enable = true;
+   st->ARB_gpu_shader5_enable = true;
    _mesa_glsl_initialize_types(st);
 
    sh->ir = new(sh) exec_list;
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 00edbbf..f0d2ab0 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -1236,6 +1236,9 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
 
 	      if (extensions->ARB_texture_query_lod)
 	         add_builtin_define(parser, "GL_ARB_texture_query_lod", 1);
+
+	      if (extensions->ARB_gpu_shader5)
+	         add_builtin_define(parser, "GL_ARB_gpu_shader5", 1);
 	   }
 	}
 
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 0992294..e4636f8 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -468,6 +468,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(ARB_shading_language_packing,   true,  false, true,  true,  false,     ARB_shading_language_packing),
    EXT(ARB_texture_multisample,        true,  false, true,  true,  false,     ARB_texture_multisample),
    EXT(ARB_texture_query_lod,          false, false, true,  true,  false,     ARB_texture_query_lod),
+   EXT(ARB_gpu_shader5,                true,  true,  true,  true,  false,     ARB_gpu_shader5),
 };
 
 #undef EXT
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 95891b5..c77dda8 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -284,6 +284,8 @@ struct _mesa_glsl_parse_state {
    bool ARB_texture_multisample_warn;
    bool ARB_texture_query_lod_enable;
    bool ARB_texture_query_lod_warn;
+   bool ARB_gpu_shader5_enable;
+   bool ARB_gpu_shader5_warn;
    /*@}*/
 
    /** Extensions supported by the OpenGL implementation. */
diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp
index 0c1f52f..3c8f70f 100644
--- a/src/glsl/standalone_scaffolding.cpp
+++ b/src/glsl/standalone_scaffolding.cpp
@@ -104,6 +104,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
    ctx->Extensions.ARB_texture_cube_map_array = true;
    ctx->Extensions.ARB_texture_multisample = true;
    ctx->Extensions.ARB_texture_query_lod = true;
+   ctx->Extensions.ARB_gpu_shader5 = true;
 
    ctx->Const.GLSLVersion = 120;
 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 64473b9..c56ba15 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -101,6 +101,7 @@ static const struct extension extension_table[] = {
    { "GL_ARB_framebuffer_object",                  o(ARB_framebuffer_object),                  GL,             2005 },
    { "GL_ARB_framebuffer_sRGB",                    o(EXT_framebuffer_sRGB),                    GL,             1998 },
    { "GL_ARB_get_program_binary",                  o(ARB_shader_objects),                      GL,             2010 },
+   { "GL_ARB_gpu_shader5",                         o(ARB_gpu_shader5),                         GL,             2010 },
    { "GL_ARB_half_float_pixel",                    o(ARB_half_float_pixel),                    GL,             2003 },
    { "GL_ARB_half_float_vertex",                   o(ARB_half_float_vertex),                   GL,             2008 },
    { "GL_ARB_instanced_arrays",                    o(ARB_instanced_arrays),                    GL,             2008 },
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 6108a35..ef646ce 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2965,6 +2965,7 @@ struct gl_extensions
    GLboolean ARB_framebuffer_object;
    GLboolean ARB_explicit_attrib_location;
    GLboolean ARB_geometry_shader4;
+   GLboolean ARB_gpu_shader5;
    GLboolean ARB_half_float_pixel;
    GLboolean ARB_half_float_vertex;
    GLboolean ARB_instanced_arrays;
-- 
1.7.8.6



More information about the mesa-dev mailing list