mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
i965/fs: Pass fs_regs by constant reference where possible.
These functions (modulo emit_lrp, necessitating the small fix-up) pass these arguments by value unmodified to other functions. No point in making an additional copy. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
070f20272f
commit
326fc60ee9
3 changed files with 19 additions and 14 deletions
|
|
@ -244,8 +244,9 @@ fs_visitor::CMP(fs_reg dst, fs_reg src0, fs_reg src1, uint32_t condition)
|
|||
}
|
||||
|
||||
exec_list
|
||||
fs_visitor::VARYING_PULL_CONSTANT_LOAD(fs_reg dst, fs_reg surf_index,
|
||||
fs_reg varying_offset,
|
||||
fs_visitor::VARYING_PULL_CONSTANT_LOAD(const fs_reg &dst,
|
||||
const fs_reg &surf_index,
|
||||
const fs_reg &varying_offset,
|
||||
uint32_t const_offset)
|
||||
{
|
||||
exec_list instructions;
|
||||
|
|
@ -3185,7 +3186,7 @@ fs_visitor::dump_instruction(backend_instruction *be_inst)
|
|||
fs_inst *
|
||||
fs_visitor::get_instruction_generating_reg(fs_inst *start,
|
||||
fs_inst *end,
|
||||
fs_reg reg)
|
||||
const fs_reg ®)
|
||||
{
|
||||
if (end == start ||
|
||||
end->is_partial_write() ||
|
||||
|
|
|
|||
|
|
@ -332,10 +332,11 @@ public:
|
|||
int type_size(const struct glsl_type *type);
|
||||
fs_inst *get_instruction_generating_reg(fs_inst *start,
|
||||
fs_inst *end,
|
||||
fs_reg reg);
|
||||
const fs_reg ®);
|
||||
|
||||
exec_list VARYING_PULL_CONSTANT_LOAD(fs_reg dst, fs_reg surf_index,
|
||||
fs_reg varying_offset,
|
||||
exec_list VARYING_PULL_CONSTANT_LOAD(const fs_reg &dst,
|
||||
const fs_reg &surf_index,
|
||||
const fs_reg &varying_offset,
|
||||
uint32_t const_offset);
|
||||
|
||||
bool run();
|
||||
|
|
@ -415,9 +416,10 @@ public:
|
|||
fs_reg fix_math_operand(fs_reg src);
|
||||
fs_inst *emit_math(enum opcode op, fs_reg dst, fs_reg src0);
|
||||
fs_inst *emit_math(enum opcode op, fs_reg dst, fs_reg src0, fs_reg src1);
|
||||
void emit_lrp(fs_reg dst, fs_reg x, fs_reg y, fs_reg a);
|
||||
void emit_minmax(uint32_t conditionalmod, fs_reg dst,
|
||||
fs_reg src0, fs_reg src1);
|
||||
void emit_lrp(const fs_reg &dst, const fs_reg &x, const fs_reg &y,
|
||||
const fs_reg &a);
|
||||
void emit_minmax(uint32_t conditionalmod, const fs_reg &dst,
|
||||
const fs_reg &src0, const fs_reg &src1);
|
||||
bool try_emit_saturate(ir_expression *ir);
|
||||
bool try_emit_mad(ir_expression *ir, int mul_arg);
|
||||
void try_replace_with_sel();
|
||||
|
|
|
|||
|
|
@ -212,7 +212,8 @@ fs_visitor::visit(ir_dereference_array *ir)
|
|||
}
|
||||
|
||||
void
|
||||
fs_visitor::emit_lrp(fs_reg dst, fs_reg x, fs_reg y, fs_reg a)
|
||||
fs_visitor::emit_lrp(const fs_reg &dst, const fs_reg &x, const fs_reg &y,
|
||||
const fs_reg &a)
|
||||
{
|
||||
if (brw->gen < 6 ||
|
||||
!x.is_valid_3src() ||
|
||||
|
|
@ -225,8 +226,9 @@ fs_visitor::emit_lrp(fs_reg dst, fs_reg x, fs_reg y, fs_reg a)
|
|||
|
||||
emit(MUL(y_times_a, y, a));
|
||||
|
||||
a.negate = !a.negate;
|
||||
emit(ADD(one_minus_a, a, fs_reg(1.0f)));
|
||||
fs_reg negative_a = a;
|
||||
negative_a.negate = !a.negate;
|
||||
emit(ADD(one_minus_a, negative_a, fs_reg(1.0f)));
|
||||
emit(MUL(x_times_one_minus_a, x, one_minus_a));
|
||||
|
||||
emit(ADD(dst, x_times_one_minus_a, y_times_a));
|
||||
|
|
@ -239,8 +241,8 @@ fs_visitor::emit_lrp(fs_reg dst, fs_reg x, fs_reg y, fs_reg a)
|
|||
}
|
||||
|
||||
void
|
||||
fs_visitor::emit_minmax(uint32_t conditionalmod, fs_reg dst,
|
||||
fs_reg src0, fs_reg src1)
|
||||
fs_visitor::emit_minmax(uint32_t conditionalmod, const fs_reg &dst,
|
||||
const fs_reg &src0, const fs_reg &src1)
|
||||
{
|
||||
fs_inst *inst;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue