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

Author: Jason Ekstrand <[email protected]>
Date:   Mon Sep 14 13:44:42 2020 -0500

intel/fs: Handle required subgroup sizes specified in the SPIR-V

Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12959>

---

 src/intel/compiler/brw_fs.cpp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index 598dfbe37b3..dc3d97defe4 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -10141,12 +10141,21 @@ brw_compile_cs(const struct brw_compiler *compiler,
       max_dispatch_width = 32;
    }
 
+   unsigned required_dispatch_width = 0;
    if ((int)key->base.subgroup_size_type >= (int)BRW_SUBGROUP_SIZE_REQUIRE_8) {
       /* These enum values are expressly chosen to be equal to the subgroup
        * size that they require.
        */
-      const unsigned required_dispatch_width =
-         (unsigned)key->base.subgroup_size_type;
+      required_dispatch_width = (unsigned)key->base.subgroup_size_type;
+   }
+
+   if (nir->info.cs.subgroup_size > 0) {
+      assert(required_dispatch_width == 0 ||
+             required_dispatch_width == nir->info.cs.subgroup_size);
+      required_dispatch_width = nir->info.cs.subgroup_size;
+   }
+
+   if (required_dispatch_width > 0) {
       assert(required_dispatch_width == 8 ||
              required_dispatch_width == 16 ||
              required_dispatch_width == 32);

Reply via email to