summaryrefslogtreecommitdiffstats
path: root/src/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-15 16:53:03 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-19 08:32:17 -0700
commit2788721cc4f911850bf92ccd02f82bed9d4dd360 (patch)
tree8e2f6a0683eb06b6674791aa42e9c5605fdf2209 /src/panfrost
parentedc8e41566ed7c4e9f8931db57328cea7a7104b3 (diff)
pan/midgard: Clamp st_vary swizzle by number of components
Same issue with liveness analysis. If we store out a vec3, we should not reference the .w component. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost')
-rw-r--r--src/panfrost/midgard/midgard_compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index 2b454a92260..55406e6f458 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -1577,11 +1577,12 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
emit_explicit_constant(ctx, reg, reg);
unsigned component = nir_intrinsic_component(instr);
+ unsigned nr_comp = nir_src_num_components(instr->src[0]);
midgard_instruction st = m_st_vary_32(reg, offset);
st.load_store.arg_1 = 0x9E;
st.load_store.arg_2 = 0x1E;
- st.load_store.swizzle = SWIZZLE_XYZW << (2*component);
+ st.load_store.swizzle = swizzle_of(nr_comp) << (2*component);
emit_mir_instruction(ctx, st);
} else {
DBG("Unknown store\n");