From 621e70dd4004f009108337ca0a6c2b990cc4415f Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 26 Sep 2018 11:10:58 +0200 Subject: [PATCH] radv: adjust the CmdUpdateBuffer threshold for optimal performance According to my benchmark results, it appears that we should reduce the threshold to 1024. BEFORE: 1 KB: 68.656000 ms 2 KB: 118.368000 ms AFTER: 1 KB: 31.760000 ms 2 KB: 29.840000 ms Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_meta_buffer.c | 2 +- src/amd/vulkan/radv_private.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_meta_buffer.c b/src/amd/vulkan/radv_meta_buffer.c index f1887e33183..8726d36f5fa 100644 --- a/src/amd/vulkan/radv_meta_buffer.c +++ b/src/amd/vulkan/radv_meta_buffer.c @@ -513,7 +513,7 @@ void radv_CmdUpdateBuffer( if (!dataSize) return; - if (dataSize < RADV_BUFFER_OPS_CS_THRESHOLD) { + if (dataSize < RADV_BUFFER_UPDATE_THRESHOLD) { si_emit_cache_flush(cmd_buffer); radv_cs_add_buffer(cmd_buffer->device->ws, cmd_buffer->cs, dst_buffer->bo); diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index a649835959d..15a66bdc1b1 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -108,6 +108,8 @@ typedef uint32_t xcb_window_t; */ #define RADV_BUFFER_OPS_CS_THRESHOLD 4096 +#define RADV_BUFFER_UPDATE_THRESHOLD 1024 + enum radv_mem_heap { RADV_MEM_HEAP_VRAM, RADV_MEM_HEAP_VRAM_CPU_ACCESS, -- 2.30.2