[Mesa-dev] [PATCH 26/37] glsl: Add extension infrastructure for ARB_viewport_array

Ian Romanick idr at freedesktop.org
Fri Jan 17 17:03:46 PST 2014


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

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
 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 +
 4 files changed, 7 insertions(+)

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 55c4981..bbe8a06 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -1284,6 +1284,9 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
 
 	      if (extensions->AMD_shader_trinary_minmax)
 	         add_builtin_define(parser, "GL_AMD_shader_trinary_minmax", 1);
+
+	      if (extensions->ARB_viewport_array)
+	         add_builtin_define(parser, "GL_ARB_viewport_array", 1);
 	   }
 	}
 
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 21dc3ab..ddb3d2d 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -513,6 +513,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(ARB_shader_atomic_counters,     true,  false,     ARB_shader_atomic_counters),
    EXT(ARB_sample_shading,             true,  false,     ARB_sample_shading),
    EXT(AMD_shader_trinary_minmax,      true,  false,     dummy_true),
+   EXT(ARB_viewport_array,             true,  false,     ARB_viewport_array),
 };
 
 #undef EXT
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 2444a96..6f60b73 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -352,6 +352,8 @@ struct _mesa_glsl_parse_state {
    bool ARB_shader_atomic_counters_warn;
    bool AMD_shader_trinary_minmax_enable;
    bool AMD_shader_trinary_minmax_warn;
+   bool ARB_viewport_array_enable;
+   bool ARB_viewport_array_warn;
    /*@}*/
 
    /** Extensions supported by the OpenGL implementation. */
diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp
index 257d2e7..9179471 100644
--- a/src/glsl/standalone_scaffolding.cpp
+++ b/src/glsl/standalone_scaffolding.cpp
@@ -110,6 +110,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
    ctx->Extensions.ARB_texture_query_levels = true;
    ctx->Extensions.ARB_texture_query_lod = true;
    ctx->Extensions.ARB_uniform_buffer_object = true;
+   ctx->Extensions.ARB_viewport_array = true;
 
    ctx->Extensions.OES_EGL_image_external = true;
    ctx->Extensions.OES_standard_derivatives = true;
-- 
1.8.1.4



More information about the mesa-dev mailing list