Buffer interface. More...
#include <Buffer.h>
Public Member Functions | |
| virtual const BufferDesc &DILIGENT_CALL_TYPE | GetDesc () const override=0 |
| Returns the buffer description used to create the object. | |
| virtual void DILIGENT_CALL_TYPE | CreateView (const BufferViewDesc &ViewDesc, IBufferView **ppView)=0 |
| Creates a new buffer view. | |
| virtual IBufferView *DILIGENT_CALL_TYPE | GetDefaultView (BUFFER_VIEW_TYPE ViewType)=0 |
| Returns the pointer to the default view. | |
| virtual Uint64 DILIGENT_CALL_TYPE | GetNativeHandle ()=0 |
| Returns native buffer handle specific to the underlying graphics API. | |
| virtual void DILIGENT_CALL_TYPE | SetState (RESOURCE_STATE State)=0 |
| Sets the buffer usage state. | |
| virtual RESOURCE_STATE DILIGENT_CALL_TYPE | GetState () const =0 |
| Returns the internal buffer state. | |
| virtual MEMORY_PROPERTIES DILIGENT_CALL_TYPE | GetMemoryProperties () const =0 |
| Returns the buffer memory properties, see Diligent::MEMORY_PROPERTIES. | |
| virtual void DILIGENT_CALL_TYPE | FlushMappedRange (Uint64 StartOffset, Uint64 Size)=0 |
| virtual void DILIGENT_CALL_TYPE | InvalidateMappedRange (Uint64 StartOffset, Uint64 Size)=0 |
| virtual SparseBufferProperties DILIGENT_CALL_TYPE | GetSparseProperties () const =0 |
| Returns the sparse buffer memory properties. | |
Public Member Functions inherited from Diligent::IDeviceObject | |
| virtual Int32 DILIGENT_CALL_TYPE | GetUniqueID () const =0 |
| Returns unique identifier assigned to an object. | |
| virtual void DILIGENT_CALL_TYPE | SetUserData (IObject *pUserData)=0 |
| Stores a pointer to the user-provided data object. | |
| virtual IObject *DILIGENT_CALL_TYPE | GetUserData () const =0 |
| Returns a pointer to the user data object previously set with SetUserData() method. | |
Public Member Functions inherited from Diligent.IObject | |
| virtual void DILIGENT_CALL_TYPE | QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0 |
| Queries the specific interface. | |
| template<typename DerivedType, typename = typename std::enable_if<std::is_base_of<IObject, DerivedType>::value>::type> | |
| void | QueryInterface (const INTERFACE_ID &IID, DerivedType **ppInterface) |
| virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | AddRef ()=0 |
| Increments the number of strong references by 1. | |
| virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | Release ()=0 |
| virtual IReferenceCounters *DILIGENT_CALL_TYPE | GetReferenceCounters () const =0 |
Buffer interface.
Defines the methods to manipulate a buffer object
|
pure virtual |
Creates a new buffer view.
| [in] | ViewDesc | - View description. See Diligent::BufferViewDesc for details. |
| [out] | ppView | - Address of the memory location where the pointer to the view interface will be written to. |
|
pure virtual |
Flushes the specified range of non-coherent memory from the host cache to make it available to the GPU.
| [in] | StartOffset | - Offset, in bytes, from the beginning of the buffer to the start of the memory range to flush. |
| [in] | Size | - Size, in bytes, of the memory range to flush. |
This method should only be used for persistently-mapped buffers that do not report MEMORY_PROPERTY_HOST_COHERENT property. After an application modifies a mapped memory range on the CPU, it must flush the range to make it available to the GPU.
When a mapped buffer is unmapped it is automatically flushed by the engine if necessary.
|
pure virtual |
Returns the pointer to the default view.
| [in] | ViewType | - Type of the requested view. See Diligent::BUFFER_VIEW_TYPE. |
|
pure virtual |
Returns the buffer memory properties, see Diligent::MEMORY_PROPERTIES.
The memory properties are only relevant for persistently mapped buffers. In particular, if the memory is not coherent, an application must call IBuffer::FlushMappedRange() to make writes by the CPU available to the GPU, and call IBuffer::InvalidateMappedRange() to make writes by the GPU visible to the CPU.
|
pure virtual |
Returns native buffer handle specific to the underlying graphics API.
ID3D11Resource interface, for D3D11 implementationID3D12Resource interface, for D3D12 implementationVkBuffer handle, for Vulkan implementationMtlBuffer, for Metal implementationWGPUBuffer, for WGPU implementation
|
pure virtual |
Invalidates the specified range of non-coherent memory modified by the GPU to make it visible to the CPU.
| [in] | StartOffset | - Offset, in bytes, from the beginning of the buffer to the start of the memory range to invalidate. |
| [in] | Size | - Size, in bytes, of the memory range to invalidate. |
This method should only be used for persistently-mapped buffers that do not report MEMORY_PROPERTY_HOST_COHERENT property. After an application modifies a mapped memory range on the GPU, it must invalidate the range to make it visible to the CPU.
When a mapped buffer is unmapped, it is automatically invalidated by the engine if necessary.
|
pure virtual |
Sets the buffer usage state.