From 3d121301aa03009d10a74637355996d0b7a8839c Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 8 May 2023 10:59:49 +0200 Subject: [PATCH] Vulkan: Don't Use Tiled Drawing Similare to the Metal backend, Vulkan keeps data of the full texture around as they will be executed by the same submission. So there are no benefits to splice a texture into smaller parts, but adds overhead as more commands are required to be processed. --- source/blender/editors/screen/glutil.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 3e31a64255d..c91bee21295 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -21,12 +21,12 @@ #include "IMB_colormanagement.h" #include "IMB_imbuf_types.h" +#include "GPU_context.h" #include "GPU_immediate.h" #include "GPU_matrix.h" #include "GPU_texture.h" #ifdef __APPLE__ -# include "GPU_context.h" # include "GPU_state.h" #endif @@ -147,18 +147,17 @@ void immDrawPixelsTexTiled_scaling_clipping(IMMDrawPixelsTexState *state, const float color[4]) { int subpart_x, subpart_y, tex_w = 256, tex_h = 256; -#ifdef __APPLE__ - if (GPU_backend_get_type() == GPU_BACKEND_METAL) { - /* NOTE(Metal): The Metal backend will keep all temporary texture memory within a command + if (ELEM(GPU_backend_get_type(), GPU_BACKEND_METAL, GPU_BACKEND_VULKAN)) { + /* NOTE: These backend will keep all temporary texture memory within a command * submission in-flight, so using a partial tile size does not provide any tangible memory - * reduction, but does incur additional API overhead and significant cache inefficiency on AMD - * platforms. + * reduction, but does incur additional API overhead and significant cache inefficiency on + * specific platforms. + * * The Metal API also provides smart resource paging such that the application can * still efficiently swap memory, even if system is low in physical memory. */ tex_w = img_w; tex_h = img_h; } -#endif int seamless, offset_x, offset_y, nsubparts_x, nsubparts_y; int components; const bool use_clipping = ((clip_min_x < clip_max_x) && (clip_min_y < clip_max_y)); -- 2.30.2