Diligent Engine API Reference
Public Member Functions | List of all members
Diligent::IBuffer Class Referenceabstract

Buffer interface. More...

Inheritance diagram for Diligent::IBuffer:
Diligent::IDeviceObject Diligent::IObject Diligent::IBufferD3D11 Diligent::IBufferD3D12 Diligent::IBufferGL Diligent::RefCountedObject< IBufferD3D11, FixedBlockMemoryAllocator > Diligent::RefCountedObject< IBufferD3D12, FixedBlockMemoryAllocator > Diligent::RefCountedObject< IBufferGL, FixedBlockMemoryAllocator > Diligent::ObjectBase< IBufferD3D11, FixedBlockMemoryAllocator > Diligent::ObjectBase< IBufferD3D12, FixedBlockMemoryAllocator > Diligent::ObjectBase< IBufferGL, FixedBlockMemoryAllocator > Diligent::DeviceObjectBase< IBufferD3D11, BufferDesc, FixedBlockMemoryAllocator > Diligent::DeviceObjectBase< IBufferD3D12, BufferDesc, FixedBlockMemoryAllocator > Diligent::DeviceObjectBase< IBufferGL, BufferDesc, FixedBlockMemoryAllocator > Diligent::BufferBase< IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator > Diligent::BufferBase< IBufferD3D12, BufferViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator > Diligent::BufferBase< IBufferGL, BufferViewGLImpl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator > Diligent::BufferD3D11Impl Diligent::BufferD3D12Impl Diligent::BufferGLImpl

Public Member Functions

virtual void QueryInterface (const Diligent::INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface, see IObject::QueryInterface() for details.
 
virtual const BufferDescGetDesc () const =0
 Returns the buffer description used to create the object.
 
virtual void UpdateData (class IDeviceContext *pContext, Uint32 Offset, Uint32 Size, const PVoid pData)=0
 Updates the data in the buffer. More...
 
virtual void CopyData (IDeviceContext *pContext, IBuffer *pSrcBuffer, Uint32 SrcOffset, Uint32 DstOffset, Uint32 Size)=0
 Copies the data from other buffer. More...
 
virtual void Map (IDeviceContext *pContext, MAP_TYPE MapType, Uint32 MapFlags, PVoid &pMappedData)=0
 Maps the buffer. More...
 
virtual void Unmap (IDeviceContext *pContext, MAP_TYPE MapType)=0
 Unmaps the previously mapped buffer. More...
 
virtual void CreateView (const struct BufferViewDesc &ViewDesc, class IBufferView **ppView)=0
 Creates a new buffer view. More...
 
virtual IBufferViewGetDefaultView (BUFFER_VIEW_TYPE ViewType)=0
 Returns the pointer to the default view. More...
 
- Public Member Functions inherited from Diligent::IObject
virtual Atomics::Long AddRef ()=0
 Increments the number of strong references by 1. More...
 
virtual Atomics::Long Release ()=0
 Decrements the number of strong references by 1 and destroys the object when the counter reaches zero. More...
 
virtual IReferenceCountersGetReferenceCounters () const =0
 Returns the pointer to IReferenceCounters interface of the associated reference counters object. The metod does NOT increment the number of strong references to the returned object.
 

Detailed Description

Buffer interface.

Defines the methods to manipulate a buffer object

Member Function Documentation

virtual void Diligent::IBuffer::CopyData ( IDeviceContext pContext,
IBuffer pSrcBuffer,
Uint32  SrcOffset,
Uint32  DstOffset,
Uint32  Size 
)
pure virtual

Copies the data from other buffer.

Parameters
[in]pContext- Pointer to the device context interface to be used to perform the operation.
[in]pSrcBuffer- Source buffer to copy data from.
[in]SrcOffset- Offset in bytes from the beginning of the source buffer to the beginning of data to copy.
[in]DstOffset- Offset in bytes from the beginning of the destination buffer to the beginning of the destination region.
[in]Size- Size in bytes of data to copy.

Implemented in Diligent::BufferBase< IBufferD3D12, BufferViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferBase< IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferBase< IBufferGL, BufferViewGLImpl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferD3D11Impl, Diligent::BufferGLImpl, and Diligent::BufferD3D12Impl.

virtual void Diligent::IBuffer::CreateView ( const struct BufferViewDesc ViewDesc,
class IBufferView **  ppView 
)
pure virtual

Creates a new buffer view.

Parameters
[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.
Remarks
To create a view addressing the entire buffer, set only BufferViewDesc::ViewType member of the ViewDesc structure and leave all other members in their default values.
Buffer view will contain strong reference to the buffer, so the buffer will not be destroyed until all views are released.
The function calls AddRef() for the created interface, so it must be released by a call to Release() when it is no longer needed.

Implemented in Diligent::BufferBase< IBufferD3D12, BufferViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferBase< IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, and Diligent::BufferBase< IBufferGL, BufferViewGLImpl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >.

virtual IBufferView* Diligent::IBuffer::GetDefaultView ( BUFFER_VIEW_TYPE  ViewType)
pure virtual

Returns the pointer to the default view.

Parameters
[in]ViewType- Type of the requested view. See Diligent::BUFFER_VIEW_TYPE.
Returns
Pointer to the interface
Note
The function does not increase the reference counter for the returned interface, so Release() must NOT be called.

Implemented in Diligent::BufferBase< IBufferD3D12, BufferViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferBase< IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, and Diligent::BufferBase< IBufferGL, BufferViewGLImpl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >.

virtual void Diligent::IBuffer::Map ( IDeviceContext pContext,
MAP_TYPE  MapType,
Uint32  MapFlags,
PVoid &  pMappedData 
)
pure virtual

Maps the buffer.

Parameters
[in]pContext- Pointer to the device context interface to be used to perform the operation.
[in]MapType- Type of the map operation. See Diligent::MAP_TYPE.
[in]MapFlags- Special map flags. See Diligent::MAP_FLAGS.
[out]pMappedData- Reference to the void pointer to store the address of the mapped region.

Implemented in Diligent::BufferBase< IBufferD3D12, BufferViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferBase< IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferBase< IBufferGL, BufferViewGLImpl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferD3D11Impl, Diligent::BufferGLImpl, and Diligent::BufferD3D12Impl.

virtual void Diligent::IBuffer::Unmap ( IDeviceContext pContext,
MAP_TYPE  MapType 
)
pure virtual

Unmaps the previously mapped buffer.

Parameters
[in]pContext- Pointer to the device context interface to be used to perform the operation.
[in]MapType- Type of the map operation. This parameter must match to the type that was provided to the Map() method.

Implemented in Diligent::BufferBase< IBufferD3D12, BufferViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferBase< IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferBase< IBufferGL, BufferViewGLImpl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferD3D11Impl, Diligent::BufferGLImpl, and Diligent::BufferD3D12Impl.

virtual void Diligent::IBuffer::UpdateData ( class IDeviceContext pContext,
Uint32  Offset,
Uint32  Size,
const PVoid  pData 
)
pure virtual

Updates the data in the buffer.

Parameters
[in]pContext- Pointer to the device context interface to be used to perform the operation.
[in]Offset- Offset in bytes from the beginning of the buffer to the update region.
[in]Size- Size in bytes of the data region to update.
[in]pData- Pointer to the data to store in the buffer.

Implemented in Diligent::BufferBase< IBufferD3D12, BufferViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferBase< IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferBase< IBufferGL, BufferViewGLImpl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::BufferD3D11Impl, Diligent::BufferGLImpl, and Diligent::BufferD3D12Impl.