| 166 | } |
| 167 | |
| 168 | void DLSSPass::initializeDLSS(RenderContext* pRenderContext) |
| 169 | { |
| 170 | if (!mpNGXWrapper) |
| 171 | mpNGXWrapper.reset(new NGXWrapper(mpDevice, getRuntimeDirectory(), getRuntimeDirectory())); |
| 172 | |
| 173 | Texture* target = nullptr; // Not needed for D3D12 implementation |
| 174 | bool depthInverted = false; |
| 175 | NVSDK_NGX_PerfQuality_Value perfQuality = NVSDK_NGX_PerfQuality_Value_Balanced; |
| 176 | switch (mProfile) |
| 177 | { |
| 178 | case Profile::MaxPerf: |
| 179 | perfQuality = NVSDK_NGX_PerfQuality_Value_MaxPerf; |
| 180 | break; |
| 181 | case Profile::Balanced: |
| 182 | perfQuality = NVSDK_NGX_PerfQuality_Value_Balanced; |
| 183 | break; |
| 184 | case Profile::MaxQuality: |
| 185 | perfQuality = NVSDK_NGX_PerfQuality_Value_MaxQuality; |
| 186 | break; |
| 187 | } |
| 188 | |
| 189 | auto optimalSettings = mpNGXWrapper->queryOptimalSettings(mInputSize, perfQuality); |
| 190 | |
| 191 | mDLSSOutputSize = uint2(float2(mInputSize) * float2(mInputSize) / float2(optimalSettings.optimalRenderSize)); |
| 192 | mpOutput = mpDevice->createTexture2D( |
| 193 | mDLSSOutputSize.x, |
| 194 | mDLSSOutputSize.y, |
| 195 | ResourceFormat::RGBA32Float, |
| 196 | 1, |
| 197 | 1, |
| 198 | nullptr, |
| 199 | ResourceBindFlags::UnorderedAccess | ResourceBindFlags::ShaderResource |
| 200 | ); |
| 201 | |
| 202 | mpNGXWrapper->releaseDLSS(); |
| 203 | mpNGXWrapper->initializeDLSS(pRenderContext, mInputSize, mDLSSOutputSize, target, mIsHDR, depthInverted, perfQuality); |
| 204 | } |
| 205 | |
| 206 | void DLSSPass::executeInternal(RenderContext* pRenderContext, const RenderData& renderData) |
| 207 | { |
nothing calls this directly
no test coverage detected