class Buffer

The FidelityFX Cauldron Framework api/platform-agnostic representation of a buffer gpu resource.

File location: framework/cauldron/framework/inc/render/buffer.h

Typedefs

Type

Description

typedef void

(*ResizeFunction )( BufferDesc &, uint32_t, uint32_t, uint32_t, uint32_t )
Function signature for buffer ResizeFunction (when needed).

Methods

Return type

Description

const BufferDesc &

GetDesc () const
Gets a constant view on the buffer’s “BufferDesc“ description.

const GPUResource *

GetResource () const
Gets a constant pointer to the buffer’s underlaying “GPUResource“.

GPUResource *

Gets a modifiable pointer to the buffer’s underlaying “GPUResource“.

void

CopyData (const void* pData, size_t size) = 0
Copy callback used when loading buffer data. Implemented internally per api/platform.

void

CopyData ( const void* pData, size_t size, UploadContext * pUploadCtx, ResourceState postCopyState ) = 0

BufferAddressInfo

GetAddressInfo () const = 0
Gets the buffer’s “BufferAddressInfo“ for resource binding. Implemented internally per api/platform.

void

OnRenderingResolutionResize ( uint32_t outputWidth, uint32_t outputHeight, uint32_t renderingWidth, uint32_t renderingHeight )
Callback function executed on a buffer with resizing support to handle resourc recreation when size changes are needed.

static Buffer*

CreateBufferResource ( const BufferDesc * pDesc, ResourceState initialState, ResizeFunction fn = nullptr, void* customOwner = nullptr )
Buffer instance creation function. Implemented per api/platform to return the correct internal resource type.

Detailed description

The FidelityFX Cauldron Framework api/platform-agnostic representation of a buffer gpu resource.

The FidelityFX Cauldron Framework api/platform-agnostic representation of a dynamic buffer pool.

The dynamic resource pool is the allocation construct used to back all resource creation in FidelityFX Cauldron Framework.

Typedefs

ResizeFunction

Copied!

typedef void (*ResizeFunction )(
    BufferDesc &,
    uint32_t,
    uint32_t,
    uint32_t,
    uint32_t
    )

Function signature for buffer ResizeFunction (when needed).


Methods

GetDesc

Copied!

const BufferDesc & GetDesc () const

Gets a constant view on the buffer’s BufferDesc description.


GetResource

Copied!

const GPUResource * GetResource () const

Gets a constant pointer to the buffer’s underlaying GPUResource.


GetResource

Copied!

GPUResource * GetResource ()

Gets a modifiable pointer to the buffer’s underlaying GPUResource.


CopyData

Copied!

virtual void CopyData (const void* pData, size_t size) = 0

Copy callback used when loading buffer data. Implemented internally per api/platform.


GetAddressInfo

Copied!

virtual BufferAddressInfo  GetAddressInfo () const = 0

Gets the buffer’s BufferAddressInfo for resource binding. Implemented internally per api/platform.


OnRenderingResolutionResize

Copied!

void OnRenderingResolutionResize (
    uint32_t outputWidth,
    uint32_t outputHeight,
    uint32_t renderingWidth,
    uint32_t renderingHeight
)

Callback function executed on a buffer with resizing support to handle resourc recreation when size changes are needed.


CreateBufferResource

Copied!

static Buffer* CreateBufferResource (
    const BufferDesc * pDesc,
    ResourceState  initialState,
    ResizeFunction  fn = nullptr,
    void* customOwner = nullptr
)

Buffer instance creation function. Implemented per api/platform to return the correct internal resource type.