summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/amd/vulkan/radv_meta_buffer.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_meta_buffer.c b/src/amd/vulkan/radv_meta_buffer.c
index e009234f045..a737dbeec39 100644
--- a/src/amd/vulkan/radv_meta_buffer.c
+++ b/src/amd/vulkan/radv_meta_buffer.c
@@ -4,6 +4,12 @@
#include "sid.h"
#include "radv_cs.h"
+/*
+ * This is the point we switch from using CP to compute shader
+ * for certain buffer operations.
+ */
+#define RADV_BUFFER_OPS_CS_THRESHOLD 4096
+
static nir_shader *
build_buffer_fill_shader(struct radv_device *dev)
{
@@ -405,7 +411,7 @@ void radv_fill_buffer(struct radv_cmd_buffer *cmd_buffer,
assert(!(offset & 3));
assert(!(size & 3));
- if (size >= 4096)
+ if (size >= RADV_BUFFER_OPS_CS_THRESHOLD)
fill_buffer_shader(cmd_buffer, bo, offset, size, value);
else if (size) {
uint64_t va = radv_buffer_get_va(bo);
@@ -422,7 +428,7 @@ void radv_copy_buffer(struct radv_cmd_buffer *cmd_buffer,
uint64_t src_offset, uint64_t dst_offset,
uint64_t size)
{
- if (size >= 4096 && !(size & 3) && !(src_offset & 3) && !(dst_offset & 3))
+ if (size >= RADV_BUFFER_OPS_CS_THRESHOLD && !(size & 3) && !(src_offset & 3) && !(dst_offset & 3))
copy_buffer_shader(cmd_buffer, src_bo, dst_bo,
src_offset, dst_offset, size);
else if (size) {
@@ -496,7 +502,7 @@ void radv_CmdUpdateBuffer(
if (!dataSize)
return;
- if (dataSize < 4096) {
+ if (dataSize < RADV_BUFFER_OPS_CS_THRESHOLD) {
si_emit_cache_flush(cmd_buffer);
cmd_buffer->device->ws->cs_add_buffer(cmd_buffer->cs, dst_buffer->bo, 8);