[gtk+/wip/otte/vulkan: 50/62] vulkan: Hook up image upload mechanism to env variables
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/vulkan: 50/62] vulkan: Hook up image upload mechanism to env variables
- Date: Fri, 9 Dec 2016 17:39:09 +0000 (UTC)
commit 85bc9ff36b4a8cb0e1b2b87a0d13bc98605fd590
Author: Benjamin Otte <otte redhat com>
Date: Thu Dec 8 20:05:53 2016 +0100
vulkan: Hook up image upload mechanism to env variables
Instead of having to decie at compile-time, check if
GSK_RENDERING=staging-image was given, and if so, select the staging
image upload mode.
gsk/gskvulkanimage.c | 14 ++++----------
gsk/gskvulkanimageprivate.h | 8 --------
2 files changed, 4 insertions(+), 18 deletions(-)
---
diff --git a/gsk/gskvulkanimage.c b/gsk/gskvulkanimage.c
index edfb24a..279d7bb 100644
--- a/gsk/gskvulkanimage.c
+++ b/gsk/gskvulkanimage.c
@@ -316,16 +316,10 @@ gsk_vulkan_image_new_from_data (GdkVulkanContext *context,
gsize height,
gsize stride)
{
- switch (GSK_VULKAN_UPLOAD_IMAGE_DEFAULT)
- {
- default:
- g_assert_not_reached ();
- /* fall through */
- case GSK_VULKAN_UPLOAD_DIRECTLY:
- return gsk_vulkan_image_new_from_data_directly (context, command_buffer, data, width, height, stride);
- case GSK_VULKAN_UPLOAD_VIA_STAGING_IMAGE:
- return gsk_vulkan_image_new_from_data_via_staging_image (context, command_buffer, data, width, height,
stride);
- }
+ if (GSK_RENDER_MODE_CHECK (STAGING_IMAGE))
+ return gsk_vulkan_image_new_from_data_via_staging_image (context, command_buffer, data, width, height,
stride);
+ else
+ return gsk_vulkan_image_new_from_data_directly (context, command_buffer, data, width, height, stride);
}
void
diff --git a/gsk/gskvulkanimageprivate.h b/gsk/gskvulkanimageprivate.h
index 7c089c2..57686ea 100644
--- a/gsk/gskvulkanimageprivate.h
+++ b/gsk/gskvulkanimageprivate.h
@@ -5,14 +5,6 @@
G_BEGIN_DECLS
-/* Modify here for benchmarking */
-#define GSK_VULKAN_UPLOAD_IMAGE_DEFAULT GSK_VULKAN_UPLOAD_DIRECTLY
-
-typedef enum {
- GSK_VULKAN_UPLOAD_DIRECTLY,
- GSK_VULKAN_UPLOAD_VIA_STAGING_IMAGE
-} GstkVulkanImageUpload;
-
typedef struct _GskVulkanImage GskVulkanImage;
GskVulkanImage * gsk_vulkan_image_new_from_data (GdkVulkanContext *context,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]