Class VulkanBuffer#

Inheritance Relationships#

Base Type#

Class Documentation#

class VulkanBuffer : public TRAP::Graphics::Buffer#

Public Functions

explicit VulkanBuffer(const RendererAPI::BufferDesc &desc)#

Constructor.

Parameters:

descBuffer description.

~VulkanBuffer() override#

Destructor.

consteval VulkanBuffer(const VulkanBuffer&) noexcept = delete#

Copy constructor.

consteval VulkanBuffer &operator=(const VulkanBuffer&) noexcept = delete#

Copy assignment operator.

VulkanBuffer(VulkanBuffer&&) noexcept = default#

Move constructor.

VulkanBuffer &operator=(VulkanBuffer&&) noexcept = default#

Move assignment operator.

constexpr VkBuffer GetVkBuffer() const noexcept#

Retrieve the VkBuffer handle.

Returns:

VkBuffer handle.

constexpr VkBufferView GetStorageTexelView() const noexcept#

Retrieve the storage texel view.

Returns:

VkBufferView for storage texel.

constexpr VkBufferView GetUniformTexelView() const noexcept#

Retrieve the uniform texel view.

Returns:

VkBufferView for uniform texel.

constexpr u64 GetOffset() const noexcept#

Retrieve the (aligned) byte offset to the first element in the buffer.

Returns:

Byte offset to the first element in the buffer.

virtual bool MapBuffer(const RendererAPI::ReadRange &range = {}) override#

Map a region of the buffer to the CPU.

Note

MapBuffer must not be called if memory usage is GPU only.

Parameters:

rangeOptional range of the buffer to map. Default: Whole buffer.

Returns:

Returns true if the buffer was successfully mapped, false otherwise.

virtual void UnMapBuffer() override#

Unmap CPU mapped memory region.

Note

UnMapBuffer must not be called if memory usage is GPU only.