[Mesa-dev] [PATCH] i965: Fix cube array coordinate normalization

Chris Forbes chrisf at ijw.co.nz
Wed Sep 25 23:21:57 PDT 2013


Fixed and landed on master now.

On Mon, Sep 23, 2013 at 8:05 AM, Eric Anholt <eric at anholt.net> wrote:
> Chris Forbes <chrisf at ijw.co.nz> writes:
>
>> Hardware requires the magnitude of the largest component to not exceed
>> 1; brw_cubemap_normalize ensures that this is the case.
>>
>> Unfortunately, we would previously multiply the array index for cube
>> arrays by the normalization factor. The incorrect array index would then
>> cause the sampler to attempt to access either the wrong cube, or memory
>> outside the cube surface entirely, resulting in garbage rendering or in
>> the worst case, hangs.
>
>> +   /* coordinate.xyz *= expr */
>> +   assign = new(mem_ctx) ir_assignment(
>> +      new(mem_ctx) ir_dereference_variable(var),
>> +      new(mem_ctx) ir_expression(ir_binop_mul,
>> +         ir->coordinate->type,
>> +            new(mem_ctx) ir_dereference_variable(var),
>> +            expr));
>
> Something went weird with your indentation here.  They ought to line up
> with the ir_binop_mul.
>
> Other than that,
>
> Reviewed-by: Eric Anholt <eric at anholt.net>


More information about the mesa-dev mailing list