Commit 17c11dd9 authored by Benjamin Otte's avatar Benjamin Otte

vulkan: Store width/height of GskVulkanImage

This is to enable lazy framebuffer creation later.
parent c160ef16
......@@ -12,6 +12,8 @@ struct _GskVulkanImage
GdkVulkanContext *vulkan;
gsize width;
gsize height;
VkImage vk_image;
VkImageView vk_image_view;
......@@ -34,6 +36,8 @@ gsk_vulkan_image_new (GdkVulkanContext *context,
self = g_object_new (GSK_TYPE_VULKAN_IMAGE, NULL);
self->vulkan = g_object_ref (context);
self->width = width;
self->height = height;
GSK_VK_CHECK (vkCreateImage, gdk_vulkan_context_get_device (context),
&(VkImageCreateInfo) {
......@@ -360,6 +364,18 @@ gsk_vulkan_image_init (GskVulkanImage *self)
{
}
gsize
gsk_vulkan_image_get_width (GskVulkanImage *self)
{
return self->width;
}
gsize
gsk_vulkan_image_get_height (GskVulkanImage *self)
{
return self->height;
}
VkImage
gsk_vulkan_image_get_image (GskVulkanImage *self)
{
......
......@@ -16,6 +16,8 @@ GskVulkanImage * gsk_vulkan_image_new_from_data (GdkVulk
gsize height,
gsize stride);
gsize gsk_vulkan_image_get_width (GskVulkanImage *self);
gsize gsk_vulkan_image_get_height (GskVulkanImage *self);
VkImage gsk_vulkan_image_get_image (GskVulkanImage *self);
VkImageView gsk_vulkan_image_get_image_view (GskVulkanImage *self);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment