class GPUResource

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

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

Methods

Return type

Description

static GPUResource*

CreateGPUResource ( const wchar_t* resourceName, void* pOwner, ResourceState initialState, void* pInitParams, bool resizable = false )
GPUResource instance creation function. Implemented per api/platform to return the correct internal resource type.

static GPUResource*

GetWrappedResourceFromSDK ( const wchar_t* name, void* pSDKResource, const TextureDesc * pDesc, ResourceState initialState )
Creates a framework resource from a FidelityFX SDK resource. This resource must be manually destroyed after use by the caller.

static GPUResource*

GetWrappedResourceFromSDK ( const wchar_t* name, void* pSDKResource, const BufferDesc * pDesc, ResourceState initialState )
Creates a framework resource from a FidelityFX SDK resource. This resource must be manually destroyed after use by the caller.

static void

ReleaseWrappedResource (GPUResource* pResource)
Releases sdk-backed resource.

bool

IsResizable () const
Returns true if the resource is resizable, false otherwise.

const wchar_t*

GetName () const
Returns the resource’s name.

bool

IsTexture () const
Returns true if the resource is a “Texture“.

bool

IsBuffer () const
Returns true if the resource is a “Buffer“.

bool

IsCopyBuffer () const
Returns true if the resource is a “CopyBuffer“.

bool

Returns true if the resource is not owned by anyone.

void

SetOwner (void* pOwner) = 0
Sets the GPUResource’s owner. This is either a Buffer, Texture, or CopyBuffer resource.

const Texture *

Returns the resource “Texture“ pointer if the resource is a texture. Returns nullptr otherwise.

const Buffer *

Returns the resource “Buffer“ pointer if the resource is a buffer. Returns nullptr otherwise.

void*

GetBreadcrumbsResource () const

const GPUResourceInternal*

GetImpl () const = 0
Gets the internal implementation for api/platform parameter accessors.

GPUResourceInternal*

GetImpl () = 0

ResourceState

GetCurrentResourceState (uint32_t subResource = 0xffffffff) const
Returns the current ResourceState the GPU resource is in.

void

SetCurrentResourceState ( ResourceState newState, uint32_t subResource = 0xffffffff )
Sets the GPU resource’s ResourceState.

Detailed description

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

Methods

CreateGPUResource

Copied!

static GPUResource* CreateGPUResource (
    const wchar_t* resourceName,
    void* pOwner,
    ResourceState  initialState,
    void* pInitParams,
    bool resizable = false
)

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


GetWrappedResourceFromSDK

Copied!

static GPUResource* GetWrappedResourceFromSDK (
    const wchar_t* name,
    void* pSDKResource,
    const TextureDesc * pDesc,
    ResourceState  initialState
)

Creates a framework resource from a FidelityFX SDK resource. This resource must be manually destroyed after use by the caller.


GetWrappedResourceFromSDK

Copied!

static GPUResource* GetWrappedResourceFromSDK (
    const wchar_t* name,
    void* pSDKResource,
    const BufferDesc * pDesc,
    ResourceState  initialState
)

Creates a framework resource from a FidelityFX SDK resource. This resource must be manually destroyed after use by the caller.


ReleaseWrappedResource

Copied!

static void ReleaseWrappedResource (GPUResource* pResource)

Releases sdk-backed resource.


IsResizable

Copied!

bool IsResizable () const

Returns true if the resource is resizable, false otherwise.


GetName

Copied!

const wchar_t* GetName () const

Returns the resource’s name.


IsTexture

Copied!

bool IsTexture () const

Returns true if the resource is a Texture.


IsBuffer

Copied!

bool IsBuffer () const

Returns true if the resource is a Buffer.


IsCopyBuffer

Copied!

bool IsCopyBuffer () const

Returns true if the resource is a CopyBuffer.


IsEmptyResource

Copied!

bool IsEmptyResource () const

Returns true if the resource is not owned by anyone.


SetOwner

Copied!

virtual void SetOwner (void* pOwner) = 0

Sets the GPUResource’s owner. This is either a Buffer, Texture, or CopyBuffer resource.


GetTextureResource

Copied!

const Texture * GetTextureResource () const

Returns the resource Texture pointer if the resource is a texture. Returns nullptr otherwise.


GetBufferResource

Copied!

const Buffer * GetBufferResource () const

Returns the resource Buffer pointer if the resource is a buffer. Returns nullptr otherwise.


GetImpl

Copied!

virtual const GPUResourceInternal* GetImpl () const = 0

Gets the internal implementation for api/platform parameter accessors.


GetCurrentResourceState

Copied!

ResourceState  GetCurrentResourceState (uint32_t subResource = 0xffffffff) const

Returns the current ResourceState the GPU resource is in.


SetCurrentResourceState

Copied!

void SetCurrentResourceState (
    ResourceState  newState,
    uint32_t subResource = 0xffffffff
)

Sets the GPU resource’s ResourceState.