diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-12-20 17:01:29 -0500 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-12-24 23:46:23 +0000 |
commit | 9e5a1412edd6e46c8ef1724a3420fd7979ddea55 (patch) | |
tree | 8a4b3ca671615e29acbb1f7a89741633dbd78d29 /src/panfrost/midgard | |
parent | 1bce7fdecd86601a300be9a58a346b8c110d9587 (diff) |
pan/midgard: Generalize temp coordinate to non-2D
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard')
-rw-r--r-- | src/panfrost/midgard/midgard_compile.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 1e61cf77dd2..5e3c50f50ee 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -1753,10 +1753,12 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr, case nir_tex_src_coord: { emit_explicit_constant(ctx, index, index); + unsigned coord_mask = mask_of(instr->coord_components); + if (needs_temp_coord) { /* mov coord_temp, coords */ midgard_instruction mov = v_mov(index, coords); - mov.mask = 0x3; + mov.mask = coord_mask; emit_mir_instruction(ctx, mov); } else { coords = index; @@ -1768,11 +1770,11 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr, * components to keep everything happy */ if (midgard_texop == TEXTURE_OP_TEXEL_FETCH) { - /* mov index.zw, #0 */ + /* mov index.zw, #0, or generalized */ midgard_instruction mov = v_mov(SSA_FIXED_REGISTER(REGISTER_CONSTANT), coords); mov.has_constants = true; - mov.mask = (1 << COMPONENT_Z) | (1 << COMPONENT_W); + mov.mask = coord_mask ^ 0xF; emit_mir_instruction(ctx, mov); } |