| 114 | } |
| 115 | |
| 116 | void 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 | |
| 144 | void PixelDebug::renderUI(Gui::Widgets* widget) |
| 145 | { |
nothing calls this directly
no test coverage detected