Mesa (9.2): i965: fix bogus swizzle in brw_cubemap_normalize
Carl Worth
cworth at kemper.freedesktop.org
Thu Oct 3 05:01:21 UTC 2013
Module: Mesa
Branch: 9.2
Commit: 88513d6485f55fe33a0a40d9394ede6dc0d2feec
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=88513d6485f55fe33a0a40d9394ede6dc0d2feec
Author: Chris Forbes <chrisf at ijw.co.nz>
Date: Mon Sep 30 22:10:17 2013 +1300
i965: fix bogus swizzle in brw_cubemap_normalize
When used with a cube array in VS, failed assertion in ir_validate:
Assignment count of LHS write mask channels enabled not
matching RHS vector size (3 LHS, 4 RHS).
To fix this, swizzle the RHS correctly for the writemask.
This showed up in the ARB_texture_gather tests, which exercise cube
arrays in the VS.
Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
Cc: "9.2" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit 0d7fc10bcd2efb2f96d684b3273b4e0c0b0afef0)
---
.../drivers/dri/i965/brw_cubemap_normalize.cpp | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp b/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
index 46155fb..949414c 100644
--- a/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
+++ b/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
@@ -92,10 +92,12 @@ brw_cubemap_normalize_visitor::visit_leave(ir_texture *ir)
/* 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));
+ new(mem_ctx) ir_swizzle(
+ new(mem_ctx) ir_expression(ir_binop_mul,
+ ir->coordinate->type,
+ new(mem_ctx) ir_dereference_variable(var),
+ expr),
+ 0, 1, 2, 0, 3));
assign->write_mask = WRITEMASK_XYZ;
base_ir->insert_before(assign);
ir->coordinate = new(mem_ctx) ir_dereference_variable(var);
More information about the mesa-commit
mailing list