mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-28 07:58:59 -04:00
render/vulkan: take render pass in vulkan_sync_render_buffer()
We'll need to grab textures from there in the next commit.
Also rename it to better reflect what it does: synchronize release
fences after a render pass has been submitted.
(cherry picked from commit 73bbad8433)
This commit is contained in:
parent
4080e2f627
commit
004806fae2
3 changed files with 11 additions and 13 deletions
|
|
@ -433,9 +433,8 @@ void vulkan_reset_command_buffer(struct wlr_vk_command_buffer *cb);
|
|||
bool vulkan_wait_command_buffer(struct wlr_vk_command_buffer *cb,
|
||||
struct wlr_vk_renderer *renderer);
|
||||
|
||||
bool vulkan_sync_render_buffer(struct wlr_vk_renderer *renderer,
|
||||
struct wlr_vk_render_buffer *render_buffer, struct wlr_vk_command_buffer *cb,
|
||||
struct wlr_drm_syncobj_timeline *signal_timeline, uint64_t signal_point);
|
||||
bool vulkan_sync_render_pass_release(struct wlr_vk_renderer *renderer,
|
||||
struct wlr_vk_render_pass *pass);
|
||||
bool vulkan_sync_foreign_texture(struct wlr_vk_texture *texture,
|
||||
int sync_file_fds[static WLR_DMABUF_MAX_PLANES]);
|
||||
|
||||
|
|
|
|||
|
|
@ -538,8 +538,7 @@ static bool render_pass_submit(struct wlr_render_pass *wlr_pass) {
|
|||
wl_list_insert(&stage_cb->stage_buffers, &stage_buf->link);
|
||||
}
|
||||
|
||||
if (!vulkan_sync_render_buffer(renderer, render_buffer, render_cb,
|
||||
pass->signal_timeline, pass->signal_point)) {
|
||||
if (!vulkan_sync_render_pass_release(renderer, pass)) {
|
||||
wlr_log(WLR_ERROR, "Failed to sync render buffer");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1009,12 +1009,12 @@ static bool buffer_import_sync_file(struct wlr_buffer *buffer, uint32_t flags, i
|
|||
return true;
|
||||
}
|
||||
|
||||
bool vulkan_sync_render_buffer(struct wlr_vk_renderer *renderer,
|
||||
struct wlr_vk_render_buffer *render_buffer, struct wlr_vk_command_buffer *cb,
|
||||
struct wlr_drm_syncobj_timeline *signal_timeline, uint64_t signal_point) {
|
||||
bool vulkan_sync_render_pass_release(struct wlr_vk_renderer *renderer,
|
||||
struct wlr_vk_render_pass *pass) {
|
||||
VkResult res;
|
||||
struct wlr_vk_command_buffer *cb = pass->command_buffer;
|
||||
|
||||
if (!renderer->dev->implicit_sync_interop && signal_timeline == NULL) {
|
||||
if (!renderer->dev->implicit_sync_interop && pass->signal_timeline == NULL) {
|
||||
// We have no choice but to block here sadly
|
||||
return vulkan_wait_command_buffer(cb, renderer);
|
||||
}
|
||||
|
|
@ -1036,13 +1036,13 @@ bool vulkan_sync_render_buffer(struct wlr_vk_renderer *renderer,
|
|||
}
|
||||
|
||||
bool ok = false;
|
||||
if (signal_timeline != NULL) {
|
||||
if (!wlr_drm_syncobj_timeline_import_sync_file(signal_timeline,
|
||||
signal_point, sync_file_fd)) {
|
||||
if (pass->signal_timeline != NULL) {
|
||||
if (!wlr_drm_syncobj_timeline_import_sync_file(pass->signal_timeline,
|
||||
pass->signal_point, sync_file_fd)) {
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
if (!buffer_import_sync_file(render_buffer->wlr_buffer, DMA_BUF_SYNC_WRITE, sync_file_fd)) {
|
||||
if (!buffer_import_sync_file(pass->render_buffer->wlr_buffer, DMA_BUF_SYNC_WRITE, sync_file_fd)) {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue