zink: use descriptor info for ubo hashing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12824>
This commit is contained in:
Mike Blumenkrantz 2021-09-08 15:19:56 -04:00 committed by Marge Bot
parent 41c3363e07
commit 718e9dd133
1 changed files with 2 additions and 2 deletions

View File

@ -1504,11 +1504,11 @@ calc_descriptor_state_hash_ubo(struct zink_context *ctx, enum pipe_shader_type s
struct zink_resource *res = ctx->di.descriptor_res[ZINK_DESCRIPTOR_TYPE_UBO][shader][idx];
struct zink_resource_object *obj = res ? res->obj : NULL;
hash = XXH32(&obj, sizeof(void*), hash);
void *hash_data = &ctx->ubos[shader][idx].buffer_size;
void *hash_data = &ctx->di.ubos[shader][idx].range;
size_t data_size = sizeof(unsigned);
hash = XXH32(hash_data, data_size, hash);
if (need_offset)
hash = XXH32(&ctx->ubos[shader][idx].buffer_offset, sizeof(unsigned), hash);
hash = XXH32(&ctx->di.ubos[shader][idx].offset, sizeof(unsigned), hash);
return hash;
}