Skip to content

SPDRenderModule

class SPDRenderModule : public cauldron::RenderModule

SPDRenderModule handles a number of tasks related to SPD.

SPDRenderModule takes care of: creating UI section that enable users to switch between options of SPD performs downsampling of all faces of a cubemap texture using FidelityFX SPD effect component

Dependencies: FfxSpdContext, FfxSpdContextDescription

Inherits from: public cauldron::RenderModule

Public Interface

Constructor:

SPDRenderModule

inline SPDRenderModule()

Constructor with default behavior.

Attributes: inline

Source: samples/spd/spdrendermodule.h (line 76, column 5)

Destructor:

~SPDRenderModule

virtual ~SPDRenderModule()

Tear down the FFX API Context and release resources.

Attributes: virtual

Source: samples/spd/spdrendermodule.h (line 81, column 13)

Public Functions:

Init

virtual void Init(const json &initData) override

Initialize FFX API Context, load the downsampling resource, and setup UI section for SPD.

Parameters:

NameTypeDefault
initDataconst json &

Attributes: virtual

Source: samples/spd/spdrendermodule.h (line 86, column 10)

Execute

virtual void Execute(double deltaTime, cauldron::CommandList *pCmdList) override

Setup downsample texture and parameters FFX API needs this frame and then call the FFX Dispatch.

Parameters:

NameTypeDefault
deltaTimedouble
pCmdListcauldron::CommandList *

Attributes: virtual

Source: samples/spd/spdrendermodule.h (line 91, column 10)

OnResize

virtual void OnResize(const cauldron::ResolutionInfo &resInfo) override

Called by the framework when resolution changes.

Parameters:

NameTypeDefault
resInfoconst cauldron::ResolutionInfo &

Attributes: virtual

Source: samples/spd/spdrendermodule.h (line 96, column 10)

Private Interface

Private Functions:

TextureLoadComplete

void TextureLoadComplete(const std::vector<const cauldron::Texture *> &textureList, void *)

Callback for texture loading so we can complete parameter binding and mark the module “ready”.

Parameters:

NameTypeDefault
textureListconst std::vector<const cauldron::Texture *> &
void *

Source: samples/spd/spdrendermodule.h (line 103, column 10)

InitFfxContext

void InitFfxContext()

Source: samples/spd/spdrendermodule.h (line 105, column 10)

DestroyFfxContext

void DestroyFfxContext()

Source: samples/spd/spdrendermodule.h (line 106, column 10)

ExecutePSDownsample

void ExecutePSDownsample(double deltaTime, cauldron::CommandList *pCmdList)

Performs traditional raster-based hierarchical downsampling via consecutive pixel shader invocations.

Parameters:

NameTypeDefault
deltaTimedouble
pCmdListcauldron::CommandList *

Source: samples/spd/spdrendermodule.h (line 111, column 10)

ExecuteCSDownsample

void ExecuteCSDownsample(double deltaTime, cauldron::CommandList *pCmdList)

Performs traditional compute-based hierarchical downsampling via consecutive compute shader invocations.

Parameters:

NameTypeDefault
deltaTimedouble
pCmdListcauldron::CommandList *

Source: samples/spd/spdrendermodule.h (line 116, column 10)

ExecuteSPDDownsample

void ExecuteSPDDownsample(double deltaTime, cauldron::CommandList *pCmdList)

Performs FidelityFX SPD-based downsampling via a single dispatch call.

Parameters:

NameTypeDefault
deltaTimedouble
pCmdListcauldron::CommandList *

Source: samples/spd/spdrendermodule.h (line 121, column 10)

ExecuteVerificationQuads

void ExecuteVerificationQuads(double deltaTime, cauldron::CommandList *pCmdList)

Renders the mip-map quads to the scene for verification.

Parameters:

NameTypeDefault
deltaTimedouble
pCmdListcauldron::CommandList *

Source: samples/spd/spdrendermodule.h (line 126, column 10)

UpdateSPDContext

void UpdateSPDContext(bool enabled)

Destroys and/or recreates FidelityFX SPD context when feature changes are made at the UI level.

Parameters:

NameTypeDefault
enabledbool

Source: samples/spd/spdrendermodule.h (line 131, column 10)

InitTraditionalDSPipeline

void InitTraditionalDSPipeline(bool computeDownsample)

Constructs all GPU resources (signatures, pipelines, parameter bindings) needed for comparison downsampling.

Parameters:

NameTypeDefault
computeDownsamplebool

Source: samples/spd/spdrendermodule.h (line 136, column 10)

InitVerificationPipeline

void InitVerificationPipeline()

Constructs all GPU resources (signatures, pipelines, parameter bindings) needed to output SPD verification mips.

Source: samples/spd/spdrendermodule.h (line 141, column 10)

Private Members:

PipelineSet m_PipelineSets

PipelineSet m_PipelineSets

Attributes: private

Source: samples/spd/spdrendermodule.h (line 150, column 17)

PipelineSet m_VerificationSet

PipelineSet m_VerificationSet = = &#123;&#125;

Attributes: private

Source: samples/spd/spdrendermodule.h (line 151, column 17)

int32_t m_DownsamplerUsed

int32_t m_DownsamplerUsed = = 2

Attributes: private

Source: samples/spd/spdrendermodule.h (line 153, column 17)

int32_t m_SPDLoadLinear

int32_t m_SPDLoadLinear = = 0

Attributes: private

Source: samples/spd/spdrendermodule.h (line 154, column 17)

int32_t m_SPDWaveInterop

int32_t m_SPDWaveInterop = = 0

Attributes: private

Source: samples/spd/spdrendermodule.h (line 155, column 17)

int32_t m_SPDMath

int32_t m_SPDMath = = 0

Attributes: private

Source: samples/spd/spdrendermodule.h (line 156, column 17)

uint32_t m_ViewSlice

uint32_t m_ViewSlice = = 0

Attributes: private

Source: samples/spd/spdrendermodule.h (line 157, column 17)

std::vector<const cauldron::RasterView *> m_RasterViews

std::vector<const cauldron::RasterView *> m_RasterViews = = &#123;&#125;

Attributes: private

Source: samples/spd/spdrendermodule.h (line 160, column 19)

const cauldron::Texture * m_pCubeTexture

const cauldron::Texture * m_pCubeTexture = = nullptr

Attributes: private

Source: samples/spd/spdrendermodule.h (line 163, column 36)

cauldron::SamplerDesc m_LinearSamplerDesc

cauldron::SamplerDesc m_LinearSamplerDesc

Attributes: private

Source: samples/spd/spdrendermodule.h (line 164, column 37)

const cauldron::Texture * m_pColorTarget

const cauldron::Texture * m_pColorTarget = = nullptr

Attributes: private

Source: samples/spd/spdrendermodule.h (line 165, column 36)

const cauldron::RasterView * m_pColorRasterView

const cauldron::RasterView * m_pColorRasterView = = nullptr

Attributes: private

Source: samples/spd/spdrendermodule.h (line 166, column 36)

FfxSpdContextDescription m_InitializationParameters

FfxSpdContextDescription m_InitializationParameters = = &#123;&#125;

Attributes: private

Source: samples/spd/spdrendermodule.h (line 169, column 30)

FfxSpdContext m_Context

FfxSpdContext m_Context

Attributes: private

Source: samples/spd/spdrendermodule.h (line 170, column 30)

bool m_ContextCreated

bool m_ContextCreated = = false

Attributes: private

Source: samples/spd/spdrendermodule.h (line 171, column 30)

Source: samples/spd/spdrendermodule.h (line 70, column 1)