intel/brw: Pull opt_zero_samples out of fs_visitor

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26887>
This commit is contained in:
Caio Oliveira
2024-01-03 14:44:40 -08:00
committed by Marge Bot
parent 838d6d5cd2
commit 4f314f89f7
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -2963,14 +2963,14 @@ load_payload_sources_read_for_size(fs_inst *lp, unsigned size_read)
* set up the zero value.
*/
bool
fs_visitor::opt_zero_samples()
brw_fs_opt_zero_samples(fs_visitor &s)
{
/* Implementation supports only SENDs, so applicable to Gfx7+ only. */
assert(devinfo->ver >= 7);
assert(s.devinfo->ver >= 7);
bool progress = false;
foreach_block_and_inst(block, fs_inst, send, cfg) {
foreach_block_and_inst(block, fs_inst, send, s.cfg) {
if (send->opcode != SHADER_OPCODE_SEND ||
send->sfid != BRW_SFID_SAMPLER)
continue;
@@ -3011,7 +3011,7 @@ fs_visitor::opt_zero_samples()
zero_size += lp->exec_size * type_sz(lp->src[i].type) * lp->dst.stride;
}
const unsigned zero_len = zero_size / (reg_unit(devinfo) * REG_SIZE);
const unsigned zero_len = zero_size / (reg_unit(s.devinfo) * REG_SIZE);
if (zero_len > 0) {
send->mlen -= zero_len;
progress = true;
@@ -3019,7 +3019,7 @@ fs_visitor::opt_zero_samples()
}
if (progress)
invalidate_analysis(DEPENDENCY_INSTRUCTION_DETAIL);
s.invalidate_analysis(DEPENDENCY_INSTRUCTION_DETAIL);
return progress;
}
@@ -5713,7 +5713,7 @@ fs_visitor::optimize()
/* Identify trailing zeros LOAD_PAYLOAD of sampler messages.
* Do this before splitting SENDs.
*/
if (OPT(opt_zero_samples) && OPT(brw_fs_opt_copy_propagation, *this))
if (OPT(brw_fs_opt_zero_samples, *this) && OPT(brw_fs_opt_copy_propagation, *this))
OPT(brw_fs_opt_algebraic, *this);
OPT(brw_fs_opt_split_sends, *this);
+1 -1
View File
@@ -293,7 +293,6 @@ public:
void emit_repclear_shader();
void emit_interpolation_setup_gfx4();
void emit_interpolation_setup_gfx6();
bool opt_zero_samples();
void set_tcs_invocation_id();
@@ -624,5 +623,6 @@ bool brw_fs_opt_remove_redundant_halts(fs_visitor &s);
bool brw_fs_opt_saturate_propagation(fs_visitor &s);
bool brw_fs_opt_split_sends(fs_visitor &s);
bool brw_fs_opt_split_virtual_grfs(fs_visitor &s);
bool brw_fs_opt_zero_samples(fs_visitor &s);
#endif /* BRW_FS_H */