mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 12:28:07 +02:00
microsoft/clc: Fix const violations from ralloc_steal
Fixes: ff05da7f8d ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7697>
This commit is contained in:
parent
e33cb6a763
commit
dcd8adcc28
1 changed files with 6 additions and 5 deletions
|
|
@ -515,8 +515,8 @@ clc_context_new(const struct clc_logger *logger, const struct clc_context_option
|
|||
if (options && options->optimize)
|
||||
clc_context_optimize(s);
|
||||
|
||||
ralloc_steal(ctx, s);
|
||||
ctx->libclc_nir = s;
|
||||
ralloc_steal(ctx, ctx->libclc_nir);
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
|
@ -559,13 +559,14 @@ struct clc_context *
|
|||
struct blob_reader tmp;
|
||||
blob_reader_init(&tmp, serialized, serialized_size);
|
||||
|
||||
ctx->libclc_nir = nir_deserialize(NULL, libclc_nir_options, &tmp);
|
||||
if (!ctx->libclc_nir) {
|
||||
free(ctx);
|
||||
nir_shader *s = nir_deserialize(NULL, libclc_nir_options, &tmp);
|
||||
if (!s) {
|
||||
ralloc_free(ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ralloc_steal(ctx, ctx->libclc_nir);
|
||||
ralloc_steal(ctx, s);
|
||||
ctx->libclc_nir = s;
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue