Commit 85bc9ff3 authored by Benjamin Otte's avatar Benjamin Otte

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.
parent b2e30fb6
......@@ -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
......
......@@ -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,
......
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