glsl: Implement the GL_ARB_conservative_depth extension.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 9 Aug 2011 17:53:29 +0000 (10:53 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 25 Aug 2011 15:07:21 +0000 (08:07 -0700)
It's the same as GL_AMD_conservative_depth.  The specs have slight
differences in wording, but don't differ in content or behavior.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
docs/GL3.txt
src/glsl/glsl_parser.yy
src/glsl/glsl_parser_extras.cpp
src/glsl/glsl_parser_extras.h
src/glsl/ir.h
src/glsl/linker.cpp
src/mesa/main/extensions.c

index c0cc4d172e04a17338a26521f057a6ccc792d449..ff1f5020a5b405ecf2b2d69237f701ef653633d5 100644 (file)
@@ -123,7 +123,7 @@ GL_ARB_texture_storage                               not started
 GL_ARB_transform_feedback_instanced                  not started
 GL_ARB_base_instance                                 not started
 GL_ARB_shader_image_load_store                       not started
-GL_ARB_conservative_depth                            not started (may be close to AMD_conservative_depth though)
+GL_ARB_conservative_depth                            DONE (compiler)
 GL_ARB_shading_language_420pack                      not started
 GL_ARB_internalformat_query                          not started
 GL_ARB_map_buffer_alignment                          not started
index 1851f1e202e298ad1bf7a4a8e0d1a7d7d28a28b8..25d02fb1eafd43093077cfea059576124b49d81b 100644 (file)
@@ -1111,7 +1111,7 @@ layout_qualifier_id:
              }
           }
 
-          /* Layout qualifiers for AMD_conservative_depth. */
+          /* Layout qualifiers for AMD/ARB_conservative_depth. */
           if (!got_one && state->AMD_conservative_depth_enable) {
              if (strcmp($1, "depth_any") == 0) {
                 got_one = true;
@@ -1129,7 +1129,7 @@ layout_qualifier_id:
        
              if (got_one && state->AMD_conservative_depth_warn) {
                 _mesa_glsl_warning(& @1, state,
-                                   "GL_AMD_conservative_depth "
+                                   "GL_ARB_conservative_depth "
                                    "layout qualifier `%s' is used\n", $1);
              }
           }
index cc781378d76bb57c9bdf310d406ef520da3bb70c..8f740e6a8e93ae1ec0d04b49afc4e93eda6608e2 100644 (file)
@@ -253,6 +253,7 @@ struct _mesa_glsl_extension {
 static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    /*                                  target availability  API availability */
    /* name                             VS     GS     FS     GL     ES         supported flag */
+   EXT(ARB_conservative_depth,         true,  false, true,  true,  false,     AMD_conservative_depth),
    EXT(ARB_draw_buffers,               false, false, true,  true,  false,     dummy_true),
    EXT(ARB_draw_instanced,             true,  false, false, true,  false,     ARB_draw_instanced),
    EXT(ARB_explicit_attrib_location,   true,  false, true,  true,  false,     ARB_explicit_attrib_location),
index fc392da5b21b22d381087cac2dfab6280bd19c78..dc6911d1c9a0c595c5091469a8ccf57c43a81c90 100644 (file)
@@ -180,6 +180,8 @@ struct _mesa_glsl_parse_state {
    bool ARB_shader_stencil_export_warn;
    bool AMD_conservative_depth_enable;
    bool AMD_conservative_depth_warn;
+   bool ARB_conservative_depth_enable;
+   bool ARB_conservative_depth_warn;
    bool AMD_shader_stencil_export_enable;
    bool AMD_shader_stencil_export_warn;
    bool OES_texture_3D_enable;
index 990aaa16af369cdd4cdd8df9034d967826c5cfa2..2e899f3ed6f88ce23b9e68ccd6cfcfcc56b3b523 100644 (file)
@@ -236,7 +236,7 @@ enum ir_variable_interpolation {
 /**
  * \brief Layout qualifiers for gl_FragDepth.
  *
- * The AMD_conservative_depth extension allows gl_FragDepth to be redeclared
+ * The AMD/ARB_conservative_depth extensions allow gl_FragDepth to be redeclared
  * with a layout qualifier.
  */
 enum ir_depth_layout {
index b54ef41080af20e76a45cd2a0d6b90da5f03085e..ba81c59ff2ca021c440113ef10a7c424bd2098cc 100644 (file)
@@ -395,7 +395,7 @@ cross_validate_globals(struct gl_shader_program *prog,
 
         /* Validate layout qualifiers for gl_FragDepth.
          *
-         * From the AMD_conservative_depth spec:
+         * From the AMD/ARB_conservative_depth specs:
          *    "If gl_FragDepth is redeclared in any fragment shader in
          *    a program, it must be redeclared in all fragment shaders in that
          *    program that have static assignments to gl_FragDepth. All
index bc61c50a90fdb000dc6bfe019f31db84f1b924cd..14b0cf9acbd43c9c5f6bb0955dac935eb4c6f0ac 100644 (file)
@@ -81,6 +81,7 @@ static const struct extension extension_table[] = {
    { "GL_ARB_blend_func_extended",                 o(ARB_blend_func_extended),                 GL,             2009 },
    { "GL_ARB_color_buffer_float",                  o(ARB_color_buffer_float),                  GL,             2004 },
    { "GL_ARB_copy_buffer",                         o(ARB_copy_buffer),                         GL,             2008 },
+   { "GL_ARB_conservative_depth",                  o(AMD_conservative_depth),                  GL,             2011 },
    { "GL_ARB_depth_buffer_float",                  o(ARB_depth_buffer_float),                  GL,             2008 },
    { "GL_ARB_depth_clamp",                         o(ARB_depth_clamp),                         GL,             2003 },
    { "GL_ARB_depth_texture",                       o(ARB_depth_texture),                       GL,             2001 },