mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-24 19:18:11 +02:00
radeonsi/sqtt: hash only the relevant part of the shader key
Fixes "use of uninitialized memory" warning from valgrind. Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41474>
This commit is contained in:
parent
03f82aaf46
commit
0dc8f95316
1 changed files with 8 additions and 1 deletions
|
|
@ -48,7 +48,14 @@
|
|||
static inline uint32_t hash_shader_for_sqtt(XXH64_state_t* xh, struct si_shader *shader)
|
||||
{
|
||||
/* Hash the key. */
|
||||
XXH64_update(xh, &shader->key, sizeof(shader->key));
|
||||
if (shader->selector->stage == MESA_SHADER_FRAGMENT) {
|
||||
XXH64_update(xh, &shader->key.ps, sizeof(shader->key.ps));
|
||||
} else {
|
||||
const unsigned key_size =
|
||||
sizeof(shader->key.ge) - sizeof(shader->key.ge.opt.inlined_uniform_values) +
|
||||
shader->key.ge.opt.inline_uniforms * sizeof(shader->key.ge.opt.inlined_uniform_values[0]);
|
||||
XXH64_update(xh, &shader->key.ge, key_size);
|
||||
}
|
||||
/* Hash the main part binary. */
|
||||
XXH64_update(xh, shader->binary.code_buffer, shader->binary.code_size);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue