mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 04:58:16 +02:00
drm-backend: Use explicit synchronisation for Vulkan
We can't rely on Vulkan implementations placing an implicit fence on our dmabuf, so let's do it ourselves. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
74bae8e5a7
commit
55ce229733
1 changed files with 12 additions and 3 deletions
|
|
@ -816,13 +816,15 @@ struct drm_fb *
|
|||
drm_output_render_vulkan(struct drm_output_state *state, pixman_region32_t *damage)
|
||||
{
|
||||
struct drm_output *output = state->output;
|
||||
struct drm_plane_state *pstate =
|
||||
drm_output_state_get_plane(state, output->scanout_handle->plane);
|
||||
struct weston_renderer *renderer = output->base.compositor->renderer;
|
||||
struct drm_device *device = output->device;
|
||||
struct linux_dmabuf_memory *dmabuf;
|
||||
struct drm_fb *ret;
|
||||
|
||||
output->base.compositor->renderer->repaint_output(&output->base,
|
||||
damage,
|
||||
output->renderbuffer[output->current_image]);
|
||||
renderer->repaint_output(&output->base, damage,
|
||||
output->renderbuffer[output->current_image]);
|
||||
|
||||
dmabuf = output->linux_dmabuf_memory[output->current_image];
|
||||
if (!dmabuf) {
|
||||
|
|
@ -840,6 +842,13 @@ drm_output_render_vulkan(struct drm_output_state *state, pixman_region32_t *dama
|
|||
return NULL;
|
||||
}
|
||||
|
||||
pstate->in_fence_fd = renderer->vulkan->create_fence_fd(&output->base);
|
||||
if (pstate->in_fence_fd < 1) {
|
||||
weston_log("failed to get fence fd from rendering\n");
|
||||
drm_fb_unref(ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
output->current_image = (output->current_image + 1) % ARRAY_LENGTH(output->renderbuffer);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue