From 3d71f973538fe152e2dd071b74e7a14f82fad82d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 6 Feb 2023 17:35:51 -0500 Subject: [PATCH] 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 Part-of: (cherry picked from commit 7c021cc5f05d24211f327ea16d686f4bd9986465) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_shader_keys.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 60f4ba9..1eec8ce 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -508,7 +508,7 @@ "description": "zink: add a define for testing that an optimal key is the default", "nominated": false, "nomination_type": null, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_shader_keys.h b/src/gallium/drivers/zink/zink_shader_keys.h index d49785b..b3abad1 100644 --- a/src/gallium/drivers/zink/zink_shader_keys.h +++ b/src/gallium/drivers/zink/zink_shader_keys.h @@ -109,6 +109,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 * zink_fs_key(const struct zink_shader_key *key) -- 2.7.4