summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2022-05-17 11:08:37 -0400
committerMarge Bot <emma+marge@anholt.net>2022-05-25 04:01:56 +0000
commit5185c2d88ec4746c39f47b95164c1df25bb3c8f5 (patch)
tree3623d8f07407b90dc71c758f9db23f30ad96560e /src/gallium/drivers
parent8636717270f1ecd7d6a99f165f99b201c20dbf80 (diff)
zink: use XOR for descriptor hash accumulation
these values are already hashed, so there's no need to use as much cpu to fully re-hash them again Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16645>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/zink/zink_descriptors.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c
index c297295551b..917b8fdeeec 100644
--- a/src/gallium/drivers/zink/zink_descriptors.c
+++ b/src/gallium/drivers/zink/zink_descriptors.c
@@ -187,7 +187,7 @@ desc_state_hash(const void *key)
for (unsigned i = 0; i < ZINK_SHADER_COUNT; i++) {
if (d_key->exists[i]) {
if (!first)
- hash = XXH32(&d_key->state[i], sizeof(uint32_t), hash);
+ hash ^= d_key->state[i];
else
hash = d_key->state[i];
first = false;
@@ -1738,9 +1738,7 @@ update_descriptor_state(struct zink_context *ctx, enum zink_descriptor_type type
ctx->dd->descriptor_states[is_compute].state[type] = ctx->dd->gfx_descriptor_states[i].state[type];
first = false;
} else {
- ctx->dd->descriptor_states[is_compute].state[type] = XXH32(&ctx->dd->gfx_descriptor_states[i].state[type],
- sizeof(uint32_t),
- ctx->dd->descriptor_states[is_compute].state[type]);
+ ctx->dd->descriptor_states[is_compute].state[type] ^= ctx->dd->gfx_descriptor_states[i].state[type];
}
}
has_any_usage |= has_usage;
@@ -1768,7 +1766,7 @@ zink_context_update_descriptor_states(struct zink_context *ctx, struct zink_prog
if (first)
hash = ctx->dd->gfx_push_state[stage];
else
- hash = XXH32(&ctx->dd->gfx_push_state[stage], sizeof(uint32_t), hash);
+ hash ^= ctx->dd->gfx_push_state[stage];
first = false;
}
}
@@ -1807,7 +1805,7 @@ zink_context_update_descriptor_states(struct zink_context *ctx, struct zink_prog
if (first)
hash = ctx->dd->compact_gfx_descriptor_states[i].state[n];
else
- hash = XXH32(&ctx->dd->compact_gfx_descriptor_states[i].state[n], sizeof(uint32_t), hash);
+ hash ^= ctx->dd->compact_gfx_descriptor_states[i].state[n];
first = false;
} else {
ctx->dd->compact_gfx_descriptor_states[i].state[n] = 0;