跳至内容

ParallelSortRenderModule

class ParallelSortRenderModule : public cauldron::RenderModule

ParallelSortRenderModule 处理与 Parallel Sort 相关的多项任务。

ParallelSortRenderModule 负责:创建 UI 部分,使用户能够切换 Parallel Sort 的选项;使用 FidelityFX ParallelSort Effect Component 对键(和可选负载)执行排序;显示排序结果验证(使用排序后的键正确地重新构建纹理图像)。

依赖项: FfxParallelSortContext, FfxParallelSortContextDescription

继承自: public cauldron::RenderModule

公共接口

构造函数

ParallelSortRenderModule

inline ParallelSortRenderModule()

带默认行为的构造函数。

属性: inline

源代码: samples/parallelsort/parallelsortrendermodule.h (第 65 行, 第 5 列)

析构函数

~ParallelSortRenderModule

virtual ~ParallelSortRenderModule()

拆解 FFX API 上下文并释放资源。

属性: virtual

源代码: samples/parallelsort/parallelsortrendermodule.h (第 70 行, 第 13 列)

公共函数

初始化

virtual void Init(const json &initData) override

初始化 FFX API Context,创建要排序的随机键/负载数据,加载所需的纹理,并为 Parallel Sort 设置 UI 部分。

参数

名称类型默认
initDataconst json &

属性: virtual

源代码: samples/parallelsort/parallelsortrendermodule.h (第 76 行, 第 10 列)

执行

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

设置本帧 FFX API 所需的输入资源和参数,然后调用 FFX Dispatch 对键(和负载)进行排序。

参数

名称类型默认
deltaTimedouble
pCmdListcauldron::CommandList *

属性: virtual

源代码: samples/parallelsort/parallelsortrendermodule.h (第 81 行, 第 10 列)

OnResize

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

当分辨率更改时,由框架调用。

参数

名称类型默认
resInfoconst cauldron::ResolutionInfo &

属性: virtual

源代码: samples/parallelsort/parallelsortrendermodule.h (第 86 行, 第 10 列)

私有接口

私有函数

InitFfxContext

void InitFfxContext()

源代码: samples/parallelsort/parallelsortrendermodule.h (第 109 行, 第 10 列)

DestroyFfxContext

void DestroyFfxContext()

源代码: samples/parallelsort/parallelsortrendermodule.h (第 111 行, 第 10 列)

TextureLoadComplete

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

纹理加载的回调,以便我们完成参数绑定并标记模块为“就绪”。

参数

名称类型默认
textureListconst std::vector<const cauldron::Texture *> &
void *

源代码: samples/parallelsort/parallelsortrendermodule.h (第 116 行, 第 10 列)

ResetParallelSortContext

void ResetParallelSortContext()

销毁并重新创建 FfxParallelSortContext 以反映 UI 请求的更改。

源代码: samples/parallelsort/parallelsortrendermodule.h (第 121 行, 第 10 列)

私有成员

const uint32_t s_NumKeys

static const uint32_t s_NumKeys

属性: static, private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 99 行, 第 27 列)

const cauldron::Buffer * m_pKeysToSort

const cauldron::Buffer * m_pKeysToSort = = nullptr

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 102 行, 第 28 列)

const cauldron::Buffer * m_pPayloadToSort

const cauldron::Buffer * m_pPayloadToSort = = nullptr

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 103 行, 第 28 列)

const cauldron::Buffer * m_pUnsortedBuffers

const cauldron::Buffer * m_pUnsortedBuffers = = &#123; nullptr &#125;

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 105 行, 第 28 列)

const cauldron::CopyResource * m_pCopyResources

const cauldron::CopyResource * m_pCopyResources = = &#123; nullptr &#125;

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 106 行, 第 34 列)

const cauldron::Texture * m_pValidationTextures

const cauldron::Texture * m_pValidationTextures = = &#123; nullptr &#125;

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 107 行, 第 29 列)

FfxParallelSortContextDescription m_InitializationParameters

FfxParallelSortContextDescription m_InitializationParameters = = &#123;&#125;

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 124 行, 第 39 列)

FfxParallelSortContext m_ParallelSortContext

FfxParallelSortContext m_ParallelSortContext

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 125 行, 第 39 列)

int32_t m_ParallelSortResolutions

int32_t m_ParallelSortResolutions = = 1

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 127 行, 第 17 列)

int32_t m_ParallelSortPresentationMode

int32_t m_ParallelSortPresentationMode = = 0

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 128 行, 第 17 列)

bool m_ParallelSortRenderSortedKeys

bool m_ParallelSortRenderSortedKeys = = false

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 129 行, 第 17 列)

bool m_ParallelSortPayload

bool m_ParallelSortPayload = = false

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 130 行, 第 17 列)

bool m_ParallelSortIndirectExecution

bool m_ParallelSortIndirectExecution = = false

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 131 行, 第 17 列)

cauldron::RootSignature * m_pRootSignature

cauldron::RootSignature * m_pRootSignature = = nullptr

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 133 行, 第 32 列)

cauldron::PipelineObject * m_pPipelineObj

cauldron::PipelineObject * m_pPipelineObj = = nullptr

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 134 行, 第 32 列)

cauldron::ParameterSet * m_pParameters

cauldron::ParameterSet * m_pParameters = = nullptr

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 135 行, 第 32 列)

const cauldron::Texture * m_pRenderTarget

const cauldron::Texture * m_pRenderTarget = = nullptr

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 136 行, 第 32 列)

const cauldron::RasterView * m_pRasterView

const cauldron::RasterView * m_pRasterView = = nullptr

属性: private

源代码: samples/parallelsort/parallelsortrendermodule.h (第 137 行, 第 32 列)

源代码: samples/parallelsort/parallelsortrendermodule.h (第 59 行, 第 1 列)

© . This site is unofficial and not affiliated with AMD.