glsl: Add extension plumbing and define for ARB_shader_subroutine
authorChris Forbes <chrisf@ijw.co.nz>
Sun, 10 Aug 2014 09:31:06 +0000 (21:31 +1200)
committerDave Airlie <airlied@redhat.com>
Thu, 23 Jul 2015 07:25:15 +0000 (17:25 +1000)
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/glsl/glcpp/glcpp-parse.y
src/glsl/glsl_parser_extras.cpp
src/glsl/glsl_parser_extras.h
src/glsl/standalone_scaffolding.cpp

index 4236fb319d327cb182a094a250871e5e0ce27b0f..7ef4dfd531657950ff64bff6f48d015f5b67a345 100644 (file)
@@ -2489,6 +2489,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
 
              if (extensions->ARB_tessellation_shader)
                 add_builtin_define(parser, "GL_ARB_tessellation_shader", 1);
+
+              if (extensions->ARB_shader_subroutine)
+                 add_builtin_define(parser, "GL_ARB_shader_subroutine", 1);
           }
        }
 
index 43a3cd13f26bc3eef6440d33b7a02e5df8ee8a7c..8bc690df6ff33aa4cbdfe7a90b0c14ec959dac1f 100644 (file)
@@ -598,6 +598,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(ARB_shader_precision,             true,  false,     ARB_shader_precision),
    EXT(ARB_shader_stencil_export,        true,  false,     ARB_shader_stencil_export),
    EXT(ARB_shader_storage_buffer_object, true,  false,     ARB_shader_storage_buffer_object),
+   EXT(ARB_shader_subroutine,            true,  false,     ARB_shader_subroutine),
    EXT(ARB_shader_texture_lod,           true,  false,     ARB_shader_texture_lod),
    EXT(ARB_shading_language_420pack,     true,  false,     ARB_shading_language_420pack),
    EXT(ARB_shading_language_packing,     true,  false,     ARB_shading_language_packing),
index f4b60afcb37a51ef649d7462bc90eab9cf86866b..564820183f5394c053d87d555da794c24c8c3219 100644 (file)
@@ -496,6 +496,8 @@ struct _mesa_glsl_parse_state {
    bool ARB_shader_stencil_export_warn;
    bool ARB_shader_storage_buffer_object_enable;
    bool ARB_shader_storage_buffer_object_warn;
+   bool ARB_shader_subroutine_enable;
+   bool ARB_shader_subroutine_warn;
    bool ARB_shader_texture_lod_enable;
    bool ARB_shader_texture_lod_warn;
    bool ARB_shading_language_420pack_enable;
index 057ca6ee8a704d96550648650e4944c1e6cc3957..6033364afc5e033425f5d718d38ec4598ab9ad06 100644 (file)
@@ -133,6 +133,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
    ctx->Extensions.ARB_sample_shading = true;
    ctx->Extensions.ARB_shader_bit_encoding = true;
    ctx->Extensions.ARB_shader_stencil_export = true;
+   ctx->Extensions.ARB_shader_subroutine = true;
    ctx->Extensions.ARB_shader_texture_lod = true;
    ctx->Extensions.ARB_shading_language_420pack = true;
    ctx->Extensions.ARB_shading_language_packing = true;