From 08af4c788d3e9b4eb4fcb7477dce0ca7930f974a Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 27 Apr 2020 19:22:06 -0400 Subject: [PATCH] pan/mdg: Set texture full fields at pack time Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/midgard/midgard_compile.c | 5 ----- src/panfrost/midgard/midgard_emit.c | 9 +++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 908ba4b746a..9287e1405b0 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -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, } diff --git a/src/panfrost/midgard/midgard_emit.c b/src/panfrost/midgard/midgard_emit.c index 0c5d60efa4a..02e6291a67a 100644 --- a/src/panfrost/midgard/midgard_emit.c +++ b/src/panfrost/midgard/midgard_emit.c @@ -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)) { -- 2.30.2