UraniumCompute 0.1.0
A GPU accelerated parallel task scheduler
UN::VulkanBuffer Class Referencefinal
Inheritance diagram for UN::VulkanBuffer:
UN::BufferBase UN::DeviceObjectBase< IBuffer > UN::Object< IBuffer > UN::IBuffer UN::IDeviceObject UN::IObject

Public Member Functions

 VulkanBuffer (IComputeDevice *pDevice)
 
ResultCode BindMemory (const DeviceMemorySlice &deviceMemory) override
 Bind device memory to the buffer. More...
 
ResultCode BindMemory (IDeviceMemory *pDeviceMemory) override
 Bind device memory to the buffer. More...
 
void Reset () override
 Reset the object to uninitialized state. More...
 
VkBuffer GetNativeBuffer () const
 
const VkMemoryRequirements & GetMemoryRequirements () const
 
- Public Member Functions inherited from UN::BufferBase
ResultCode Init (const BufferDesc &desc) override
 Creates and initializes a backend-specific buffer object. More...
 
- Public Member Functions inherited from UN::DeviceObjectBase< IBuffer >
const DescriptorTypeGetDesc () const override
 
std::string_view GetDebugName () const override
 
IComputeDeviceGetDevice () const override
 
UInt32 Release () override
 
- Public Member Functions inherited from UN::Object< IBuffer >
UInt32 Release () override
 
 Object (const Object &)=delete
 
 Object (Object &&)=delete
 
UInt32 AddRef () override
 Add a strong reference to the object. More...
 
void AttachRefCounter (ReferenceCounter *pRefCounter) override
 Attach a reference counter to the object. More...
 
ReferenceCounterGetRefCounter () override
 Get reference counter attached to this object. More...
 
virtual const DescriptorTypeGetDesc () const =0
 
virtual ResultCode Init (const BufferDesc &desc)=0
 Creates and initializes a backend-specific buffer object. More...
 
virtual ResultCode BindMemory (const DeviceMemorySlice &deviceMemory)=0
 Bind device memory to the buffer. More...
 
virtual ResultCode BindMemory (IDeviceMemory *pDeviceMemory)=0
 Bind device memory to the buffer. More...
 
virtual std::string_view GetDebugName () const =0
 Get debug name of the object.
 
virtual void Reset ()=0
 Reset the object to uninitialized state. More...
 
virtual IComputeDeviceGetDevice () const =0
 Get the compute device this object was created on. More...
 
virtual UInt32 AddRef ()=0
 Add a strong reference to object's reference counter. More...
 
virtual UInt32 Release ()=0
 Remove a strong reference from object's reference counter. More...
 
virtual void AttachRefCounter (ReferenceCounter *counter)=0
 Attach a ReferenceCounter to this object. More...
 
virtual ReferenceCounterGetRefCounter ()=0
 Get reference counter that belongs to this object. More...
 

Static Public Member Functions

static ResultCode Create (IComputeDevice *pDevice, IBuffer **ppBuffer)
 

Protected Member Functions

ResultCode InitInternal (const BufferDesc &desc) override
 
- Protected Member Functions inherited from UN::BufferBase
virtual ResultCode InitInternal (const BufferDesc &desc)=0
 
 BufferBase (IComputeDevice *pDevice)
 
- Protected Member Functions inherited from UN::DeviceObjectBase< IBuffer >
void Init (std::string_view name, const DescriptorType &desc)
 Common device object initializer. More...
 
 DeviceObjectBase (IComputeDevice *pDevice)
 
- Protected Member Functions inherited from UN::Object< IBuffer >
UInt32 Release (F &&destroyCallback)
 

Additional Inherited Members

- Public Types inherited from UN::DeviceObjectBase< IBuffer >
using DescriptorType = typename TInterface::DescriptorType
 
- Public Types inherited from UN::IBuffer
using DescriptorType = BufferDesc
 
- Protected Attributes inherited from UN::DeviceObjectBase< IBuffer >
Ptr< IComputeDevicem_pDevice
 
DescriptorType m_Desc
 
std::string m_Name
 

Member Function Documentation

◆ BindMemory() [1/2]

ResultCode UN::VulkanBuffer::BindMemory ( const DeviceMemorySlice deviceMemory)
overridevirtual

Bind device memory to the buffer.

Buffer doesn't allocate any device memory itself on creation or initialization. So the memory must be allocated separately and than bound to the buffer using this function.

Parameters
deviceMemory- The memory to bind.
Returns
ResultCode::Success or an error code (if the memory was incompatible).

Implements UN::IBuffer.

◆ BindMemory() [2/2]

ResultCode UN::VulkanBuffer::BindMemory ( IDeviceMemory pDeviceMemory)
overridevirtual

Bind device memory to the buffer.

Buffer doesn't allocate any device memory itself on creation or initialization. So the memory must be allocated separately and than bound to the buffer using this function.

Parameters
pDeviceMemory- The memory to bind.
Returns
ResultCode::Success or an error code (if the memory was incompatible).

Implements UN::IBuffer.

◆ InitInternal()

ResultCode UN::VulkanBuffer::InitInternal ( const BufferDesc desc)
overrideprotectedvirtual

Implements UN::BufferBase.

◆ Reset()

void UN::VulkanBuffer::Reset ( )
overridevirtual

Reset the object to uninitialized state.

Implements UN::IDeviceObject.


The documentation for this class was generated from the following files: