| 224 | } |
| 225 | |
| 226 | void NGXWrapper::initializeDLSS( |
| 227 | RenderContext* pRenderContext, |
| 228 | uint2 maxRenderSize, |
| 229 | uint2 displayOutSize, |
| 230 | Texture* pTarget, |
| 231 | bool isContentHDR, |
| 232 | bool depthInverted, |
| 233 | NVSDK_NGX_PerfQuality_Value perfQuality |
| 234 | ) |
| 235 | { |
| 236 | unsigned int creationNodeMask = 1; |
| 237 | unsigned int visibilityNodeMask = 1; |
| 238 | |
| 239 | // Next create features |
| 240 | int createFlags = NVSDK_NGX_DLSS_Feature_Flags_None; |
| 241 | createFlags |= NVSDK_NGX_DLSS_Feature_Flags_MVLowRes; |
| 242 | createFlags |= isContentHDR ? NVSDK_NGX_DLSS_Feature_Flags_IsHDR : 0; |
| 243 | createFlags |= depthInverted ? NVSDK_NGX_DLSS_Feature_Flags_DepthInverted : 0; |
| 244 | |
| 245 | NVSDK_NGX_DLSS_Create_Params dlssParams = {}; |
| 246 | |
| 247 | dlssParams.Feature.InWidth = maxRenderSize.x; |
| 248 | dlssParams.Feature.InHeight = maxRenderSize.y; |
| 249 | dlssParams.Feature.InTargetWidth = displayOutSize.x; |
| 250 | dlssParams.Feature.InTargetHeight = displayOutSize.y; |
| 251 | dlssParams.Feature.InPerfQualityValue = perfQuality; |
| 252 | dlssParams.InFeatureCreateFlags = createFlags; |
| 253 | |
| 254 | switch (mpDevice->getType()) |
| 255 | { |
| 256 | case Device::Type::D3D12: |
| 257 | { |
| 258 | #if FALCOR_HAS_D3D12 |
| 259 | pRenderContext->submit(); |
| 260 | ID3D12GraphicsCommandList* pCommandList = |
| 261 | pRenderContext->getLowLevelData()->getCommandBufferNativeHandle().as<ID3D12GraphicsCommandList*>(); |
| 262 | THROW_IF_FAILED(NGX_D3D12_CREATE_DLSS_EXT(pCommandList, creationNodeMask, visibilityNodeMask, &mpFeature, mpParameters, &dlssParams) |
| 263 | ); |
| 264 | pRenderContext->submit(); |
| 265 | #endif |
| 266 | break; |
| 267 | } |
| 268 | case Device::Type::Vulkan: |
| 269 | { |
| 270 | #if FALCOR_HAS_VULKAN |
| 271 | pRenderContext->submit(); |
| 272 | VkCommandBuffer vkCommandBuffer = pRenderContext->getLowLevelData()->getCommandBufferNativeHandle().as<VkCommandBuffer>(); |
| 273 | THROW_IF_FAILED( |
| 274 | NGX_VULKAN_CREATE_DLSS_EXT(vkCommandBuffer, creationNodeMask, visibilityNodeMask, &mpFeature, mpParameters, &dlssParams) |
| 275 | ); |
| 276 | pRenderContext->submit(); |
| 277 | #endif |
| 278 | break; |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | void NGXWrapper::releaseDLSS() |
nothing calls this directly
no test coverage detected