mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
radv: clone meta shaders before linking
The IR is reused in different pipeline combinations so we need to clone it to avoid link time optimistaions messing up the original copy. Fixes:06f05040eb(radv: Link shaders) Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit013313cf89)
This commit is contained in:
parent
26b44eadac
commit
4fb6b83968
1 changed files with 8 additions and 1 deletions
|
|
@ -1766,6 +1766,13 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
|
|||
stage ? stage->pName : "main", i,
|
||||
stage ? stage->pSpecializationInfo : NULL);
|
||||
pipeline->active_stages |= mesa_to_vk_shader_stage(i);
|
||||
/* We don't want to alter meta shaders IR directly so clone it
|
||||
* first.
|
||||
*/
|
||||
if (nir[i]->info.name) {
|
||||
nir[i] = nir_shader_clone(NULL, nir[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (nir[MESA_SHADER_TESS_CTRL]) {
|
||||
|
|
@ -1863,7 +1870,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
|
|||
|
||||
for (int i = 0; i < MESA_SHADER_STAGES; ++i) {
|
||||
free(codes[i]);
|
||||
if (modules[i] && !modules[i]->nir && !pipeline->device->trace_bo)
|
||||
if (modules[i] && !pipeline->device->trace_bo)
|
||||
ralloc_free(nir[i]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue