diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-06-06 08:16:04 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-06-07 09:05:28 -0700 |
commit | 43568f2675bda2c538ca5e85e081756bd8bdf0c0 (patch) | |
tree | efdc0604327d2a9a6b65244bb64de5a106c2b588 /src/gallium/drivers | |
parent | 440fe0eb4302d30651f1e870e674d23de530d868 (diff) |
panfrost/midgard: Apply component to load_input
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/midgard_compile.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c index 032f4a91196..4d28e151bda 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c @@ -1125,6 +1125,9 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr) offset += nir_src_as_uint(instr->src[0]); } + /* We may need to apply a fractional offset */ + int component = instr->intrinsic == nir_intrinsic_load_input ? + nir_intrinsic_component(instr) : 0; reg = nir_dest_index(ctx, &instr->dest); if (instr->intrinsic == nir_intrinsic_load_uniform && !ctx->is_blend) { @@ -1135,6 +1138,7 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr) midgard_instruction ins = m_ld_vary_32(reg, offset); ins.load_store.mask = (1 << nr_comp) - 1; + ins.load_store.swizzle = SWIZZLE_XYZW >> (2 * component); midgard_varying_parameter p = { .is_varying = 1, |