#include <device_buffer_vk.h>
Definition at line 17 of file device_buffer_vk.h.
◆ DeviceBufferVK()
Definition at line 14 of file device_buffer_vk.cc.
19 context_(std::move(context)),
21 BufferResource{
22 std::move(buffer),
23 info
24 }) {}
static ContextVK & Cast(Context &base)
std::shared_ptr< ResourceManagerVK > GetResourceManager() const
DeviceBuffer(DeviceBufferDescriptor desc)
◆ ~DeviceBufferVK()
impeller::DeviceBufferVK::~DeviceBufferVK |
( |
| ) |
|
|
overridedefault |
◆ Flush()
void impeller::DeviceBufferVK::Flush |
( |
std::optional< Range > |
range | ) |
const |
|
overrideprivatevirtual |
Make any pending writes visible to the GPU.
This method must be called if the device pointer provided by [OnGetContents] is written to without using [CopyHostBuffer]. On Devices with coherent host memory, this method will not perform extra work.
If the range is not provided, the entire buffer is flushed.
Reimplemented from impeller::DeviceBuffer.
Definition at line 67 of file device_buffer_vk.cc.
67 {
69 ::vmaFlushAllocation(resource_->buffer.get().allocator,
70 resource_->buffer.get().allocation, flush_range.offset,
71 flush_range.length);
72}
const DeviceBufferDescriptor & GetDeviceBufferDescriptor() const
◆ GetBuffer()
vk::Buffer impeller::DeviceBufferVK::GetBuffer |
( |
| ) |
const |
◆ Invalidate()
void impeller::DeviceBufferVK::Invalidate |
( |
std::optional< Range > |
range | ) |
const |
|
overrideprivatevirtual |
Reimplemented from impeller::DeviceBuffer.
Definition at line 74 of file device_buffer_vk.cc.
74 {
76 ::vmaInvalidateAllocation(resource_->buffer.get().allocator,
77 resource_->buffer.get().allocation,
78 flush_range.offset, flush_range.length);
79}
◆ OnCopyHostBuffer()
bool impeller::DeviceBufferVK::OnCopyHostBuffer |
( |
const uint8_t * |
source, |
|
|
Range |
source_range, |
|
|
size_t |
offset |
|
) |
| |
|
overrideprivatevirtual |
Implements impeller::DeviceBuffer.
Definition at line 32 of file device_buffer_vk.cc.
34 {
36
37 if (!dest) {
38 return false;
39 }
40
42 ::memmove(dest +
offset,
source + source_range.offset, source_range.length);
43 }
44 ::vmaFlushAllocation(resource_->buffer.get().allocator,
45 resource_->buffer.get().allocation,
offset,
46 source_range.length);
47
48 return true;
49}
uint8_t * OnGetContents() const override
◆ OnGetContents()
uint8_t * impeller::DeviceBufferVK::OnGetContents |
( |
| ) |
const |
|
overrideprivatevirtual |
◆ SetLabel() [1/2]
bool impeller::DeviceBufferVK::SetLabel |
( |
const std::string & |
label | ) |
|
|
overrideprivatevirtual |
Implements impeller::DeviceBuffer.
Definition at line 51 of file device_buffer_vk.cc.
51 {
52 auto context = context_.lock();
53 if (!context || !resource_->buffer.is_valid()) {
54
55 return false;
56 }
57
58 ::vmaSetAllocationName(resource_->buffer.get().allocator,
59 resource_->buffer.get().allocation,
60 label.c_str()
61 );
62
64 label);
65}
bool SetDebugName(T handle, std::string_view label) const
◆ SetLabel() [2/2]
bool impeller::DeviceBufferVK::SetLabel |
( |
const std::string & |
label, |
|
|
Range |
range |
|
) |
| |
|
overrideprivatevirtual |
◆ AllocatorVK
The documentation for this class was generated from the following files: