[Mesa-dev] [PATCH] glsl: set user defined varyings to smooth by default in ES

Ian Romanick idr at freedesktop.org
Tue Feb 16 19:55:46 UTC 2016


On 02/15/2016 11:26 PM, Iago Toral wrote:
> On Tue, 2016-02-16 at 11:03 +1100, Timothy Arceri wrote:
>> This is usually handled by the backends in order to handle the
>> various interactions with the gl_*Color built-ins.
>>
>> The problem is this means linking will fail if one side on the
>> interface adds the smooth qualifier to the varying and the other
>> side just uses the default even though they match.
>>
>> This fixes various deqp tests. The spec is not clear what to for
>> deskto GL so leave it as is for now.
   desktop

>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92743
>> ---
>>  src/compiler/glsl/ast_to_hir.cpp | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
>> index b639378..4203cd5 100644
>> --- a/src/compiler/glsl/ast_to_hir.cpp
>> +++ b/src/compiler/glsl/ast_to_hir.cpp
>> @@ -2750,6 +2750,17 @@ interpret_interpolation_qualifier(const struct ast_type_qualifier *qual,
>>                            "vertex shader inputs or fragment shader outputs",
>>                            interpolation_string(interpolation));
>>        }
>> +   } else if (state->es_shader &&
>> +              ((mode == ir_var_shader_in &&
>> +                state->stage != MESA_SHADER_VERTEX) ||
>> +               (mode == ir_var_shader_out &&
>> +                state->stage != MESA_SHADER_FRAGMENT))) {
>> +      /* From Section 4.3.9 (Interpolation) of the GLSL ES spec:

             Section 4.3.8 (Interpolation) of the GLSL ES X.Y spec says:

>> +       *
>> +       *    " When no interpolation qualifier is present, smooth interpolation
                 ^ Extra space

With those fixed, this patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

>> +       *    is used."
>> +       */
>> +      interpolation = INTERP_QUALIFIER_SMOOTH;
>>     }
>>  
>>     return interpolation;
> 
> Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
> 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 



More information about the mesa-dev mailing list