zink: run sparse lowering after all optimization passes
some passes (e.g., opt_shrink_vector) operate on the assumption that
sparse tex ops have a certain number of components and then remove components
and unset the sparse flag if they can optimize out the sparse usage
zink's sparse ops do not have the standard number of components, which
causes such passes to make incorrect assumptions and tag them as
not being sparse, which breaks everything
fix #10540
Fixes: 0d652c0c8d
("zink: shrink vectors during optimization")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27414>
This commit is contained in:

committed by
Marge Bot

parent
6a8cd7a64f
commit
2085d60438
@@ -4021,6 +4021,7 @@ zink_shader_compile(struct zink_screen *screen, bool can_shobj, struct zink_shad
|
||||
zs->can_inline = false;
|
||||
} else if (need_optimize)
|
||||
optimize_nir(nir, zs, true);
|
||||
NIR_PASS_V(nir, lower_sparse);
|
||||
|
||||
struct zink_shader_object obj = compile_module(screen, zs, nir, can_shobj, pg);
|
||||
ralloc_free(nir);
|
||||
@@ -5471,7 +5472,6 @@ zink_shader_create(struct zink_screen *screen, struct nir_shader *nir)
|
||||
|
||||
NIR_PASS_V(nir, lower_basevertex);
|
||||
NIR_PASS_V(nir, lower_baseinstance);
|
||||
NIR_PASS_V(nir, lower_sparse);
|
||||
NIR_PASS_V(nir, split_bitfields);
|
||||
NIR_PASS_V(nir, nir_lower_frexp); /* TODO: Use the spirv instructions for this. */
|
||||
|
||||
|
Reference in New Issue
Block a user