pan/bi: Track compute_lod in IR
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 3 Aug 2020 16:47:57 +0000 (12:47 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 16 Sep 2020 20:05:34 +0000 (20:05 +0000)
We'll need to differentiate tex and txl.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6749>

src/panfrost/bifrost/bi_print.c
src/panfrost/bifrost/bifrost_compile.c
src/panfrost/bifrost/compiler.h

index 502ceb0..56e83be 100644 (file)
@@ -243,8 +243,9 @@ bi_cond_name(enum bi_cond cond)
 static void
 bi_print_texture(struct bi_texture *tex, FILE *fp)
 {
-        fprintf(fp, " - texture %u, sampler %u",
-                        tex->texture_index, tex->sampler_index);
+        fprintf(fp, " - texture %u, sampler %u%s",
+                        tex->texture_index, tex->sampler_index,
+                        tex->compute_lod ? ", compute lod" : "");
 }
 
 void
index 841e5b6..3f08638 100644 (file)
@@ -948,6 +948,7 @@ emit_tex_compact(bi_context *ctx, nir_tex_instr *instr)
                 .texture = {
                         .texture_index = instr->texture_index,
                         .sampler_index = instr->sampler_index,
+                        .compute_lod = instr->op == nir_texop_tex,
                 },
                 .dest = pan_dest_index(&instr->dest),
                 .dest_type = instr->dest_type,
index 24d26b2..b986a12 100644 (file)
@@ -245,6 +245,10 @@ struct bi_texture {
         /* Constant indices. Indirect would need to be in src[..] like normal,
          * we can reserve some sentinels there for that for future. */
         unsigned texture_index, sampler_index;
+
+        /* Should the LOD be computed based on neighboring pixels? Only valid
+         * in fragment shaders. */
+        bool compute_lod;
 };
 
 typedef struct {