From a0b4a1330be6a36ad095222d2ea83927cd33514d Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 25 Nov 2011 08:22:48 +0100 Subject: mesa xserver pixman git update 25 nov 2011 --- mesalib/src/glsl/ast_to_hir.cpp | 10 +++++++--- mesalib/src/glsl/glcpp/glcpp-parse.y | 2 +- mesalib/src/glsl/glsl_lexer.ll | 1 + mesalib/src/glsl/glsl_parser.yy | 9 ++++++++- mesalib/src/glsl/glsl_parser_extras.cpp | 4 ++-- mesalib/src/glsl/link_uniforms.cpp | 10 +++++----- 6 files changed, 24 insertions(+), 12 deletions(-) (limited to 'mesalib/src/glsl') diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp index ac090c315..d5b04e9d7 100644 --- a/mesalib/src/glsl/ast_to_hir.cpp +++ b/mesalib/src/glsl/ast_to_hir.cpp @@ -2090,6 +2090,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, * The following extension do not allow the deprecated keywords: * * GL_AMD_conservative_depth + * GL_ARB_conservative_depth * GL_ARB_gpu_shader5 * GL_ARB_separate_shader_objects * GL_ARB_tesselation_shader @@ -2122,9 +2123,11 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, + qual->flags.q.depth_less + qual->flags.q.depth_unchanged; if (depth_layout_count > 0 - && !state->AMD_conservative_depth_enable) { + && !state->AMD_conservative_depth_enable + && !state->ARB_conservative_depth_enable) { _mesa_glsl_error(loc, state, - "extension GL_AMD_conservative_depth must be enabled " + "extension GL_AMD_conservative_depth or " + "GL_ARB_conservative_depth must be enabled " "to use depth layout qualifiers"); } else if (depth_layout_count > 0 && strcmp(var->name, "gl_FragDepth") != 0) { @@ -2237,7 +2240,8 @@ get_variable_being_redeclared(ir_variable *var, ast_declaration *decl, earlier->interpolation = var->interpolation; /* Layout qualifiers for gl_FragDepth. */ - } else if (state->AMD_conservative_depth_enable + } else if ((state->AMD_conservative_depth_enable || + state->ARB_conservative_depth_enable) && strcmp(var->name, "gl_FragDepth") == 0 && earlier->type == var->type && earlier->mode == var->mode) { diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y index c0457b057..2b7e65cd4 100644 --- a/mesalib/src/glsl/glcpp/glcpp-parse.y +++ b/mesalib/src/glsl/glcpp/glcpp-parse.y @@ -1135,7 +1135,7 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) if (extensions->ARB_draw_instanced) add_builtin_define(parser, "GL_ARB_draw_instanced", 1); - if (extensions->AMD_conservative_depth) { + if (extensions->ARB_conservative_depth) { add_builtin_define(parser, "GL_AMD_conservative_depth", 1); add_builtin_define(parser, "GL_ARB_conservative_depth", 1); } diff --git a/mesalib/src/glsl/glsl_lexer.ll b/mesalib/src/glsl/glsl_lexer.ll index 49f3bc82e..c7cfedd42 100644 --- a/mesalib/src/glsl/glsl_lexer.ll +++ b/mesalib/src/glsl/glsl_lexer.ll @@ -310,6 +310,7 @@ void return VOID_TOK; layout { if ((yyextra->language_version >= 140) || yyextra->AMD_conservative_depth_enable + || yyextra->ARB_conservative_depth_enable || yyextra->ARB_explicit_attrib_location_enable || yyextra->ARB_fragment_coord_conventions_enable) { return LAYOUT_TOK; diff --git a/mesalib/src/glsl/glsl_parser.yy b/mesalib/src/glsl/glsl_parser.yy index 836390453..71ab039d6 100644 --- a/mesalib/src/glsl/glsl_parser.yy +++ b/mesalib/src/glsl/glsl_parser.yy @@ -1124,7 +1124,9 @@ layout_qualifier_id: } /* Layout qualifiers for AMD/ARB_conservative_depth. */ - if (!got_one && state->AMD_conservative_depth_enable) { + if (!got_one && + (state->AMD_conservative_depth_enable || + state->ARB_conservative_depth_enable)) { if (strcmp($1, "depth_any") == 0) { got_one = true; $$.flags.q.depth_any = 1; @@ -1140,6 +1142,11 @@ layout_qualifier_id: } if (got_one && state->AMD_conservative_depth_warn) { + _mesa_glsl_warning(& @1, state, + "GL_AMD_conservative_depth " + "layout qualifier `%s' is used\n", $1); + } + if (got_one && state->ARB_conservative_depth_warn) { _mesa_glsl_warning(& @1, state, "GL_ARB_conservative_depth " "layout qualifier `%s' is used\n", $1); diff --git a/mesalib/src/glsl/glsl_parser_extras.cpp b/mesalib/src/glsl/glsl_parser_extras.cpp index 23aadb143..0b4ccac53 100644 --- a/mesalib/src/glsl/glsl_parser_extras.cpp +++ b/mesalib/src/glsl/glsl_parser_extras.cpp @@ -256,7 +256,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_conservative_depth, false, false, true, true, false, ARB_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), @@ -265,7 +265,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(EXT_texture_array, true, false, true, true, false, EXT_texture_array), EXT(ARB_shader_texture_lod, true, false, true, true, false, ARB_shader_texture_lod), EXT(ARB_shader_stencil_export, false, false, true, true, false, ARB_shader_stencil_export), - EXT(AMD_conservative_depth, true, false, true, true, false, AMD_conservative_depth), + EXT(AMD_conservative_depth, false, false, true, true, false, ARB_conservative_depth), EXT(AMD_shader_stencil_export, false, false, true, true, false, ARB_shader_stencil_export), EXT(OES_texture_3D, true, false, true, false, true, EXT_texture3D), EXT(OES_EGL_image_external, true, false, true, false, true, OES_EGL_image_external), diff --git a/mesalib/src/glsl/link_uniforms.cpp b/mesalib/src/glsl/link_uniforms.cpp index ca5da3040..c7de480a5 100644 --- a/mesalib/src/glsl/link_uniforms.cpp +++ b/mesalib/src/glsl/link_uniforms.cpp @@ -114,7 +114,7 @@ class count_uniform_size : public uniform_field_visitor { public: count_uniform_size(struct string_to_uint_map *map) : num_active_uniforms(0), num_values(0), num_shader_samplers(0), - num_shader_uniforms(0), map(map) + num_shader_uniform_components(0), map(map) { /* empty */ } @@ -122,7 +122,7 @@ public: void start_shader() { this->num_shader_samplers = 0; - this->num_shader_uniforms = 0; + this->num_shader_uniform_components = 0; } /** @@ -143,7 +143,7 @@ public: /** * Number of uniforms used in the current shader */ - unsigned num_shader_uniforms; + unsigned num_shader_uniform_components; private: virtual void visit_field(const glsl_type *type, const char *name) @@ -165,7 +165,7 @@ private: * Note that samplers do not count against this limit because they * don't use any storage on current hardware. */ - this->num_shader_uniforms += values; + this->num_shader_uniform_components += values; } /* If the uniform is already in the map, there's nothing more to do. @@ -321,7 +321,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog) prog->_LinkedShaders[i]->num_samplers = uniform_size.num_shader_samplers; prog->_LinkedShaders[i]->num_uniform_components = - uniform_size.num_shader_uniforms * 4; + uniform_size.num_shader_uniform_components; } const unsigned num_user_uniforms = uniform_size.num_active_uniforms; -- cgit v1.2.3