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

Eric Anholt eric at anholt.net
Sun Sep 22 13:05:21 PDT 2013


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>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-stable/attachments/20130922/09198efa/attachment.pgp>


More information about the mesa-stable mailing list