mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 18:08:40 +02:00
lavapipe: fix descriptor set layout reference counting in layout merge
When taking the descriptor set layouts from the pipeline layout, make sure to take references Fixes:d4d5a7abba("lavapipe: implement EXT_graphics_pipeline_library") Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630> (cherry picked from commit20902d1ed6)
This commit is contained in:
parent
1bcf94ac87
commit
ddff1bce46
2 changed files with 8 additions and 2 deletions
|
|
@ -6214,7 +6214,7 @@
|
|||
"description": "lavapipe: fix descriptor set layout reference counting in layout merge",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "d4d5a7abba7a17fc31921a63c135561f74b87254"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -688,6 +688,10 @@ merge_layouts(struct lvp_pipeline *dst, struct lvp_pipeline_layout *src)
|
|||
/* no layout created yet: copy onto ralloc ctx allocation for auto-free */
|
||||
dst->layout = ralloc(dst->mem_ctx, struct lvp_pipeline_layout);
|
||||
memcpy(dst->layout, src, sizeof(struct lvp_pipeline_layout));
|
||||
for (unsigned i = 0; i < dst->layout->vk.set_count; i++) {
|
||||
if (dst->layout->vk.set_layouts[i])
|
||||
vk_descriptor_set_layout_ref(dst->layout->vk.set_layouts[i]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
|
|
@ -710,8 +714,10 @@ merge_layouts(struct lvp_pipeline *dst, struct lvp_pipeline_layout *src)
|
|||
}
|
||||
#endif
|
||||
for (unsigned i = 0; i < src->vk.set_count; i++) {
|
||||
if (!dst->layout->vk.set_layouts[i])
|
||||
if (!dst->layout->vk.set_layouts[i]) {
|
||||
dst->layout->vk.set_layouts[i] = src->vk.set_layouts[i];
|
||||
vk_descriptor_set_layout_ref(src->vk.set_layouts[i]);
|
||||
}
|
||||
}
|
||||
dst->layout->vk.set_count = MAX2(dst->layout->vk.set_count,
|
||||
src->vk.set_count);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue