Mesa (main): zink: add a #define for vk shader bits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 20 01:10:29 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Sat Jun 18 09:43:01 2022 -0400

zink: add a #define for vk shader bits

Acked-by: Dave Airlie <airlied at redhat.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17111>

---

 src/gallium/drivers/zink/zink_context.c | 6 +-----
 src/gallium/drivers/zink/zink_context.h | 6 ++++++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 1639796f50f..1dfc52432b1 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -2891,11 +2891,7 @@ zink_resource_image_barrier_init(VkImageMemoryBarrier *imb, struct zink_resource
 static inline bool
 is_shader_pipline_stage(VkPipelineStageFlags pipeline)
 {
-   return pipeline & (VK_PIPELINE_STAGE_VERTEX_SHADER_BIT |
-                      VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT |
-                      VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT |
-                      VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT |
-                      VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
+   return pipeline & GFX_SHADER_BITS;
 }
 
 static void
diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h
index 627cd20e5d5..24e699302d3 100644
--- a/src/gallium/drivers/zink/zink_context.h
+++ b/src/gallium/drivers/zink/zink_context.h
@@ -50,6 +50,12 @@
 
 #include <vulkan/vulkan.h>
 
+#define GFX_SHADER_BITS (VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | \
+                         VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT | \
+                         VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT | \
+                         VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT | \
+                         VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT)
+
 #define pipe_buffer_write "use tc_buffer_write to avoid breaking threaded context"
 
 #ifdef __cplusplus



More information about the mesa-commit mailing list