vulkan: Guard dmabuf code with HAVE_DMABUF

This commit is contained in:
Benjamin Otte 2024-01-07 14:56:01 +01:00
parent 440c207146
commit 7830535c04
3 changed files with 9 additions and 0 deletions

View File

@ -1826,6 +1826,8 @@ gdk_display_unref_vulkan (GdkDisplay *display)
display->vk_instance = VK_NULL_HANDLE;
}
#ifdef HAVE_DMABUF
/* Hack. We don't include gsk/gsk.h here to avoid a build order problem
* with the generated header gskenumtypes.h, so we need to hack around
* a bit to access the gsk api we need.
@ -1915,6 +1917,8 @@ gdk_vulkan_get_dmabuf_downloader (GdkDisplay *display,
return GDK_DMABUF_DOWNLOADER (renderer);
}
#endif
VkShaderModule
gdk_display_get_vk_shader_module (GdkDisplay *self,
const char *resource_name)

View File

@ -78,8 +78,10 @@ gboolean gdk_display_init_vulkan (GdkDisp
void gdk_display_ref_vulkan (GdkDisplay *display);
void gdk_display_unref_vulkan (GdkDisplay *display);
#ifdef HAVE_DMABUF
GdkDmabufDownloader * gdk_vulkan_get_dmabuf_downloader (GdkDisplay *display,
GdkDmabufFormatsBuilder *builder);
#endif
VkShaderModule gdk_display_get_vk_shader_module (GdkDisplay *display,
const char *resource_name);

View File

@ -69,6 +69,8 @@ gsk_gpu_download_op_print (GskGpuOp *op,
}
#ifdef GDK_RENDERING_VULKAN
#ifdef HAVE_DMABUF
/* The code needs to run here because vkGetSemaphoreFdKHR() may
* only be called after the semaphore has been submitted via
* vkQueueSubmit().
@ -102,6 +104,7 @@ gsk_gpu_download_op_vk_sync_semaphore (GskGpuDownloadOp *self)
vkDestroySemaphore (display->vk_device, self->vk_semaphore, NULL);
}
#endif
static void
gsk_gpu_download_op_vk_create (GskGpuDownloadOp *self)