[Mesa-dev] [PATCH v2 12/82] glsl: shader buffer variables cannot have initializers

Samuel Iglesias Gonsálvez siglesias at igalia.com
Tue Jun 9 23:01:01 PDT 2015



On 09/06/15 20:29, Jordan Justen wrote:
> On 2015-06-03 00:01:02, Iago Toral Quiroga wrote:
>> From: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
>>
>> Section 4.3.7 "Buffer Variables" of the GLSL 4.30 spec:
>>
>>     "Buffer variables cannot have initializers."
>>
>> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
>> ---
>>  src/glsl/ast_to_hir.cpp | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
>> index 73d3c78..d246c00 100644
>> --- a/src/glsl/ast_to_hir.cpp
>> +++ b/src/glsl/ast_to_hir.cpp
>> @@ -2995,6 +2995,15 @@ process_initializer(ir_variable *var, ast_declaration *decl,
>>                             "cannot initialize uniforms");
>>     }
>>  
>> +   /* Section 4.3.7 "Buffer Variables" of the GLSL 4.30 spec:
>> +    *
>> +    *    "Buffer variables cannot have initializers."
>> +    */
>> +   if (var->data.mode == ir_var_shader_storage) {
>> +      _mesa_glsl_error(& initializer_loc, state,
>> +                       "cannot initialize shader buffer variables");
> 
> I think this is copied from the similar uniform case, but the wording
> seems ambiguous. Wouldn't "SSBO variables cannot have initializers" be
> more clear? Otherwise, the message sounds like a possible internal
> compiler error.
> 
> Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
> 

OK, I will change it.

Thanks!

Sam

>> +   }
>> +
>>     /* From section 4.1.7 of the GLSL 4.40 spec:
>>      *
>>      *    "Opaque variables [...] are initialized only through the
>> -- 
>> 1.9.1
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list