mesa: Add infrastructure for GL_ARB_sample_shading
authorAnuj Phogat <anuj.phogat@gmail.com>
Fri, 30 Aug 2013 19:34:36 +0000 (12:34 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Fri, 1 Nov 2013 23:01:47 +0000 (16:01 -0700)
This patch implements the common support code required for the
GL_ARB_sample_shading extension.

V2: Move GL_ARB_sample_shading to ARB extension list.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Ken Graunke <kenneth@whitecape.org>
src/glsl/glcpp/glcpp-parse.y
src/glsl/glsl_parser_extras.cpp
src/glsl/glsl_parser_extras.h
src/glsl/standalone_scaffolding.cpp
src/mesa/main/extensions.c
src/mesa/main/mtypes.h

index 86f3cd5aa47d0c884c20210cda83437f428babc9..7edc27488a0b1c12cf44fa1ebbfa46d86e24d7ce 100644 (file)
@@ -1249,6 +1249,9 @@ 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->ARB_sample_shading)
+                add_builtin_define(parser, "GL_ARB_sample_shading", 1);
+
              if (extensions->EXT_shader_integer_mix)
                 add_builtin_define(parser, "GL_EXT_shader_integer_mix", 1);
 
index 6589b51872c42aa261f9ea23ad791a744b33ca84..d922db9dbf28b67335966c9d50b2d9086837e75a 100644 (file)
@@ -540,6 +540,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(EXT_shader_integer_mix,         true,  true,      EXT_shader_integer_mix),
    EXT(ARB_texture_gather,             true,  false,     ARB_texture_gather),
    EXT(ARB_shader_atomic_counters,     true,  false,     ARB_shader_atomic_counters),
+   EXT(ARB_sample_shading,             true,  false,     ARB_sample_shading),
 };
 
 #undef EXT
index f22dac3559333dcd03d00765bf23df9ccc87cdb1..345d7a0187ed33cad3794d29b94096d22c9b7fce 100644 (file)
@@ -350,6 +350,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 ARB_sample_shading_enable;
+   bool ARB_sample_shading_warn;
    bool EXT_shader_integer_mix_enable;
    bool EXT_shader_integer_mix_warn;
    bool ARB_shader_atomic_counters_enable;
index 7a1cf6877293fe5628d302870376f8c5356aa4c8..cbff6d182286af70e3e0d3bed656d588bd14d970 100644 (file)
@@ -97,6 +97,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
    ctx->Extensions.ARB_explicit_attrib_location = true;
    ctx->Extensions.ARB_fragment_coord_conventions = true;
    ctx->Extensions.ARB_gpu_shader5 = true;
+   ctx->Extensions.ARB_sample_shading = true;
    ctx->Extensions.ARB_shader_bit_encoding = true;
    ctx->Extensions.ARB_shader_stencil_export = true;
    ctx->Extensions.ARB_shader_texture_lod = true;
index 285ec377cfdc0f7b735c133da4a03d7031506863..48c4e9f1b01f8fbcdeb3c2bceefa5fb00d1b714f 100644 (file)
@@ -118,6 +118,7 @@ static const struct extension extension_table[] = {
    { "GL_ARB_point_sprite",                        o(ARB_point_sprite),                        GL,             2003 },
    { "GL_ARB_provoking_vertex",                    o(EXT_provoking_vertex),                    GL,             2009 },
    { "GL_ARB_robustness",                          o(dummy_true),                              GL,             2010 },
+   { "GL_ARB_sample_shading",                      o(ARB_sample_shading),                      GL,             2009 },
    { "GL_ARB_sampler_objects",                     o(dummy_true),                              GL,             2009 },
    { "GL_ARB_seamless_cube_map",                   o(ARB_seamless_cube_map),                   GL,             2009 },
    { "GL_ARB_shader_atomic_counters",              o(ARB_shader_atomic_counters),              GL,             2011 },
index 087bc3727071f22cab56c666167b3468b42d8f4f..476888b508b84be1e68c677abba925172f3d7f7a 100644 (file)
@@ -3245,6 +3245,7 @@ struct gl_extensions
    GLboolean ARB_occlusion_query;
    GLboolean ARB_occlusion_query2;
    GLboolean ARB_point_sprite;
+   GLboolean ARB_sample_shading;
    GLboolean ARB_seamless_cube_map;
    GLboolean ARB_shader_atomic_counters;
    GLboolean ARB_shader_bit_encoding;