vulkan: Remove draw semaphore

That's unused (or wrongly used) leftover code from 2017.

The validation layers also don't like it.
This commit is contained in:
Benjamin Otte 2024-07-13 16:03:51 +02:00
parent 926a651f12
commit b08a17064e
2 changed files with 3 additions and 45 deletions

View File

@ -76,7 +76,6 @@ struct _GdkVulkanContextPrivate {
GdkMemoryDepth current_depth;
VkSwapchainKHR swapchain;
VkSemaphore draw_semaphore;
guint n_images;
VkImage *images;
@ -367,14 +366,6 @@ gdk_vulkan_context_dispose (GObject *gobject)
device = gdk_vulkan_context_get_device (context);
if (priv->draw_semaphore != VK_NULL_HANDLE)
{
vkDestroySemaphore (device,
priv->draw_semaphore,
NULL);
priv->draw_semaphore = VK_NULL_HANDLE;
}
if (priv->swapchain != VK_NULL_HANDLE)
{
vkDestroySwapchainKHR (device,
@ -672,7 +663,7 @@ gdk_vulkan_context_begin_frame (GdkDrawContext *draw_context,
acquire_result = GDK_VK_CHECK (vkAcquireNextImageKHR, gdk_vulkan_context_get_device (context),
priv->swapchain,
UINT64_MAX,
priv->draw_semaphore,
VK_NULL_HANDLE,
VK_NULL_HANDLE,
&priv->draw_index);
if ((acquire_result == VK_ERROR_OUT_OF_DATE_KHR) ||
@ -744,10 +735,8 @@ gdk_vulkan_context_end_frame (GdkDrawContext *draw_context,
GDK_VK_CHECK (vkQueuePresentKHR, gdk_vulkan_context_get_queue (context),
&(VkPresentInfoKHR) {
.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
.waitSemaphoreCount = 1,
.pWaitSemaphores = (VkSemaphore[]) {
priv->draw_semaphore
},
.waitSemaphoreCount = 0,
.pWaitSemaphores = NULL,
.swapchainCount = 1,
.pSwapchains = (VkSwapchainKHR[]) {
priv->swapchain
@ -966,13 +955,6 @@ gdk_vulkan_context_real_init (GInitable *initable,
if (!gdk_vulkan_context_check_swapchain (context, error))
goto out_surface;
GDK_VK_CHECK (vkCreateSemaphore, gdk_vulkan_context_get_device (context),
&(VkSemaphoreCreateInfo) {
.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,
},
NULL,
&priv->draw_semaphore);
return TRUE;
}
@ -1378,29 +1360,6 @@ gdk_vulkan_context_get_draw_index (GdkVulkanContext *context)
return priv->draw_index;
}
/**
* gdk_vulkan_context_get_draw_semaphore:
* @context: a `GdkVulkanContext`
*
* Gets the Vulkan semaphore that protects access to the image that is
* currently being drawn.
*
* This function can only be used between [method@Gdk.DrawContext.begin_frame]
* and [method@Gdk.DrawContext.end_frame] calls.
*
* Returns: (transfer none): the VkSemaphore
*/
VkSemaphore
gdk_vulkan_context_get_draw_semaphore (GdkVulkanContext *context)
{
GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_VULKAN_CONTEXT (context), VK_NULL_HANDLE);
g_return_val_if_fail (gdk_draw_context_is_in_frame (GDK_DRAW_CONTEXT (context)), VK_NULL_HANDLE);
return priv->draw_semaphore;
}
static gboolean
gdk_display_create_vulkan_device (GdkDisplay *display,
GError **error)

View File

@ -99,7 +99,6 @@ uint32_t gdk_vulkan_context_get_n_images (GdkVulk
VkImage gdk_vulkan_context_get_image (GdkVulkanContext *context,
guint id);
uint32_t gdk_vulkan_context_get_draw_index (GdkVulkanContext *context);
VkSemaphore gdk_vulkan_context_get_draw_semaphore (GdkVulkanContext *context);
#else /* !GDK_RENDERING_VULKAN */