vulkan: Store width/height of GskVulkanImage

This is to enable lazy framebuffer creation later.
This commit is contained in:
Benjamin Otte 2016-12-08 20:46:02 +01:00
parent c160ef16c1
commit 17c11dd97b
2 changed files with 18 additions and 0 deletions

View File

@ -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)
{

View File

@ -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);