From 4015b3651acec7279feaddfb9a6ea3fcb42ce907 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 14 Jan 2021 20:00:12 +0000 Subject: [PATCH] aco: only require texture coordinates to be in WQM if NSA is used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From comment in emit_mimg(): We don't need the bias, sample index, compare value or offset to be computed in WQM but if the p_create_vector copies the coordinates, then it needs to be in WQM. fossil-db (GFX10.3): Totals from 1778 (1.28% of 139391) affected shaders: SGPRs: 105080 -> 105072 (-0.01%); split: -0.02%, +0.01% VGPRs: 96800 -> 96776 (-0.02%); split: -0.07%, +0.05% CodeSize: 10001120 -> 10001384 (+0.00%); split: -0.04%, +0.04% MaxWaves: 18164 -> 18163 (-0.01%) Instrs: 1883750 -> 1883598 (-0.01%); split: -0.06%, +0.05% Cycles: 34800176 -> 34767840 (-0.09%); split: -0.10%, +0.01% We don't have a p_create_vector if we use NSA. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 08ad9572bdb..d4c24b8f958 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -9491,7 +9491,7 @@ void visit_tex(isel_context *ctx, nir_tex_instr *instr) instr->sampler_dim != GLSL_SAMPLER_DIM_SUBPASS_MS; Operand vdata = instr->is_sparse ? emit_tfe_init(bld, tmp_dst) : Operand(v1); - unsigned num_wqm_coords = implicit_derivs ? args.size() : 0; + unsigned num_wqm_coords = implicit_derivs ? coords.size() : 0; MIMG_instruction *tex = emit_mimg(bld, opcode, Definition(tmp_dst), resource, Operand(sampler), args, num_wqm_coords, vdata); tex->dim = dim;