vulkan: Pass format to offscreen creation function

That way, the offscreen can create images of different types.

Its not used in this commit, but will come in handy when we want to
support high bit depth.
This commit is contained in:
Benjamin Otte 2023-06-14 21:32:26 +02:00
parent eb3ccfb404
commit 7b4846bc25
4 changed files with 5 additions and 1 deletions

View File

@ -766,13 +766,14 @@ gsk_vulkan_image_new_for_atlas (GdkVulkanContext *context,
GskVulkanImage *
gsk_vulkan_image_new_for_offscreen (GdkVulkanContext *context,
GdkMemoryFormat preferred_format,
gsize width,
gsize height)
{
GskVulkanImage *self;
self = gsk_vulkan_image_new (context,
GDK_MEMORY_DEFAULT,
preferred_format,
width,
height,
VK_IMAGE_TILING_OPTIMAL,

View File

@ -44,6 +44,7 @@ GskVulkanImage * gsk_vulkan_image_new_for_atlas (GdkVulk
gsize width,
gsize height);
GskVulkanImage * gsk_vulkan_image_new_for_offscreen (GdkVulkanContext *context,
GdkMemoryFormat preferred_format,
gsize width,
gsize height);

View File

@ -285,6 +285,7 @@ gsk_vulkan_renderer_render_texture (GskRenderer *renderer,
ceil (viewport->size.width),
ceil (viewport->size.height));
image = gsk_vulkan_image_new_for_offscreen (self->vulkan,
GDK_MEMORY_DEFAULT,
rounded_viewport.size.width,
rounded_viewport.size.height);

View File

@ -1249,6 +1249,7 @@ gsk_vulkan_render_pass_render_offscreen (GdkVulkanContext *vulkan,
ceil (scale_y * viewport->size.height));
result = gsk_vulkan_image_new_for_offscreen (vulkan,
GDK_MEMORY_DEFAULT,
view.size.width, view.size.height);
#ifdef G_ENABLE_DEBUG