intel/fs: take a builder arg for resolve_source_modifiers()

There will be situations where we will want to use a local builder
rather than the one associated with NIR->backend translation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16970>
This commit is contained in:
Lionel Landwerlin
2021-07-05 16:01:41 +03:00
committed by Marge Bot
parent 649cdc617f
commit 9dba8d8aa1
3 changed files with 6 additions and 6 deletions

View File

@@ -1500,7 +1500,7 @@ fs_visitor::emit_shading_rate_setup()
} }
fs_reg fs_reg
fs_visitor::resolve_source_modifiers(const fs_reg &src) fs_visitor::resolve_source_modifiers(const fs_builder &bld, const fs_reg &src)
{ {
if (!src.abs && !src.negate) if (!src.abs && !src.negate)
return src; return src;

View File

@@ -303,7 +303,7 @@ public:
fs_reg emit_mcs_fetch(const fs_reg &coordinate, unsigned components, fs_reg emit_mcs_fetch(const fs_reg &coordinate, unsigned components,
const fs_reg &texture, const fs_reg &texture,
const fs_reg &texture_handle); const fs_reg &texture_handle);
fs_reg resolve_source_modifiers(const fs_reg &src); fs_reg resolve_source_modifiers(const brw::fs_builder &bld, const fs_reg &src);
void emit_fsign(const class brw::fs_builder &, const nir_alu_instr *instr, void emit_fsign(const class brw::fs_builder &, const nir_alu_instr *instr,
fs_reg result, fs_reg *op, unsigned fsign_src); fs_reg result, fs_reg *op, unsigned fsign_src);
void emit_shader_float_controls_execution_mode(); void emit_shader_float_controls_execution_mode();

View File

@@ -757,7 +757,7 @@ fs_visitor::resolve_inot_sources(const fs_builder &bld, nir_alu_instr *instr,
assert(!op[i].negate); assert(!op[i].negate);
op[i].negate = true; op[i].negate = true;
} else { } else {
op[i] = resolve_source_modifiers(op[i]); op[i] = resolve_source_modifiers(bld, op[i]);
} }
} }
} }
@@ -1273,8 +1273,8 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr,
fs_reg tmp = bld.vgrf(result.type); fs_reg tmp = bld.vgrf(result.type);
if (devinfo->ver >= 8) { if (devinfo->ver >= 8) {
op[0] = resolve_source_modifiers(op[0]); op[0] = resolve_source_modifiers(bld, op[0]);
op[1] = resolve_source_modifiers(op[1]); op[1] = resolve_source_modifiers(bld, op[1]);
} }
/* AVG(x, y) - ((x ^ y) & 1) */ /* AVG(x, y) - ((x ^ y) & 1) */
@@ -1522,7 +1522,7 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr,
unreachable("impossible opcode"); unreachable("impossible opcode");
} }
} }
op[0] = resolve_source_modifiers(op[0]); op[0] = resolve_source_modifiers(bld, op[0]);
} }
bld.NOT(result, op[0]); bld.NOT(result, op[0]);
break; break;