zink: update null descriptor hashes to reflect current descriptor states

also add a bufferview hash since we use these now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
This commit is contained in:
Mike Blumenkrantz
2020-11-05 10:39:19 -05:00
parent c380a46036
commit 545625600b
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -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);
+4 -2
View File
@@ -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 *
+2 -1
View File
@@ -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;
};