[gtk+/wip/matthiasc/renderpasses: 7/10] Add an api to create intermediate textures
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/renderpasses: 7/10] Add an api to create intermediate textures
- Date: Wed, 27 Sep 2017 03:42:54 +0000 (UTC)
commit d297201e5c25e0d2236a5ba40f773ce789abb425
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Sep 26 19:12:20 2017 -0400
Add an api to create intermediate textures
gsk/gskvulkanimage.c | 21 +++++++++++++++++++++
gsk/gskvulkanimageprivate.h | 3 +++
2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/gsk/gskvulkanimage.c b/gsk/gskvulkanimage.c
index 1eb9c3a..5a286e1 100644
--- a/gsk/gskvulkanimage.c
+++ b/gsk/gskvulkanimage.c
@@ -604,6 +604,27 @@ gsk_vulkan_image_new_for_atlas (GdkVulkanContext *context,
return self;
}
+GskVulkanImage *
+gsk_vulkan_image_new_for_texture (GdkVulkanContext *context,
+ gsize width,
+ gsize height)
+{
+ GskVulkanImage *self;
+
+ self = gsk_vulkan_image_new (context,
+ width,
+ height,
+ VK_IMAGE_TILING_OPTIMAL,
+ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT,
+ VK_IMAGE_LAYOUT_UNDEFINED,
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
+ VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
+
+ gsk_vulkan_image_ensure_view (self, VK_FORMAT_B8G8R8A8_UNORM);
+
+ return self;
+}
+
GskTexture *
gsk_vulkan_image_download (GskVulkanImage *self,
GskVulkanUploader *uploader)
diff --git a/gsk/gskvulkanimageprivate.h b/gsk/gskvulkanimageprivate.h
index 8676062..f6223e9 100644
--- a/gsk/gskvulkanimageprivate.h
+++ b/gsk/gskvulkanimageprivate.h
@@ -51,6 +51,9 @@ GskVulkanImage * gsk_vulkan_image_new_for_framebuffer (GdkVulk
GskVulkanImage * gsk_vulkan_image_new_for_atlas (GdkVulkanContext *context,
gsize width,
gsize height);
+GskVulkanImage * gsk_vulkan_image_new_for_texture (GdkVulkanContext *context,
+ gsize width,
+ gsize height);
GskTexture * gsk_vulkan_image_download (GskVulkanImage *self,
GskVulkanUploader *uploader);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]