Mesa (main): zink: specify struct member name when copying inline uniforms for gfx variants

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 7 14:47:38 UTC 2022


Module: Mesa
Branch: main
Commit: a06b0e0d21aa25dac7bb8605ced4a6c4e25e9ff7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a06b0e0d21aa25dac7bb8605ced4a6c4e25e9ff7

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon Mar 21 19:45:30 2022 -0400

zink: specify struct member name when copying inline uniforms for gfx variants

avoid memory mismatch if inline uniform values aren't first member of struct

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>

---

 src/gallium/drivers/zink/zink_program.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c
index 8eea23e3f84..a72c881d97c 100644
--- a/src/gallium/drivers/zink/zink_program.c
+++ b/src/gallium/drivers/zink/zink_program.c
@@ -138,7 +138,7 @@ get_shader_module_for_stage(struct zink_context *ctx, struct zink_screen *screen
          memset(zm->key, 0, key->size);
       }
       if (inline_size)
-         memcpy(zm->key + key->size, &key->base, inline_size * sizeof(uint32_t));
+         memcpy(zm->key + key->size, key->base.inlined_uniform_values, inline_size * sizeof(uint32_t));
       if (zs->is_generated)
          zm->hash = zink_get_tcs_key(ctx)->patch_vertices;
       else



More information about the mesa-commit mailing list