mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 15:30:14 +01: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>
This commit is contained in:
parent
abd7ea2a88
commit
20902d1ed6
1 changed files with 7 additions and 1 deletions
|
|
@ -681,6 +681,10 @@ merge_layouts(struct lvp_pipeline *dst, struct lvp_pipeline_layout *src)
|
||||||
/* no layout created yet: copy onto ralloc ctx allocation for auto-free */
|
/* no layout created yet: copy onto ralloc ctx allocation for auto-free */
|
||||||
dst->layout = ralloc(dst->mem_ctx, struct lvp_pipeline_layout);
|
dst->layout = ralloc(dst->mem_ctx, struct lvp_pipeline_layout);
|
||||||
memcpy(dst->layout, src, sizeof(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;
|
return;
|
||||||
}
|
}
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
@ -703,8 +707,10 @@ merge_layouts(struct lvp_pipeline *dst, struct lvp_pipeline_layout *src)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
for (unsigned i = 0; i < src->vk.set_count; i++) {
|
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];
|
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,
|
dst->layout->vk.set_count = MAX2(dst->layout->vk.set_count,
|
||||||
src->vk.set_count);
|
src->vk.set_count);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue