zink: specify struct member name when copying inline uniforms for gfx variants
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 21 Mar 2022 23:45:30 +0000 (19:45 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 7 Apr 2022 14:36:25 +0000 (14:36 +0000)
avoid memory mismatch if inline uniform values aren't first member of struct

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

src/gallium/drivers/zink/zink_program.c

index 8eea23e3f84709a0e00dc88bc406dbb25358b433..a72c881d97c177c6946efacf4f499f0f9e3b8689 100644 (file)
@@ -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