mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
nir/clone: fix missing printf_info clone
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: mesa-stable Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
This commit is contained in:
parent
603f039708
commit
81b3dea993
1 changed files with 31 additions and 0 deletions
|
|
@ -687,6 +687,32 @@ clone_function(clone_state *state, const nir_function *fxn, nir_shader *ns)
|
|||
return nfxn;
|
||||
}
|
||||
|
||||
static u_printf_info *
|
||||
clone_printf_info(void *mem_ctx, const nir_shader *s)
|
||||
{
|
||||
u_printf_info *infos = ralloc_array(mem_ctx, u_printf_info, s->printf_info_count);
|
||||
|
||||
for (unsigned i = 0; i < s->printf_info_count; i++) {
|
||||
const u_printf_info *src_info = &s->printf_info[i];
|
||||
|
||||
infos[i].num_args = src_info->num_args;
|
||||
infos[i].arg_sizes = ralloc_size(mem_ctx,
|
||||
sizeof(infos[i].arg_sizes[0]) *
|
||||
src_info->num_args);
|
||||
memcpy(infos[i].arg_sizes, src_info->arg_sizes,
|
||||
sizeof(infos[i].arg_sizes[0]) * src_info->num_args);
|
||||
|
||||
|
||||
infos[i].string_size = src_info->string_size;
|
||||
infos[i].strings = ralloc_size(mem_ctx,
|
||||
src_info->string_size);
|
||||
memcpy(infos[i].strings, src_info->strings,
|
||||
src_info->string_size);
|
||||
}
|
||||
|
||||
return infos;
|
||||
}
|
||||
|
||||
nir_shader *
|
||||
nir_shader_clone(void *mem_ctx, const nir_shader *s)
|
||||
{
|
||||
|
|
@ -734,6 +760,11 @@ nir_shader_clone(void *mem_ctx, const nir_shader *s)
|
|||
memcpy(ns->xfb_info, s->xfb_info, size);
|
||||
}
|
||||
|
||||
if (s->printf_info_count > 0) {
|
||||
ns->printf_info = clone_printf_info(ns, s);
|
||||
ns->printf_info_count = s->printf_info_count;
|
||||
}
|
||||
|
||||
free_clone_state(&state);
|
||||
|
||||
return ns;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue