From 563bdcc7fc86b4a2efe15d77163db7460951d7c0 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Thu, 27 Apr 2023 19:41:24 +0800 Subject: [PATCH] radeonsi: lower vector const to scalar at last for aco MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Signed-off-by: Qiang Yu Part-of: --- src/gallium/drivers/radeonsi/si_shader.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index c730646..122b63f 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2266,6 +2266,12 @@ struct nir_shader *si_get_nir_shader(struct si_shader *shader, if (progress || progress2 || opt_offsets) si_nir_late_opts(nir); + /* aco only accept scalar const, must be done after si_nir_late_opts() + * which may generate vec const. + */ + if (shader->use_aco) + NIR_PASS_V(nir, nir_lower_load_const_to_scalar); + /* This helps LLVM form VMEM clauses and thus get more GPU cache hits. * 200 is tuned for Viewperf. It should be done last. */ -- 2.7.4