[Mesa-dev] [PATCH 18/20] panfrost/midgard: Set magic flag for vertex textures

Alyssa Rosenzweig alyssa.rosenzweig at collabora.com
Mon Jun 24 17:39:21 UTC 2019


Let's match the blob. It's not clear what exactly this controls yet,
though.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
---
 .../drivers/panfrost/midgard/midgard_compile.c      | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
index e4c21c671fb..5d2e9ca8d3b 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
@@ -1545,6 +1545,19 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
         ins.texture.in_reg_select = in_reg;
         ins.texture.out_reg_select = out_reg;
 
+        /* Setup magic flag? */
+        bool is_vertex = ctx->stage == MESA_SHADER_VERTEX;
+        bool is_cube = instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE;
+        bool is_2d = instr->sampler_dim == GLSL_SAMPLER_DIM_2D;
+
+        if (is_vertex) {
+                if (is_cube)
+                        ins.texture.unknown4 = 0x3;
+                else if (is_2d)
+                        ins.texture.unknown4 = 0x5;
+        }
+
+
         /* Setup bias/LOD if necessary. Only register mode support right now.
          * TODO: Immediate mode for performance gains */
 
-- 
2.20.1



More information about the mesa-dev mailing list