Definition at line 276 of file mxvk_nanobind.cpp.
◆ PythonBuffer() [1/2]
| anonymous_namespace{mxvk_nanobind.cpp}::PythonBuffer::PythonBuffer |
( |
const mxvk::VulkanContext & | context, |
|
|
VkDeviceSize | size, |
|
|
VkBufferUsageFlags | usage ) |
|
inline |
Definition at line 278 of file mxvk_nanobind.cpp.
278: device(context.
device) {
mxvk::create_buffer(context,
size, usage, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, resource); }
void create_buffer(const VulkanContext &context, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, BufferResource &buffer)
Create and bind a Vulkan buffer allocation.
VkDevice device
Logical device used to create and destroy resources.
◆ ~PythonBuffer()
| anonymous_namespace{mxvk_nanobind.cpp}::PythonBuffer::~PythonBuffer |
( |
| ) |
|
|
inline |
◆ PythonBuffer() [2/2]
| anonymous_namespace{mxvk_nanobind.cpp}::PythonBuffer::PythonBuffer |
( |
const PythonBuffer & | | ) |
|
|
delete |
◆ close()
| void anonymous_namespace{mxvk_nanobind.cpp}::PythonBuffer::close |
( |
| ) |
|
|
inline |
Definition at line 293 of file mxvk_nanobind.cpp.
293 {
294 if (device != VK_NULL_HANDLE && resource.buffer != VK_NULL_HANDLE)
296 device = VK_NULL_HANDLE;
297 }
void destroy_buffer(VkDevice device, BufferResource &buffer)
Unmap and destroy a BufferResource.
◆ operator=()
◆ size()
| size_t anonymous_namespace{mxvk_nanobind.cpp}::PythonBuffer::size |
( |
| ) |
const |
|
inlinenodiscard |
◆ valid()
| bool anonymous_namespace{mxvk_nanobind.cpp}::PythonBuffer::valid |
( |
| ) |
const |
|
inlinenodiscard |
◆ write()
| void anonymous_namespace{mxvk_nanobind.cpp}::PythonBuffer::write |
( |
nanobind::ndarray< uint8_t, nanobind::c_contig, nanobind::device::cpu > | bytes | ) |
|
|
inline |
Definition at line 285 of file mxvk_nanobind.cpp.
285 {
286 if (bytes.nbytes() > resource.size)
287 throw nanobind::value_error("buffer upload is larger than the allocated buffer");
289 std::memcpy(resource.mapped, bytes.data(), bytes.nbytes());
291 }
void unmap_buffer(VkDevice device, BufferResource &buffer)
Unmap a BufferResource if it is currently mapped.
void map_buffer(VkDevice device, BufferResource &buffer)
Persistently map a host-visible buffer allocation.
The documentation for this class was generated from the following file: