#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)
{
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);
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) {
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);