gsk: Pass the memory format for back buffer

We can now get this information from the Vulkan context,
so use it to accurately represent the back buffer.

Related: #6767
This commit is contained in:
Matthias Clasen 2024-06-09 11:30:58 -04:00
parent 42c6e0249f
commit 0ec29c4176
3 changed files with 5 additions and 2 deletions

View File

@ -433,6 +433,7 @@ GskGpuImage *
gsk_vulkan_image_new_for_swapchain (GskVulkanDevice *device,
VkImage image,
VkFormat format,
GdkMemoryFormat memory_format,
gsize width,
gsize height)
{
@ -449,8 +450,8 @@ gsk_vulkan_image_new_for_swapchain (GskVulkanDevice *device,
self->vk_image_layout = VK_IMAGE_LAYOUT_UNDEFINED;
self->vk_access = 0;
/* FIXME: The memory format and flags here are very suboptimal */
gsk_gpu_image_setup (GSK_GPU_IMAGE (self), 0, GDK_MEMORY_DEFAULT, width, height);
/* FIXME: The flags here are very suboptimal */
gsk_gpu_image_setup (GSK_GPU_IMAGE (self), 0, memory_format, width, height);
gsk_vulkan_image_create_view (self,
format,

View File

@ -14,6 +14,7 @@ G_DECLARE_FINAL_TYPE (GskVulkanImage, gsk_vulkan_image, GSK, VULKAN_IMAGE, GskGp
GskGpuImage * gsk_vulkan_image_new_for_swapchain (GskVulkanDevice *device,
VkImage image,
VkFormat format,
GdkMemoryFormat memory_format,
gsize width,
gsize height);

View File

@ -75,6 +75,7 @@ gsk_vulkan_renderer_update_images_cb (GdkVulkanContext *context,
self->targets[i] = gsk_vulkan_image_new_for_swapchain (device,
gdk_vulkan_context_get_image (context, i),
gdk_vulkan_context_get_image_format (context),
gdk_vulkan_context_get_memory_format (context),
width, height);
}
}