mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 11:50:09 +01:00
hk: clean up before lowering bounds checks
for next patch Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31532>
This commit is contained in:
parent
6287346482
commit
0376c1930b
1 changed files with 13 additions and 0 deletions
|
|
@ -616,6 +616,19 @@ hk_lower_nir(struct hk_device *dev, nir_shader *nir,
|
|||
NIR_PASS(_, nir, nir_lower_explicit_io, nir_var_mem_ubo,
|
||||
hk_buffer_addr_format(rs->uniform_buffers));
|
||||
|
||||
/* Before inserting bounds checks, we want to do a fair bit of optimization.
|
||||
* lower_load_global_constant_offset_instr has special optimizations for
|
||||
* constant offsets, so we want as many offsets to be constant as possible.
|
||||
*/
|
||||
bool progress;
|
||||
do {
|
||||
progress = false;
|
||||
NIR_PASS(progress, nir, nir_opt_constant_folding);
|
||||
NIR_PASS(progress, nir, nir_opt_algebraic);
|
||||
NIR_PASS(progress, nir, nir_copy_prop);
|
||||
NIR_PASS(progress, nir, nir_opt_dce);
|
||||
} while (progress);
|
||||
|
||||
bool soft_fault = agx_has_soft_fault(&dev->dev);
|
||||
NIR_PASS(_, nir, nir_shader_intrinsics_pass,
|
||||
lower_load_global_constant_offset_instr, nir_metadata_none,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue