Mesa (staging/22.1): ac/nir/ngg: fix nogs culling scratch size

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 27 23:25:25 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: a9c354cd141ab52d6b08dda701797eeb7640ed3c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a9c354cd141ab52d6b08dda701797eeb7640ed3c

Author: Qiang Yu <yuq825 at gmail.com>
Date:   Thu Jul  7 19:40:48 2022 +0800

ac/nir/ngg: fix nogs culling scratch size

Should be in bytes not dwords.

Fixes: e97f0463a8f ("ac/nir: Implement NGG deferred attribute culling in NIR.")
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Signed-off-by: Qiang Yu <yuq825 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17593>
(cherry picked from commit 0b7ef846b3ddfe6e7964d95332cba79e69c8163a)

---

 .pick_status.json                 | 2 +-
 src/amd/common/ac_nir_lower_ngg.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 48afd61331e..f1c06373618 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -4882,7 +4882,7 @@
         "description": "ac/nir/ngg: fix nogs culling scratch size",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "e97f0463a8f55d5d407178f74b0cdb916a42aef8"
     },
diff --git a/src/amd/common/ac_nir_lower_ngg.c b/src/amd/common/ac_nir_lower_ngg.c
index 96a14cc1bb9..4430c626309 100644
--- a/src/amd/common/ac_nir_lower_ngg.c
+++ b/src/amd/common/ac_nir_lower_ngg.c
@@ -1064,7 +1064,7 @@ add_deferred_attribute_culling(nir_builder *b, nir_cf_list *original_extracted_c
    unsigned total_es_lds_bytes = pervertex_lds_bytes * nogs_state->max_es_num_vertices;
    unsigned max_num_waves = nogs_state->max_num_waves;
    unsigned ngg_scratch_lds_base_addr = ALIGN(total_es_lds_bytes, 8u);
-   unsigned ngg_scratch_lds_bytes = DIV_ROUND_UP(max_num_waves, 4u);
+   unsigned ngg_scratch_lds_bytes = ALIGN(max_num_waves, 4u);
    nogs_state->total_lds_bytes = ngg_scratch_lds_base_addr + ngg_scratch_lds_bytes;
 
    nir_function_impl *impl = nir_shader_get_entrypoint(b->shader);



More information about the mesa-commit mailing list