summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/genX_gpu_memcpy.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-09-14 17:06:48 -0500
committerJason Ekstrand <[email protected]>2018-09-17 02:57:21 -0500
commit40149441b8e2c9b806fc0f6a387a7653d97a3b59 (patch)
tree020386207f3e3786ab9bd5e1ac120428f3e0c060 /src/intel/vulkan/genX_gpu_memcpy.c
parentb11e9b5ffe648b7cd5dd458d6bae52fbd20a4640 (diff)
anv: Add a mi_memset and use it for zeroing queries
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/vulkan/genX_gpu_memcpy.c')
-rw-r--r--src/intel/vulkan/genX_gpu_memcpy.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/intel/vulkan/genX_gpu_memcpy.c b/src/intel/vulkan/genX_gpu_memcpy.c
index bbf3d4b63ae..11ffd6fb436 100644
--- a/src/intel/vulkan/genX_gpu_memcpy.c
+++ b/src/intel/vulkan/genX_gpu_memcpy.c
@@ -109,6 +109,23 @@ genX(cmd_buffer_mi_memcpy)(struct anv_cmd_buffer *cmd_buffer,
}
void
+genX(cmd_buffer_mi_memset)(struct anv_cmd_buffer *cmd_buffer,
+ struct anv_address dst, uint32_t value,
+ uint32_t size)
+{
+ /* This memset operates in units of dwords. */
+ assert(size % 4 == 0);
+ assert(dst.offset % 4 == 0);
+
+ for (uint32_t i = 0; i < size; i += 4) {
+ anv_batch_emit(&cmd_buffer->batch, GENX(MI_STORE_DATA_IMM), sdi) {
+ sdi.Address = anv_address_add(dst, i);
+ sdi.ImmediateData = value;
+ }
+ }
+}
+
+void
genX(cmd_buffer_so_memcpy)(struct anv_cmd_buffer *cmd_buffer,
struct anv_address dst, struct anv_address src,
uint32_t size)