[Mesa-dev] [PATCH v2 3/3] glsl: Use array deref for access to vector components

Matt Turner mattst88 at gmail.com
Wed Nov 11 20:57:55 PST 2015


On Wed, Nov 11, 2015 at 8:47 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Nov 11, 2015 9:10 PM, "Matt Turner" <mattst88 at gmail.com> wrote:
>>
>> On Thu, Nov 5, 2015 at 9:44 PM, Kristian Høgsberg Kristensen
>> <krh at bitplanet.net> wrote:
>> > diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
>> > index e4e4a3f..5584470 100644
>> > --- a/src/glsl/ast_function.cpp
>> > +++ b/src/glsl/ast_function.cpp
>> > @@ -376,12 +368,8 @@ fix_parameter(void *mem_ctx, ir_rvalue *actual,
>> > const glsl_type *formal_type,
>> >
>> >     ir_rvalue *lhs = actual;
>> >     if (expr != NULL && expr->operation == ir_binop_vector_extract) {
>> > -      rhs = new(mem_ctx) ir_expression(ir_triop_vector_insert,
>> > -                                       expr->operands[0]->type,
>> > -
>> > expr->operands[0]->clone(mem_ctx, NULL),
>> > -                                       rhs,
>> > -
>> > expr->operands[1]->clone(mem_ctx, NULL));
>> > -      lhs = expr->operands[0]->clone(mem_ctx, NULL);
>> > +      lhs == new(mem_ctx)
>> > ir_dereference_array(expr->operands[0]->clone(mem_ctx, NULL),
>> > +
>> > expr->operands[1]->clone(mem_ctx, NULL));
>>
>>
>> I'm getting
>>
>> ../../../mesa/src/glsl/ast_function.cpp: In function ‘void
>> fix_parameter(void*, ir_rvalue*, const glsl_type*, exec_list*,
>> exec_list*, bool)’:
>> ../../../mesa/src/glsl/ast_function.cpp:372:88: warning: right operand
>> of comma operator has no effect [-Wunused-value]
>>
>> expr->operands[1]->clone(mem_ctx, NULL));
>>
>> from this, but I can't interpret the warning.
>>
>
> Probably one equal sign too many...

Wow! How it this working?!


More information about the mesa-dev mailing list