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

Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Feb  6 17:35:51 2023 -0500

zink: add a define for testing that an optimal key is the default

tcs values here are ignored since they only matter for generated tcs

Reviewed-by: Emma Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>

---

 src/gallium/drivers/zink/zink_shader_keys.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_shader_keys.h 
b/src/gallium/drivers/zink/zink_shader_keys.h
index 924467b6eda..ccc160f0d2d 100644
--- a/src/gallium/drivers/zink/zink_shader_keys.h
+++ b/src/gallium/drivers/zink/zink_shader_keys.h
@@ -150,6 +150,16 @@ union zink_shader_key_optimal {
 
 /* the default key has only last_vertex_stage set*/
 #define ZINK_SHADER_KEY_OPTIMAL_DEFAULT (1<<0)
+/* Ignore patch_vertices bits that would only be used if we had to generate 
the missing TCS */
+static inline uint32_t
+zink_shader_key_optimal_no_tcs(uint32_t key)
+{
+   union zink_shader_key_optimal k;
+   k.val = key;
+   k.tcs_bits = 0;
+   return k.val;
+}
+#define ZINK_SHADER_KEY_OPTIMAL_IS_DEFAULT(key) 
(zink_shader_key_optimal_no_tcs(key) == ZINK_SHADER_KEY_OPTIMAL_DEFAULT)
 
 static inline const struct zink_fs_key_base *
 zink_fs_key_base(const struct zink_shader_key *key)

Reply via email to