brw/nir_lower_fs_barycentrics: avoid nir_def_rewrite_uses_after
replace is preferred when appropriate & should be faster. after is when you use the result in your lowering itself. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37753>
This commit is contained in:
@@ -47,13 +47,10 @@ lower_flat_inputs(nir_builder *b, nir_intrinsic_instr *intrin, void *data)
|
||||
|
||||
nir_def *msaa_flags = nir_load_fs_msaa_intel(b);
|
||||
|
||||
nir_def *input_vertex = nir_bcsel(b,
|
||||
nir_test_mask(b, msaa_flags,
|
||||
INTEL_MSAA_FLAG_PROVOKING_VERTEX_LAST),
|
||||
last_vtx,
|
||||
first_vtx);
|
||||
nir_def_rewrite_uses_after(&intrin->def, input_vertex);
|
||||
nir_def *last = nir_test_mask(b, msaa_flags, INTEL_MSAA_FLAG_PROVOKING_VERTEX_LAST);
|
||||
nir_def *input_vertex = nir_bcsel(b, last, last_vtx, first_vtx);
|
||||
|
||||
nir_def_replace(&intrin->def, input_vertex);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user