Mesa (master): aco: only require texture coordinates to be in WQM if NSA is used

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 20 17:00:54 UTC 2021


Module: Mesa
Branch: master
Commit: 4015b3651acec7279feaddfb9a6ea3fcb42ce907
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4015b3651acec7279feaddfb9a6ea3fcb42ce907

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Thu Jan 14 20:00:12 2021 +0000

aco: only require texture coordinates to be in WQM if NSA is used

>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 <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8523>

---

 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;



More information about the mesa-commit mailing list