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

Method getRtso

Source/Falcor/Core/Program/Program.cpp:361–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361ref<RtStateObject> Program::getRtso(RtProgramVars* pVars)
362{
363 auto pProgramVersion = getActiveVersion();
364 auto pProgramKernels = pProgramVersion->getKernels(mpDevice, pVars);
365
366 mRtsoGraph.walk((void*)pProgramKernels.get());
367
368 ref<RtStateObject> pRtso = mRtsoGraph.getCurrentNode();
369
370 if (pRtso == nullptr)
371 {
372 RtStateObjectDesc desc;
373 desc.pProgramKernels = pProgramKernels;
374 desc.maxTraceRecursionDepth = mDesc.maxTraceRecursionDepth;
375 desc.pipelineFlags = mDesc.rtPipelineFlags;
376
377 StateGraph::CompareFunc cmpFunc = [&desc](ref<RtStateObject> pRtso) -> bool { return pRtso && (desc == pRtso->getDesc()); };
378
379 if (mRtsoGraph.scanForMatchingNode(cmpFunc))
380 {
381 pRtso = mRtsoGraph.getCurrentNode();
382 }
383 else
384 {
385 pRtso = mpDevice->createRtStateObject(desc);
386 mRtsoGraph.setCurrentNodeData(pRtso);
387 }
388 }
389
390 return pRtso;
391}
392
393FALCOR_SCRIPT_BINDING(Program)
394{

Callers 1

raytraceMethod · 0.80

Calls 6

getKernelsMethod · 0.80
walkMethod · 0.80
scanForMatchingNodeMethod · 0.80
createRtStateObjectMethod · 0.80
setCurrentNodeDataMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected