Blender
V4.3
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
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
public
:
49
VKStagingBuffer
(
const
VKBuffer
&device_buffer, Direction direction);
50
54
void
copy_to_device
(
VKContext
&context);
55
59
void
copy_from_device
(
VKContext
&context);
60
64
const
VKBuffer
&
host_buffer_get
()
const
65
{
66
return
host_buffer_;
67
}
68
74
void
free
();
75
};
76
}
// namespace blender::gpu
blender::gpu::VKBuffer
Definition
vk_buffer.hh:23
blender::gpu::VKContext
Definition
vk_context.hh:29
blender::gpu::VKStagingBuffer
Definition
vk_staging_buffer.hh:21
blender::gpu::VKStagingBuffer::free
void free()
Definition
vk_staging_buffer.cc:52
blender::gpu::VKStagingBuffer::host_buffer_get
const VKBuffer & host_buffer_get() const
Definition
vk_staging_buffer.hh:64
blender::gpu::VKStagingBuffer::Direction
Direction
Definition
vk_staging_buffer.hh:26
blender::gpu::VKStagingBuffer::Direction::DeviceToHost
@ DeviceToHost
blender::gpu::VKStagingBuffer::Direction::HostToDevice
@ HostToDevice
blender::gpu::VKStagingBuffer::copy_from_device
void copy_from_device(VKContext &context)
Definition
vk_staging_buffer.cc:41
blender::gpu::VKStagingBuffer::VKStagingBuffer
VKStagingBuffer(const VKBuffer &device_buffer, Direction direction)
Definition
vk_staging_buffer.cc:14
blender::gpu::VKStagingBuffer::copy_to_device
void copy_to_device(VKContext &context)
Definition
vk_staging_buffer.cc:30
blender::gpu
Definition
blf_internal_types.hh:23
vk_buffer.hh
vk_common.hh
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0