From: Ian Romanick <[email protected]> Fixes piglit tests const-inout-parameter.frag and const-out-parameter.frag.
Signed-off-by: Ian Romanick <[email protected]> Cc: "9.2" [email protected] Cc: Matt Turner <[email protected]> --- This currently causes a regression in relaxed-parameter-qualifier-ordering.vert. I believe that test is incorrect (by using const with out and inout parameters), and a patch has been sent to the piglit list already. src/glsl/ast_to_hir.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 482ab3c..6266456 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1967,6 +1967,21 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, _mesa_glsl_shader_target_name(state->target)); } + /* Section 6.1.1 (Function Calling Conventions) of the GLSL 1.10 spec says: + * + * "However, the const qualifier cannot be used with out or inout." + * + * The same section of the GLSL 4.40 spec further clarifies this saying: + * + * "The const qualifier cannot be used with out or inout, or a + * compile-time error results." + */ + if (is_parameter && qual->flags.q.constant && qual->flags.q.out) { + _mesa_glsl_error(loc, state, + "`const' may not be applied to `out' or `inout' " + "function parameters"); + } + /* If there is no qualifier that changes the mode of the variable, leave * the setting alone. */ -- 1.8.1.4 _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
