Blender V5.0
vk_staging_buffer.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "vk_buffer.hh"
12#include "vk_common.hh"
13
14namespace blender::gpu {
15
22 public:
36
37 private:
41 const VKBuffer &device_buffer_;
42
46 VKBuffer host_buffer_;
47
48 VkDeviceSize device_buffer_offset_;
49 VkDeviceSize region_size_;
50
51 public:
52 VKStagingBuffer(const VKBuffer &device_buffer,
53 Direction direction,
54 VkDeviceSize device_buffer_offset = 0,
55 VkDeviceSize region_size = UINT64_MAX);
56
60 void copy_to_device(VKContext &context);
61
65 void copy_from_device(VKContext &context);
66
71 {
72 return host_buffer_;
73 }
74
80 void free();
81
82 VkDeviceSize size_in_bytes_get() const
83 {
84 return region_size_;
85 }
86};
87} // namespace blender::gpu
VKStagingBuffer(const VKBuffer &device_buffer, Direction direction, VkDeviceSize device_buffer_offset=0, VkDeviceSize region_size=UINT64_MAX)
VkDeviceSize size_in_bytes_get() const
void copy_from_device(VKContext &context)
void copy_to_device(VKContext &context)
#define UINT64_MAX