Mesa (main): zink: fix subgroup vote detection

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 31 15:01:11 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri May 27 16:40:10 2022 -0400

zink: fix subgroup vote detection

this is uses the 1.1 features, not 1.3

also check the shader stages available since the GL extension requires
all of them

Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16757>

---

 src/gallium/drivers/zink/zink_device_info.py | 7 +++++++
 src/gallium/drivers/zink/zink_screen.c       | 4 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_device_info.py b/src/gallium/drivers/zink/zink_device_info.py
index db80f70baeb..dc92f35795b 100644
--- a/src/gallium/drivers/zink/zink_device_info.py
+++ b/src/gallium/drivers/zink/zink_device_info.py
@@ -302,6 +302,7 @@ struct zink_device_info {
 %endfor
 
    VkPhysicalDeviceFeatures2 feats;
+   VkPhysicalDeviceSubgroupProperties subgroup;
 %for version in versions:
    VkPhysicalDeviceVulkan${version.struct()}Features feats${version.struct()};
 %endfor
@@ -471,6 +472,12 @@ zink_get_physical_device_info(struct zink_screen *screen)
          props.pNext = &info->deviceid_props;
       }
 
+      if (screen->vk_version >= VK_MAKE_VERSION(1,1,0)) {
+         info->subgroup.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
+         info->subgroup.pNext = props.pNext;
+         props.pNext = &info->subgroup;
+      }
+
       // note: setting up local VkPhysicalDeviceProperties2.
       screen->vk.GetPhysicalDeviceProperties2(screen->pdev, &props);
    }
diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index 57e781e2d50..5a0b6ad8144 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -446,7 +446,9 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return screen->info.feats11.shaderDrawParameters || screen->info.have_KHR_shader_draw_parameters;
 
    case PIPE_CAP_SHADER_GROUP_VOTE:
-      return screen->spirv_version >= SPIRV_VERSION(1, 3);
+      return screen->info.have_vulkan11 &&
+             (screen->info.subgroup.supportedOperations & VK_SUBGROUP_FEATURE_VOTE_BIT) &&
+             (screen->info.subgroup.supportedStages & VK_SHADER_STAGE_COMPUTE_BIT);
 
    case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
       return screen->info.have_EXT_provoking_vertex;



More information about the mesa-commit mailing list