From 72e5749a635ca864c99a149df42685eb1cb48620 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 20 Dec 2019 12:34:20 -0500 Subject: [PATCH] pan/midgard: Clamp LOD register swizzle Fixes register allocation failures with textureLodOffset. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_compile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index ac712216ec2..8d457de950e 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -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; -- 2.30.2