UraniumCompute 0.1.0
A GPU accelerated parallel task scheduler
UN::IBuffer Class Referenceabstract

An interface for backend-specific buffers that store the data on the device. More...

#include <IBuffer.h>

Inheritance diagram for UN::IBuffer:
UN::IDeviceObject UN::IObject UN::Object< IBuffer > UN::DeviceObjectBase< IBuffer > UN::BufferBase UN::VulkanBuffer

Public Types

using DescriptorType = BufferDesc
 

Public Member Functions

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...
 
- Public Member Functions inherited from UN::IDeviceObject
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...
 
- Public Member Functions inherited from UN::IObject
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...
 

Detailed Description

An interface for backend-specific buffers that store the data on the device.

Member Function Documentation

◆ BindMemory() [1/2]

virtual ResultCode UN::IBuffer::BindMemory ( const DeviceMemorySlice deviceMemory)
pure virtual

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).

Implemented in UN::VulkanBuffer.

◆ BindMemory() [2/2]

virtual ResultCode UN::IBuffer::BindMemory ( IDeviceMemory pDeviceMemory)
pure virtual

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).

Implemented in UN::VulkanBuffer.

◆ Init()

virtual ResultCode UN::IBuffer::Init ( const BufferDesc desc)
pure virtual

Creates and initializes a backend-specific buffer object.

Parameters
desc- Buffer descriptor.
Returns
ResultCode::Success or an error code.

Implemented in UN::BufferBase.


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