Mesa (main): nir/gather_info: flag fbfetch on subpass image loads

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 6 17:42:44 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu May  5 09:54:18 2022 -0400

nir/gather_info: flag fbfetch on subpass image loads

might not be able to determine which output is being read, but these
are definitely fbfetch uses (from lavapipe)

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16346>

---

 src/compiler/nir/nir_gather_info.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c
index 6a138e7124a..f0bdd13634d 100644
--- a/src/compiler/nir/nir_gather_info.c
+++ b/src/compiler/nir/nir_gather_info.c
@@ -525,6 +525,18 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader,
          shader->info.writes_memory = true;
       break;
    }
+   case nir_intrinsic_image_deref_load: {
+      nir_deref_instr *deref = nir_src_as_deref(instr->src[0]);
+      nir_variable *var = nir_deref_instr_get_variable(deref);
+      enum glsl_sampler_dim dim = glsl_get_sampler_dim(glsl_without_array(var->type));
+      if (dim != GLSL_SAMPLER_DIM_SUBPASS &&
+          dim != GLSL_SAMPLER_DIM_SUBPASS_MS)
+         break;
+
+      var->data.fb_fetch_output = true;
+      shader->info.fs.uses_fbfetch_output = true;
+      break;
+   }
 
    case nir_intrinsic_load_input:
    case nir_intrinsic_load_per_vertex_input:



More information about the mesa-commit mailing list