mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-18 06:47:31 -04:00
render/vulkan: keep wlr_vk_shared_buffer mapped
This commit is contained in:
parent
50b471e035
commit
79cbbfb366
3 changed files with 12 additions and 13 deletions
|
|
@ -178,6 +178,9 @@ static void shared_buffer_destroy(struct wlr_vk_renderer *r,
|
|||
}
|
||||
|
||||
wl_array_release(&buffer->allocs);
|
||||
if (buffer->map) {
|
||||
vkUnmapMemory(r->dev->dev, buffer->memory);
|
||||
}
|
||||
if (buffer->buffer) {
|
||||
vkDestroyBuffer(r->dev->dev, buffer->buffer, NULL);
|
||||
}
|
||||
|
|
@ -302,6 +305,12 @@ struct wlr_vk_buffer_span vulkan_get_stage_span(struct wlr_vk_renderer *r,
|
|||
goto error;
|
||||
}
|
||||
|
||||
res = vkMapMemory(r->dev->dev, buf->memory, 0, VK_WHOLE_SIZE, 0, &buf->map);
|
||||
if (res != VK_SUCCESS) {
|
||||
wlr_vk_error("vkMapMemory", res);
|
||||
goto error;
|
||||
}
|
||||
|
||||
struct wlr_vk_allocation *a = wl_array_add(&buf->allocs, sizeof(*a));
|
||||
if (a == NULL) {
|
||||
wlr_log_errno(WLR_ERROR, "Allocation failed");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue