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

Method Program

Source/Falcor/Core/Program/Program.cpp:59–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59Program::Program(ref<Device> pDevice, ProgramDesc desc, DefineList defineList)
60 : mpDevice(std::move(pDevice)), mDesc(std::move(desc)), mDefineList(std::move(defineList)), mTypeConformanceList(mDesc.typeConformances)
61{
62 mDesc.finalize();
63
64 // If not shader model was requested, use the default shader model for the device.
65 if (mDesc.shaderModel == ShaderModel::Unknown)
66 mDesc.shaderModel = mpDevice->getDefaultShaderModel();
67
68 // Check that shader model is supported on the device.
69 if (!mpDevice->isShaderModelSupported(mDesc.shaderModel))
70 FALCOR_THROW("Requested Shader Model {} is not supported by the device", enumToString(mDesc.shaderModel));
71
72 if (mDesc.hasEntryPoint(ShaderType::RayGeneration))
73 {
74 if (desc.maxTraceRecursionDepth == uint32_t(-1))
75 FALCOR_THROW("Can't create a raytacing program without specifying maximum trace recursion depth");
76 if (desc.maxPayloadSize == uint32_t(-1))
77 FALCOR_THROW("Can't create a raytacing program without specifying maximum ray payload size");
78 }
79
80 validateEntryPoints();
81
82 mpDevice->getProgramManager()->registerProgramForReload(this);
83}
84
85Program::~Program()
86{

Callers

nothing calls this directly

Calls 4

hasEntryPointMethod · 0.80
finalizeMethod · 0.45

Tested by

no test coverage detected