summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-01-16 19:08:12 -0800
committerKenneth Graunke <kenneth@whitecape.org>2013-01-30 12:15:38 -0800
commitde150e24781cfb9f2f7e62355f3af68d23c681df (patch)
tree7aaf309b188a475cd2c1102797300901fd9f9a8d
parenta3d2e3e061f219edc684e46b4c27d3fbcf322c18 (diff)
i965/vs: Create a 'lod_type' temporary for ir->lod_info.lod->type.
This is purely a refactor. However, in a moment, we'll want to set lod_type to float for ir_tex, where ir->lod_info.lod is NULL. NOTE: This is a candidate for stable branches (for the next patch). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <idr@freedesktop.org> (cherry picked from commit 56ce55d198af65d4a9de7119eb9e2417296c54ea)
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 59428a1921..e95a5a1f59 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -1853,6 +1853,7 @@ vec4_visitor::visit(ir_texture *ir)
shadow_comparitor = this->result;
}
+ const glsl_type *lod_type;
src_reg lod, dPdx, dPdy;
switch (ir->op) {
case ir_txf:
@@ -1860,6 +1861,7 @@ vec4_visitor::visit(ir_texture *ir)
case ir_txs:
ir->lod_info.lod->accept(this);
lod = this->result;
+ lod_type = ir->lod_info.lod->type;
break;
case ir_txd:
ir->lod_info.grad.dPdx->accept(this);
@@ -1867,6 +1869,8 @@ vec4_visitor::visit(ir_texture *ir)
ir->lod_info.grad.dPdy->accept(this);
dPdy = this->result;
+
+ lod_type = ir->lod_info.grad.dPdx->type;
break;
case ir_tex:
case ir_txb:
@@ -1908,8 +1912,7 @@ vec4_visitor::visit(ir_texture *ir)
if (ir->op == ir_txs) {
int writemask = intel->gen == 4 ? WRITEMASK_W : WRITEMASK_X;
- emit(MOV(dst_reg(MRF, param_base, ir->lod_info.lod->type, writemask),
- lod));
+ emit(MOV(dst_reg(MRF, param_base, lod_type, writemask), lod));
} else {
int i, coord_mask = 0, zero_mask = 0;
/* Load the coordinate */
@@ -1967,12 +1970,12 @@ vec4_visitor::visit(ir_texture *ir)
mrf = param_base;
writemask = WRITEMASK_Z;
}
- emit(MOV(dst_reg(MRF, mrf, ir->lod_info.lod->type, writemask), lod));
+ emit(MOV(dst_reg(MRF, mrf, lod_type, writemask), lod));
} else if (ir->op == ir_txf) {
- emit(MOV(dst_reg(MRF, param_base, ir->lod_info.lod->type, WRITEMASK_W),
+ emit(MOV(dst_reg(MRF, param_base, lod_type, WRITEMASK_W),
lod));
} else if (ir->op == ir_txd) {
- const glsl_type *type = ir->lod_info.grad.dPdx->type;
+ const glsl_type *type = lod_type;
if (intel->gen >= 5) {
dPdx.swizzle = BRW_SWIZZLE4(SWIZZLE_X,SWIZZLE_X,SWIZZLE_Y,SWIZZLE_Y);