forked from AuroraMiddleware/gtk
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.
This commit is contained in:
parent
b2e30fb66e
commit
85bc9ff36b
@ -316,16 +316,10 @@ gsk_vulkan_image_new_from_data (GdkVulkanContext *context,
|
|||||||
gsize height,
|
gsize height,
|
||||||
gsize stride)
|
gsize stride)
|
||||||
{
|
{
|
||||||
switch (GSK_VULKAN_UPLOAD_IMAGE_DEFAULT)
|
if (GSK_RENDER_MODE_CHECK (STAGING_IMAGE))
|
||||||
{
|
|
||||||
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);
|
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
|
void
|
||||||
|
@ -5,14 +5,6 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
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;
|
typedef struct _GskVulkanImage GskVulkanImage;
|
||||||
|
|
||||||
GskVulkanImage * gsk_vulkan_image_new_from_data (GdkVulkanContext *context,
|
GskVulkanImage * gsk_vulkan_image_new_from_data (GdkVulkanContext *context,
|
||||||
|
Loading…
Reference in New Issue
Block a user