vulkan/cmd_queue: Reorder memcpy in get_struct_copy
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Using the temporary variable for the memcpy makes sure they are always
used so the "(void)tmp_src123" can be removed.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36331>
This commit is contained in:
Konstantin Seurer 2025-07-24 09:06:14 +02:00 committed by Marge Bot
parent d29f446aa3
commit 656acb96b0

View file

@ -546,9 +546,9 @@ def get_struct_copy(builder, dst, src_name, src_type, size, types):
builder.add("%s = vk_zalloc(queue->alloc, %s, 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);" % (dst, size))
builder.add("if (%s == NULL) goto err;" % (dst))
builder.add("memcpy((void*)%s, %s, %s);" % (dst, src_name, size))
builder.add("%s *%s = (void *) %s; (void) %s;" % (src_type, tmp_dst_name, dst, tmp_dst_name))
builder.add("%s *%s = (void *) %s; (void) %s;" % (src_type, tmp_src_name, src_name, tmp_src_name))
builder.add("%s *%s = (void *)%s;" % (src_type, tmp_dst_name, dst))
builder.add("%s *%s = (void *)%s;" % (src_type, tmp_src_name, src_name))
builder.add("memcpy(%s, %s, %s);" % (tmp_dst_name, tmp_src_name, size))
if src_type in types:
for member in types[src_type].members: