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.


Related pages

  • Visit the FidelityFX SDK product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNA™ 2 GPUs, AMD Ryzen™ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!