Mesa (main): radeonsi: apply fbfetch/indirect_descriptor to uses_vmem_load_other earlier

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 18 11:42:28 UTC 2022


Module: Mesa
Branch: main
Commit: e5dd32a48cf778068b61fdc7ca2a928f7c3e9696
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e5dd32a48cf778068b61fdc7ca2a928f7c3e9696

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Jan 12 22:58:32 2022 -0500

radeonsi: apply fbfetch/indirect_descriptor to uses_vmem_load_other earlier

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14528>

---

 src/gallium/drivers/radeonsi/si_shader_info.c     | 4 ++++
 src/gallium/drivers/radeonsi/si_state_shaders.cpp | 7 ++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader_info.c b/src/gallium/drivers/radeonsi/si_shader_info.c
index 6099d13e13d..7e7108ae409 100644
--- a/src/gallium/drivers/radeonsi/si_shader_info.c
+++ b/src/gallium/drivers/radeonsi/si_shader_info.c
@@ -687,6 +687,8 @@ void si_nir_scan_shader(const struct nir_shader *nir, struct si_shader_info *inf
                                    BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_SAMPLE_MASK_IN) ||
                                    BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_HELPER_INVOCATION));
 
+      info->uses_vmem_load_other |= info->base.fs.uses_fbfetch_output;
+
       /* Add both front and back color inputs. */
       unsigned num_inputs_with_colors = info->num_inputs;
       for (unsigned back = 0; back < 2; back++) {
@@ -709,6 +711,8 @@ void si_nir_scan_shader(const struct nir_shader *nir, struct si_shader_info *inf
       }
    }
 
+   info->uses_vmem_load_other |= info->uses_indirect_descriptor;
+
    /* Trim output read masks based on write masks. */
    for (unsigned i = 0; i < info->num_outputs; i++)
       info->output_readmask[i] &= info->output_usagemask[i];
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.cpp b/src/gallium/drivers/radeonsi/si_state_shaders.cpp
index d45b0c766be..454467946b3 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.cpp
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.cpp
@@ -511,16 +511,13 @@ bool si_shader_mem_ordered(struct si_shader *shader)
 
    bool sampler_or_bvh = info->uses_vmem_sampler_or_bvh;
    bool other = info->uses_vmem_load_other ||
-                info->uses_indirect_descriptor ||
                 shader->config.scratch_bytes_per_wave ||
                 (info->stage == MESA_SHADER_FRAGMENT &&
-                 (info->base.fs.uses_fbfetch_output ||
-                  shader->key.ps.part.prolog.poly_stipple));
+                 shader->key.ps.part.prolog.poly_stipple);
 
    if (prev_info) {
       sampler_or_bvh |= prev_info->uses_vmem_sampler_or_bvh;
-      other |= prev_info->uses_vmem_load_other ||
-               prev_info->uses_indirect_descriptor;
+      other |= prev_info->uses_vmem_load_other;
    }
 
    /* Return true if both types of VMEM that return something are used. */



More information about the mesa-commit mailing list