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

Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Nov  5 10:39:19 2020 -0500

zink: update null descriptor hashes to reflect current descriptor states

also add a bufferview hash since we use these now

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>

---

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

diff --git a/src/gallium/drivers/zink/zink_context.c 
b/src/gallium/drivers/zink/zink_context.c
index a4102681707..3db132187e6 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -117,7 +117,7 @@ calc_descriptor_state_hash_sampler(struct zink_context 
*ctx, struct zink_shader
    for (unsigned k = 0; k < 
zs->bindings[ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW][i].size; k++) {
       struct zink_sampler_view *sampler_view = 
zink_sampler_view(ctx->sampler_views[shader][idx + k]);
       if (!sampler_view) {
-         hash = XXH32(&screen->null_descriptor_hashes.sampler_view, 
sizeof(uint32_t), hash);
+         hash = XXH32(&screen->null_descriptor_hashes.image_view, 
sizeof(uint32_t), hash);
          continue;
       }
       uint32_t sv_hash = get_sampler_view_hash(sampler_view);
diff --git a/src/gallium/drivers/zink/zink_screen.c 
b/src/gallium/drivers/zink/zink_screen.c
index 8e5561c6059..e4fc26e2924 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -1284,8 +1284,10 @@ zink_create_logical_device(struct zink_screen *screen)
 static void
 pre_hash_descriptor_states(struct zink_screen *screen)
 {
-   VkDescriptorImageInfo null_info = {};
-   screen->null_descriptor_hashes.sampler_view = _mesa_hash_data(&null_info, 
sizeof(VkDescriptorImageInfo));
+   VkImageViewCreateInfo null_info = {.sType = 
VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO};
+   VkBufferViewCreateInfo null_binfo = {.sType = 
VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO};
+   screen->null_descriptor_hashes.image_view = _mesa_hash_data(&null_info, 
sizeof(VkImageViewCreateInfo));
+   screen->null_descriptor_hashes.buffer_view = _mesa_hash_data(&null_binfo, 
sizeof(VkBufferViewCreateInfo));
 }
 
 static struct zink_screen *
diff --git a/src/gallium/drivers/zink/zink_screen.h 
b/src/gallium/drivers/zink/zink_screen.h
index c68be1fb0a8..d791c3545a7 100644
--- a/src/gallium/drivers/zink/zink_screen.h
+++ b/src/gallium/drivers/zink/zink_screen.h
@@ -136,7 +136,8 @@ struct zink_screen {
 
    VkFormatProperties format_props[PIPE_FORMAT_COUNT];
    struct {
-      uint32_t sampler_view;
+      uint32_t image_view;
+      uint32_t buffer_view;
    } null_descriptor_hashes;
 };
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to