mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-19 00:20:09 +00:00
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:
parent
926a651f12
commit
b08a17064e
@ -76,7 +76,6 @@ struct _GdkVulkanContextPrivate {
|
|||||||
GdkMemoryDepth current_depth;
|
GdkMemoryDepth current_depth;
|
||||||
|
|
||||||
VkSwapchainKHR swapchain;
|
VkSwapchainKHR swapchain;
|
||||||
VkSemaphore draw_semaphore;
|
|
||||||
|
|
||||||
guint n_images;
|
guint n_images;
|
||||||
VkImage *images;
|
VkImage *images;
|
||||||
@ -367,14 +366,6 @@ gdk_vulkan_context_dispose (GObject *gobject)
|
|||||||
|
|
||||||
device = gdk_vulkan_context_get_device (context);
|
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)
|
if (priv->swapchain != VK_NULL_HANDLE)
|
||||||
{
|
{
|
||||||
vkDestroySwapchainKHR (device,
|
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),
|
acquire_result = GDK_VK_CHECK (vkAcquireNextImageKHR, gdk_vulkan_context_get_device (context),
|
||||||
priv->swapchain,
|
priv->swapchain,
|
||||||
UINT64_MAX,
|
UINT64_MAX,
|
||||||
priv->draw_semaphore,
|
VK_NULL_HANDLE,
|
||||||
VK_NULL_HANDLE,
|
VK_NULL_HANDLE,
|
||||||
&priv->draw_index);
|
&priv->draw_index);
|
||||||
if ((acquire_result == VK_ERROR_OUT_OF_DATE_KHR) ||
|
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),
|
GDK_VK_CHECK (vkQueuePresentKHR, gdk_vulkan_context_get_queue (context),
|
||||||
&(VkPresentInfoKHR) {
|
&(VkPresentInfoKHR) {
|
||||||
.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
|
.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
|
||||||
.waitSemaphoreCount = 1,
|
.waitSemaphoreCount = 0,
|
||||||
.pWaitSemaphores = (VkSemaphore[]) {
|
.pWaitSemaphores = NULL,
|
||||||
priv->draw_semaphore
|
|
||||||
},
|
|
||||||
.swapchainCount = 1,
|
.swapchainCount = 1,
|
||||||
.pSwapchains = (VkSwapchainKHR[]) {
|
.pSwapchains = (VkSwapchainKHR[]) {
|
||||||
priv->swapchain
|
priv->swapchain
|
||||||
@ -966,13 +955,6 @@ gdk_vulkan_context_real_init (GInitable *initable,
|
|||||||
if (!gdk_vulkan_context_check_swapchain (context, error))
|
if (!gdk_vulkan_context_check_swapchain (context, error))
|
||||||
goto out_surface;
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1378,29 +1360,6 @@ gdk_vulkan_context_get_draw_index (GdkVulkanContext *context)
|
|||||||
return priv->draw_index;
|
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
|
static gboolean
|
||||||
gdk_display_create_vulkan_device (GdkDisplay *display,
|
gdk_display_create_vulkan_device (GdkDisplay *display,
|
||||||
GError **error)
|
GError **error)
|
||||||
|
@ -99,7 +99,6 @@ uint32_t gdk_vulkan_context_get_n_images (GdkVulk
|
|||||||
VkImage gdk_vulkan_context_get_image (GdkVulkanContext *context,
|
VkImage gdk_vulkan_context_get_image (GdkVulkanContext *context,
|
||||||
guint id);
|
guint id);
|
||||||
uint32_t gdk_vulkan_context_get_draw_index (GdkVulkanContext *context);
|
uint32_t gdk_vulkan_context_get_draw_index (GdkVulkanContext *context);
|
||||||
VkSemaphore gdk_vulkan_context_get_draw_semaphore (GdkVulkanContext *context);
|
|
||||||
|
|
||||||
#else /* !GDK_RENDERING_VULKAN */
|
#else /* !GDK_RENDERING_VULKAN */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user