Mesa (main): radv: Don't compile NGG culling into shaders that write viewport index.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 16 13:20:03 UTC 2021


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

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Thu Jul 15 17:12:50 2021 +0200

radv: Don't compile NGG culling into shaders that write viewport index.

We don't support NGG culling with multiple viewports yet.

Fixes: f30e4351de2f562955435a04cf75dd641639d31c
Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11910>

---

 src/amd/vulkan/radv_shader.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 2fdfa3f38ac..41b06eb5c9e 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -915,6 +915,10 @@ radv_consider_culling(struct radv_device *device, struct nir_shader *nir,
    if (!!nir->info.name)
       return false;
 
+   /* We don't support culling with multiple viewports yet. */
+   if (nir->info.outputs_written & (VARYING_BIT_VIEWPORT | VARYING_BIT_VIEWPORT_MASK))
+      return false;
+
    /* TODO: enable by default on GFX10.3 when we're confident about performance. */
    bool culling_enabled = device->instance->perftest_flags & RADV_PERFTEST_NGGC;
 



More information about the mesa-commit mailing list