pan/mdg: Set texture full fields at pack time
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 27 Apr 2020 23:22:06 +0000 (19:22 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Apr 2020 15:35:54 +0000 (15:35 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4793>

src/panfrost/midgard/midgard_compile.c
src/panfrost/midgard/midgard_emit.c

index 908ba4b746a2749e56c74480adc7ca58ef23e6c4..9287e1405b018e240a5bdcd5f5df92d6157190d9 100644 (file)
@@ -1762,11 +1762,6 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
                         .format = midgard_tex_format(instr->sampler_dim),
                         .texture_handle = texture_index,
                         .sampler_handle = sampler_index,
-
-                        /* TODO: half */
-                        .in_reg_full = 1,
-                        .out_full = 1,
-
                         .sampler_type = midgard_sampler_type(instr->dest_type),
                         .shadow = instr->is_shadow,
                 }
index 0c5d60efa4a90677ebb7cc0741125b7faf5b29df..02e6291a67abbb3d262c3f4c24bc4ee3a0855756 100644 (file)
@@ -474,6 +474,15 @@ emit_binary_bundle(compiler_context *ctx,
                 ins->texture.mask = ins->mask;
                 mir_pack_swizzle_tex(ins);
 
+                unsigned osz = nir_alu_type_get_type_size(ins->dest_type);
+                unsigned isz = nir_alu_type_get_type_size(ins->src_types[1]);
+
+                assert(osz == 32 || osz == 16);
+                assert(isz == 32 || isz == 16);
+
+                ins->texture.out_full = (osz == 32);
+                ins->texture.in_reg_full = (isz == 32);
+
                 ctx->texture_op_count--;
 
                 if (mir_op_computes_derivatives(ctx->stage, ins->texture.op)) {