Mesa (main): radv: remove useless coordinate computation in the compute clear path

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 11 10:29:57 UTC 2021


Module: Mesa
Branch: main
Commit: b3af3b18635dfedd27ac782a39898a97fc01e61f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b3af3b18635dfedd27ac782a39898a97fc01e61f

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Aug 26 09:27:14 2021 +0200

radv: remove useless coordinate computation in the compute clear path

Global Z is always 0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12561>

---

 src/amd/vulkan/radv_meta_bufimage.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_meta_bufimage.c b/src/amd/vulkan/radv_meta_bufimage.c
index 502d1e9b9a5..5ca6cce8c60 100644
--- a/src/amd/vulkan/radv_meta_bufimage.c
+++ b/src/amd/vulkan/radv_meta_bufimage.c
@@ -962,12 +962,10 @@ build_nir_cleari_compute_shader(struct radv_device *dev, bool is_3d, int samples
    nir_ssa_def *clear_val = nir_load_push_constant(&b, 4, 32, nir_imm_int(&b, 0), .range = 20);
    nir_ssa_def *layer = nir_load_push_constant(&b, 1, 32, nir_imm_int(&b, 16), .range = 20);
 
-   nir_ssa_def *global_z = nir_iadd(&b, nir_channel(&b, global_id, 2), layer);
-
    nir_ssa_def *comps[4];
    comps[0] = nir_channel(&b, global_id, 0);
    comps[1] = nir_channel(&b, global_id, 1);
-   comps[2] = global_z;
+   comps[2] = layer;
    comps[3] = nir_imm_int(&b, 0);
    global_id = nir_vec(&b, comps, 4);
 



More information about the mesa-commit mailing list