radv: use upload_data to upload push descriptors.
authorDave Airlie <airlied@redhat.com>
Mon, 11 Sep 2017 05:02:53 +0000 (06:02 +0100)
committerDave Airlie <airlied@redhat.com>
Mon, 11 Sep 2017 22:55:15 +0000 (23:55 +0100)
This is just a reusing code.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_cmd_buffer.c

index 39383b0dbe40052309f1012c822f34d797b91e9f..4e133d1f255dfe160066fdad8c4e5537c6765039 100644 (file)
@@ -1383,18 +1383,15 @@ static void
 radv_flush_push_descriptors(struct radv_cmd_buffer *cmd_buffer)
 {
        struct radv_descriptor_set *set = &cmd_buffer->push_descriptors.set;
-       uint32_t *ptr = NULL;
        unsigned bo_offset;
 
-       if (!radv_cmd_buffer_upload_alloc(cmd_buffer, set->size, 32,
-                                         &bo_offset,
-                                         (void**) &ptr))
+       if (!radv_cmd_buffer_upload_data(cmd_buffer, set->size, 32,
+                                        set->mapped_ptr,
+                                        &bo_offset))
                return;
 
        set->va = cmd_buffer->device->ws->buffer_get_va(cmd_buffer->upload.upload_bo);
        set->va += bo_offset;
-
-       memcpy(ptr, set->mapped_ptr, set->size);
 }
 
 static void