pan/midgard: Clamp LOD register swizzle
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 20 Dec 2019 17:34:20 +0000 (12:34 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 24 Dec 2019 23:46:22 +0000 (23:46 +0000)
Fixes register allocation failures with textureLodOffset.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_compile.c

index ac712216ec25814d1385b124f3a31777c236fe03..8d457de950e9570139434b9fdfcfc64bbc6560ea 100644 (file)
@@ -1826,6 +1826,10 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
 
                         ins.texture.lod_register = true;
                         ins.src[2] = index;
+
+                        for (unsigned c = 0; c < MIR_VEC_COMPONENTS; ++c)
+                                ins.swizzle[2][c] = COMPONENT_X;
+
                         emit_explicit_constant(ctx, index, index);
 
                         break;