| 124 | } |
| 125 | |
| 126 | SampleUI::SampleUI(DeviceManager* deviceManager, SampleBaseApp & baseApp, Sample& app, SampleUIData& ui, bool NVAPI_SERSupported, const CommandLineOptions& cmdLine) |
| 127 | : ImGui_Renderer(deviceManager) |
| 128 | , m_baseApp(baseApp) |
| 129 | , m_app(app) |
| 130 | , m_ui(ui) |
| 131 | , m_NVAPI_SERSupported(NVAPI_SERSupported) |
| 132 | { |
| 133 | m_commandList = GetDevice()->createCommandList(); |
| 134 | |
| 135 | auto nativeFS = std::make_shared<donut::vfs::NativeFileSystem>(); // *(app.GetRootFs()) |
| 136 | |
| 137 | // // auto fontPath = GetLocalPath(c_AssetsFolder) / "fonts/OpenSans/OpenSans-Regular.ttf"; |
| 138 | auto fontPath = GetLocalPath(c_AssetsFolder) / "fonts/DroidSans/DroidSans-Mono.ttf"; |
| 139 | // float baseFontSize = 15.0f; |
| 140 | // |
| 141 | m_defaultFont = this->CreateFontFromFile(*nativeFS, GetLocalPath(c_AssetsFolder) / "fonts/DroidSans/DroidSans-Mono.ttf", 16.0f); |
| 142 | |
| 143 | ImGui::GetIO().IniFilename = nullptr; |
| 144 | |
| 145 | // Choose which, if any, hit object extension we can use |
| 146 | #if RTXPT_D3D_AGILITY_SDK_VERSION >= 619 |
| 147 | m_ui.DXHitObjectExtension = (GetDevice()->getGraphicsAPI() == nvrhi::GraphicsAPI::D3D12); // 6.9 support guarantees SER |
| 148 | m_ui.NVAPIHitObjectExtension &= !m_ui.DXHitObjectExtension && NVAPI_SERSupported; |
| 149 | #else |
| 150 | m_ui.NVAPIHitObjectExtension &= NVAPI_SERSupported; // no need to check for or attempt using HitObjectExtension if SER not supported |
| 151 | #endif |
| 152 | |
| 153 | |
| 154 | #if ENABLE_DEBUG_DELTA_TREE_VIZUALISATION |
| 155 | m_ImNodesContext = ImNodes::Ez::CreateContext(); |
| 156 | #endif |
| 157 | |
| 158 | m_ui.RelaxSettings = NrdConfig::getDefaultRELAXSettings(); |
| 159 | m_ui.ReblurSettings = NrdConfig::getDefaultREBLURSettings(); |
| 160 | |
| 161 | m_ui.TemporalAntiAliasingParams.useHistoryClampRelax = true; |
| 162 | |
| 163 | m_ui.ToneMappingParams.toneMapOperator = ToneMapperOperator::HableUc2; |
| 164 | |
| 165 | // enable by default for now |
| 166 | m_ui.RTXDI.regir.regirStaticParams.Mode = rtxdi::ReGIRMode::Grid; |
| 167 | |
| 168 | // load core settings |
| 169 | m_ui.UseNEE = cmdLine.UseNEE != 0; |
| 170 | m_ui.NEEType = cmdLine.NEEType; |
| 171 | m_ui.UseReSTIRDI = cmdLine.UseReSTIRDI != 0; |
| 172 | m_ui.UseReSTIRGI = cmdLine.UseReSTIRGI != 0; |
| 173 | m_ui.RealtimeSamplesPerPixel = cmdLine.RealtimeSamplesPerPixel; |
| 174 | m_ui.AccumulationTarget = cmdLine.ReferenceSamplesPerPixel; |
| 175 | m_ui.StandaloneDenoiser = cmdLine.StandaloneDenoiser != 0; |
| 176 | m_ui.RealtimeAA = cmdLine.RealtimeAA; |
| 177 | |
| 178 | ApplyPreset(m_ui, s_performancePresets[2]); |
| 179 | |
| 180 | m_ui.EnableBloom &= !cmdLine.DisablePostProcessFilters; |
| 181 | } |
| 182 | |
| 183 | SampleUI::~SampleUI() |
nothing calls this directly
no test coverage detected