Blender
V5.0
source
blender
gpu
vulkan
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
14
namespace
blender::gpu
{
15
21
class
VKStagingBuffer
{
22
public
:
26
enum class
Direction
{
30
HostToDevice
,
34
DeviceToHost
,
35
};
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
70
VKBuffer
&
host_buffer_get
()
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
blender::gpu::VKBuffer
Definition
vk_buffer.hh:23
blender::gpu::VKContext
Definition
vk_context.hh:41
blender::gpu::VKStagingBuffer::free
void free()
Definition
vk_staging_buffer.cc:64
blender::gpu::VKStagingBuffer::VKStagingBuffer
VKStagingBuffer(const VKBuffer &device_buffer, Direction direction, VkDeviceSize device_buffer_offset=0, VkDeviceSize region_size=UINT64_MAX)
Definition
vk_staging_buffer.cc:14
blender::gpu::VKStagingBuffer::Direction
Direction
Definition
vk_staging_buffer.hh:26
blender::gpu::VKStagingBuffer::Direction::DeviceToHost
@ DeviceToHost
Definition
vk_staging_buffer.hh:34
blender::gpu::VKStagingBuffer::Direction::HostToDevice
@ HostToDevice
Definition
vk_staging_buffer.hh:30
blender::gpu::VKStagingBuffer::size_in_bytes_get
VkDeviceSize size_in_bytes_get() const
Definition
vk_staging_buffer.hh:82
blender::gpu::VKStagingBuffer::copy_from_device
void copy_from_device(VKContext &context)
Definition
vk_staging_buffer.cc:52
blender::gpu::VKStagingBuffer::host_buffer_get
VKBuffer & host_buffer_get()
Definition
vk_staging_buffer.hh:70
blender::gpu::VKStagingBuffer::copy_to_device
void copy_to_device(VKContext &context)
Definition
vk_staging_buffer.cc:40
UINT64_MAX
#define UINT64_MAX
blender::gpu
Definition
blf_internal_types.hh:32
vk_buffer.hh
vk_common.hh
Generated on
for Blender by
doxygen
1.16.1