mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
i965/vec4: Simplify the computation of coord_mask and zero_mask.
We can easily compute these without loops, resulting in simpler and shorter code. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Suggested-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
This commit is contained in:
parent
66be7b4c27
commit
17eb1df7b8
1 changed files with 2 additions and 5 deletions
|
|
@ -2221,13 +2221,10 @@ vec4_visitor::visit(ir_texture *ir)
|
|||
int writemask = brw->gen == 4 ? WRITEMASK_W : WRITEMASK_X;
|
||||
emit(MOV(dst_reg(MRF, param_base, lod_type, writemask), lod));
|
||||
} else {
|
||||
int i, coord_mask = 0, zero_mask = 0;
|
||||
/* Load the coordinate */
|
||||
/* FINISHME: gl_clamp_mask and saturate */
|
||||
for (i = 0; i < ir->coordinate->type->vector_elements; i++)
|
||||
coord_mask |= (1 << i);
|
||||
for (; i < 4; i++)
|
||||
zero_mask |= (1 << i);
|
||||
int coord_mask = (1 << ir->coordinate->type->vector_elements) - 1;
|
||||
int zero_mask = 0xf & ~coord_mask;
|
||||
|
||||
if (ir->offset && ir->op == ir_txf) {
|
||||
/* It appears that the ld instruction used for txf does its
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue