r600: Fix lower-to-scalar on TTN path
authorGert Wollny <gert.wollny@collabora.com>
Mon, 21 Nov 2022 08:39:35 +0000 (09:39 +0100)
committerMarge Bot <emma+marge@anholt.net>
Mon, 21 Nov 2022 10:53:44 +0000 (10:53 +0000)
We must limit what alu ops are scalazized, and since we now
run finalize_nir we also have to make sure not to try to
scalarize backend specific instructions that are introduced
there.

While we touch the code, also remove the vectorization, it is
no longer helping.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7747

Fixes: a81c50a2 (r600/sfn: implement finalize_nir)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19892>

src/gallium/drivers/r600/r600_shader.c

index 532c25e..db0b16f 100644 (file)
@@ -209,9 +209,8 @@ int r600_pipe_shader_create(struct pipe_context *ctx,
                         /* Lower int64 ops because we have some r600 build-in shaders that use it */
                        if (nir_options->lower_int64_options) {
                                NIR_PASS_V(sel->nir, nir_lower_regs_to_ssa);
-                               NIR_PASS_V(sel->nir, nir_lower_alu_to_scalar, NULL, NULL);
+                               NIR_PASS_V(sel->nir, nir_lower_alu_to_scalar, r600_lower_to_scalar_instr_filter, NULL);
                                NIR_PASS_V(sel->nir, nir_lower_int64);
-                               NIR_PASS_V(sel->nir, nir_opt_vectorize, NULL, NULL);
                        }
                        NIR_PASS_V(sel->nir, nir_lower_flrp, ~0, false);
                }