diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-06-24 10:35:03 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-06-25 13:39:17 -0700 |
commit | 6729912a4bba88e6d0af8560bc9de692d044c906 (patch) | |
tree | 5fcf9a16edda08917f9aa84586ba9091641c7772 | |
parent | 17adcfc0085fda75ea7b837cb7830d04a5a3764d (diff) |
panfrost/midgard: Fixup NIR texture op
In a vertex shader, a tex op should map to txl, as there *must* be a LOD
given to the hardware (implicitly or explicitly).
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/midgard_compile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c index 9256f06a9fe..336edac2171 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c @@ -1625,6 +1625,14 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr, static void emit_tex(compiler_context *ctx, nir_tex_instr *instr) { + /* Fixup op, since only textureLod is permitted in VS but NIR can give + * generic tex in some cases (which confuses the hardware) */ + + bool is_vertex = ctx->stage == MESA_SHADER_VERTEX; + + if (is_vertex && instr->op == nir_texop_tex) + instr->op = nir_texop_txl; + switch (instr->op) { case nir_texop_tex: case nir_texop_txb: |