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

Method prepareProgram

Source/Falcor/Utils/Debug/PixelDebug.cpp:116–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void PixelDebug::prepareProgram(const ref<Program>& pProgram, const ShaderVar& var)
117{
118 FALCOR_CHECK(mRunning, "Logging is not running, did you forget to call beginFrame()?");
119
120 if (mEnabled)
121 {
122 pProgram->addDefine("_PIXEL_DEBUG_ENABLED");
123
124 ShaderVar pixelDebug = var["gPixelDebug"];
125 pixelDebug["counterBuffer"] = mpCounterBuffer;
126 pixelDebug["printBuffer"] = mpPrintBuffer;
127 pixelDebug["assertBuffer"] = mpAssertBuffer;
128 pixelDebug["printBufferCapacity"] = mPrintCapacity;
129 pixelDebug["assertBufferCapacity"] = mAssertCapacity;
130 pixelDebug["selectedPixel"] = mSelectedPixel;
131
132 const auto& hashedStrings = pProgram->getReflector()->getHashedStrings();
133 for (const auto& hashedString : hashedStrings)
134 {
135 mHashToString.insert(std::make_pair(hashedString.hash, hashedString.string));
136 }
137 }
138 else
139 {
140 pProgram->removeDefine("_PIXEL_DEBUG_ENABLED");
141 }
142}
143
144void PixelDebug::renderUI(Gui::Widgets* widget)
145{

Callers

nothing calls this directly

Calls 3

addDefineMethod · 0.45
insertMethod · 0.45
removeDefineMethod · 0.45

Tested by

no test coverage detected