On Wed, Oct 7, 2015 at 1:12 AM, Iago Toral Quiroga <ito...@igalia.com> wrote:
> GLSL Spec 4.20.8, 4.3 Storage Qualifiers:
>
> "Initializers in global declarations may only be used in declarations of
>  global variables with no storage qualifier, with a const qualifier or
>  with a uniform qualifier."
>
> We do this for input variables, but not for output variables. AMD and NVIDIA
> proprietary drivers don't allow this either.
> ---
>  src/glsl/ast_to_hir.cpp | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index 9511440..da79597 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -3201,6 +3201,12 @@ process_initializer(ir_variable *var, ast_declaration 
> *decl,
>                        ? "attribute" : "varying");
>     }
>
> +   if ((var->data.mode == ir_var_shader_out) && (state->current_function == 
> NULL)) {

No need for the parentheses.

Reviewed-by: Matt Turner <matts...@gmail.com>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to