[18/20] panfrost/midgard: Set magic flag for vertex textures

Submitted by Alyssa Rosenzweig on June 24, 2019, 5:39 p.m.

Details

Message ID 20190624173923.10603-19-alyssa.rosenzweig@collabora.com
State New
Headers show
Series "panfrost: Mipmapping! (and other goodies)" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Alyssa Rosenzweig June 24, 2019, 5:39 p.m.
Let's match the blob. It's not clear what exactly this controls yet,
though.

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

Patch hide | download patch | download mbox

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 */