Mesa (master): intel/fs: Allow compute dispatch without a pushed subgroup ID on Gen12-HP

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 21:27:40 UTC 2021


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

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Tue Jun 16 23:06:25 2020 -0500

intel/fs: Allow compute dispatch without a pushed subgroup ID on Gen12-HP

Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

---

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

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index 3420028cb60..5a7679ee5e1 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -2195,11 +2195,15 @@ fs_visitor::compact_virtual_grfs()
 }
 
 static int
-get_subgroup_id_param_index(const brw_stage_prog_data *prog_data)
+get_subgroup_id_param_index(const gen_device_info *devinfo,
+                            const brw_stage_prog_data *prog_data)
 {
    if (prog_data->nr_params == 0)
       return -1;
 
+   if (devinfo->gen > 12 || gen_device_info_is_12hp(devinfo))
+      return -1;
+
    /* The local thread id is always the last parameter in the list */
    uint32_t last_param = prog_data->param[prog_data->nr_params - 1];
    if (last_param == BRW_PARAM_BUILTIN_SUBGROUP_ID)
@@ -2371,7 +2375,8 @@ fs_visitor::assign_constant_locations()
          }
       }
 
-      int subgroup_id_index = get_subgroup_id_param_index(stage_prog_data);
+      int subgroup_id_index = get_subgroup_id_param_index(devinfo,
+                                                          stage_prog_data);
 
       /* Only allow 16 registers (128 uniform components) as push constants.
        *
@@ -9213,7 +9218,7 @@ cs_fill_push_const_info(const struct gen_device_info *devinfo,
                         struct brw_cs_prog_data *cs_prog_data)
 {
    const struct brw_stage_prog_data *prog_data = &cs_prog_data->base;
-   int subgroup_id_index = get_subgroup_id_param_index(prog_data);
+   int subgroup_id_index = get_subgroup_id_param_index(devinfo, prog_data);
    bool cross_thread_supported = devinfo->gen > 7 || devinfo->is_haswell;
 
    /* The thread ID should be stored in the last param dword */



More information about the mesa-commit mailing list