MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / analyze

Method analyze

Source/Falcor/Utils/Image/TextureAnalyzer.cpp:58–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void TextureAnalyzer::analyze(
59 RenderContext* pRenderContext,
60 const ref<Texture> pInput,
61 uint32_t mipLevel,
62 uint32_t arraySlice,
63 ref<Buffer> pResult,
64 uint64_t resultOffset,
65 bool clearResult
66)
67{
68 FALCOR_ASSERT(pRenderContext && pInput);
69 FALCOR_ASSERT(pResult && resultOffset + getResultSize() <= pResult->getSize());
70 FALCOR_ASSERT(resultOffset < std::numeric_limits<uint32_t>::max());
71
72 checkFormatSupport(pInput, mipLevel, arraySlice);
73
74 if (clearResult)
75 {
76 clear(pRenderContext, pResult, resultOffset, 1);
77 }
78
79 auto pSRV = pInput->getSRV(mipLevel, 1, arraySlice, 1);
80 FALCOR_ASSERT(pSRV);
81
82 uint2 dim = {pInput->getWidth(mipLevel), pInput->getHeight(mipLevel)};
83 FALCOR_ASSERT(dim.x > 0 && dim.y > 0);
84
85 // Bind resources.
86 auto var = mpAnalyzePass->getRootVar()["gTextureAnalyzer"];
87 var["input"].setSrv(pSRV);
88 var["result"] = pResult;
89 var["resultOffset"] = (uint32_t)resultOffset;
90 var["inputDim"] = dim;
91
92 mpAnalyzePass->execute(pRenderContext, uint3(dim, 1));
93}
94
95void TextureAnalyzer::analyze(RenderContext* pRenderContext, const std::vector<ref<Texture>>& inputs, ref<Buffer> pResult, bool clearResult)
96{

Callers 3

optimizeMaterialsMethod · 0.80
GPU_TESTFunction · 0.80
testDDSFunction · 0.80

Calls 11

getWidthMethod · 0.80
getHeightMethod · 0.80
getRootVarMethod · 0.80
maxFunction · 0.50
clearFunction · 0.50
getSizeMethod · 0.45
getSRVMethod · 0.45
setSrvMethod · 0.45
executeMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by 2

GPU_TESTFunction · 0.64
testDDSFunction · 0.64