diff --git a/CMakeLists.txt b/CMakeLists.txt index 48ea67b..324b2ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,27 +1,29 @@ cmake_minimum_required (VERSION 3.15) # Options -option (NRD_DISABLE_SHADER_COMPILATION "Disable shader compilation" OFF) -option (NRD_USE_PRECOMPILED_SHADERS "Use precompiled (embedded) shaders" ON) -option (NRD_STATIC_LIBRARY "Build static library" OFF) +if (WIN32) + set (IS_WIN ON) +else () + set (IS_WIN OFF) +endif () -# Windows specific -if(WIN32) - option (NRD_PRECOMPILE_SPIRV_SHADERS "Precompile SPIRV shaders" ON) - option (NRD_PRECOMPILE_D3D_SHADERS "Precompile DXIL shaders" ON) -endif() +option (NRD_STATIC_LIBRARY "Build static library" OFF) +option (NRD_EMBEDS_SPIRV_SHADERS "NRD embeds SPIRV shaders" ON) +option (NRD_EMBEDS_DXIL_SHADERS "NRD embeds DXIL shaders" ${IS_WIN}) +option (NRD_EMBEDS_DXBC_SHADERS "NRD embeds DXBC shaders" ${IS_WIN}) +option (NRD_DISABLE_SHADER_COMPILATION "Disable shader compilation" OFF) # Is submodule? if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) - set(IS_SUBMODULE OFF) -else() - set(IS_SUBMODULE ON) -endif() + set (IS_SUBMODULE OFF) +else () + set (IS_SUBMODULE ON) +endif () # Cached if (NOT IS_SUBMODULE) set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "") -endif() +endif () set (NRD_DXC_CUSTOM_PATH "custom/path/to/dxc" CACHE STRING "Custom DXC to use if Vulkan SDK is not installed") set (NRD_SHADERS_PATH "" CACHE STRING "Shader output path override") @@ -73,13 +75,20 @@ endif () # Compile definitions set (COMPILE_DEFINITIONS NRD_NORMAL_ENCODING=${NRD_NORMAL_ENCODING} NRD_ROUGHNESS_ENCODING=${NRD_ROUGHNESS_ENCODING}) +if (NRD_EMBEDS_SPIRV_SHADERS) + set (COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} NRD_EMBEDS_SPIRV_SHADERS) +endif () + +if (NRD_EMBEDS_DXIL_SHADERS) + set (COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} NRD_EMBEDS_DXIL_SHADERS) +endif () + +if (NRD_EMBEDS_DXBC_SHADERS) + set (COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} NRD_EMBEDS_DXBC_SHADERS) +endif () + if (WIN32) - if (NRD_PRECOMPILE_SPIRV_SHADERS AND NOT NRD_PRECOMPILE_D3D_SHADERS) - set (COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} NRD_ONLY_SPIRV_SHADERS_AVAILABLE=1) - endif () set (COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} WIN32_LEAN_AND_MEAN NOMINMAX _CRT_SECURE_NO_WARNINGS _UNICODE UNICODE _ENFORCE_MATCHING_ALLOCATORS=0) -else () - set (COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} NRD_ONLY_SPIRV_SHADERS_AVAILABLE=1) endif () # External/MathLib @@ -135,28 +144,27 @@ set_target_properties (${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${GL set_target_properties (${PROJECT_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${GLOBAL_BIN_OUTPUT_PATH}/$") message ("NRD output path: '${GLOBAL_BIN_OUTPUT_PATH}'") -# External/ShaderMake -if (NOT TARGET ShaderMake) - set (SHADERMAKE_BIN_OUTPUT_PATH ${GLOBAL_BIN_OUTPUT_PATH} CACHE STRING "") - add_subdirectory (External/ShaderMake) -endif () - # Shaders -if (NRD_USE_PRECOMPILED_SHADERS) +if (NOT NRD_DISABLE_SHADER_COMPILATION) target_include_directories (${PROJECT_NAME} PRIVATE "${NRD_SHADERS_PATH}") - target_compile_definitions (${PROJECT_NAME} PRIVATE NRD_USE_PRECOMPILED_SHADERS) file (GLOB_RECURSE SHADERS "Shaders/*.hlsl" "Shaders/*.hlsli" "External/MathLib/*.hlsli") set_source_files_properties (${SHADERS} PROPERTIES VS_TOOL_OVERRIDE "None") - - # Arguements for ShaderMake - set(SHADERMAKE_GENERAL_ARGS - --WX - --header ${NRD_SHADER_BINARIES} + + # External/ShaderMake + if (NOT TARGET ShaderMake) + set (SHADERMAKE_BIN_OUTPUT_PATH ${GLOBAL_BIN_OUTPUT_PATH} CACHE STRING "") + add_subdirectory (External/ShaderMake) + endif () + + # ShaderMake general arguments + set (SHADERMAKE_GENERAL_ARGS + --header ${NRD_SHADER_BINARIES} --flatten - --stripReflection + --stripReflection --sourceDir "Shaders/Source" --allResourcesBound + --WX -c Shaders.cfg -o "${NRD_SHADERS_PATH}" -I "External/MathLib" @@ -166,40 +174,35 @@ if (NRD_USE_PRECOMPILED_SHADERS) -D NRD_ROUGHNESS_ENCODING=${NRD_ROUGHNESS_ENCODING} -D NRD_INTERNAL ) - if (WIN32) - # Arguements for ShaderMake depending on which backend is used - set(SHADERMAKE_COMMANDS "") - if(NRD_PRECOMPILE_D3D_SHADERS) # DXIL Commands - set(SHADERMAKE_COMMANDS ${SHADERMAKE_COMMANDS} COMMAND ShaderMake --useAPI -p DXIL --compiler "${DXC_PATH}" ${SHADERMAKE_GENERAL_ARGS}) - endif() - if(NRD_PRECOMPILE_D3D_SHADERS) # DXBC Commands - set(SHADERMAKE_COMMANDS ${SHADERMAKE_COMMANDS} COMMAND ShaderMake --useAPI -p DXBC --compiler "${FXC_PATH}" ${SHADERMAKE_GENERAL_ARGS}) - endif() - if(NRD_PRECOMPILE_SPIRV_SHADERS) - set(SHADERMAKE_COMMANDS ${SHADERMAKE_COMMANDS} COMMAND ShaderMake --useAPI -p SPIRV --compiler "${DXC_SPIRV_PATH}" ${SHADERMAKE_GENERAL_ARGS} - --sRegShift 100 - --tRegShift 200 - --bRegShift 300 - --uRegShift 400 - ) - endif() - - # Add the target with the commands - add_custom_target (${PROJECT_NAME}_Shaders ALL ${SHADERMAKE_COMMANDS} - DEPENDS ShaderMake - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - VERBATIM - SOURCES ${SHADERS}) - else () - add_custom_target (${PROJECT_NAME}_Shaders ALL - COMMAND ShaderMake -p SPIRV --compiler "${DXC_SPIRV_PATH}" ${SHADERMAKE_GENERAL_ARGS} - DEPENDS ShaderMake - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - VERBATIM - SOURCES ${SHADERS} + + # ShaderMake commands for each shader code container + set (SHADERMAKE_COMMANDS "") + + if (NRD_EMBEDS_DXBC_SHADERS) + set (SHADERMAKE_COMMANDS ${SHADERMAKE_COMMANDS} COMMAND ShaderMake -p DXBC --compiler "${FXC_PATH}" --useAPI ${SHADERMAKE_GENERAL_ARGS}) + endif () + + if (NRD_EMBEDS_DXIL_SHADERS) + set (SHADERMAKE_COMMANDS ${SHADERMAKE_COMMANDS} COMMAND ShaderMake -p DXIL --compiler "${DXC_PATH}" --useAPI ${SHADERMAKE_GENERAL_ARGS}) + endif () + + if (NRD_EMBEDS_SPIRV_SHADERS) + set (SHADERMAKE_COMMANDS ${SHADERMAKE_COMMANDS} COMMAND ShaderMake -p SPIRV --compiler "${DXC_SPIRV_PATH}" ${SHADERMAKE_GENERAL_ARGS} + --sRegShift 100 + --tRegShift 200 + --bRegShift 300 + --uRegShift 400 ) endif () + # Add the target with the commands + add_custom_target (${PROJECT_NAME}_Shaders ALL ${SHADERMAKE_COMMANDS} + DEPENDS ShaderMake + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + VERBATIM + SOURCES ${SHADERS} + ) + set_property (TARGET ${PROJECT_NAME}_Shaders PROPERTY FOLDER ${PROJECT_NAME}) add_dependencies (${PROJECT_NAME} ${PROJECT_NAME}_Shaders) endif () diff --git a/External/MathLib b/External/MathLib index 0944b34..221b68c 160000 --- a/External/MathLib +++ b/External/MathLib @@ -1 +1 @@ -Subproject commit 0944b34b9c3e38bc3db56762864ea2eb8960cf07 +Subproject commit 221b68c1bc369252dba970c9c673ad908cde62a0 diff --git a/External/ShaderMake b/External/ShaderMake index 6283d05..4027642 160000 --- a/External/ShaderMake +++ b/External/ShaderMake @@ -1 +1 @@ -Subproject commit 6283d05744ee30ef6064b7198852d7e914249877 +Subproject commit 40276423ae34ae1d138cc5ff35a31e139e11d6d4 diff --git a/Include/NRD.h b/Include/NRD.h index 12c9c3a..8184a34 100644 --- a/Include/NRD.h +++ b/Include/NRD.h @@ -29,8 +29,8 @@ license agreement from NVIDIA CORPORATION is strictly prohibited. #define NRD_VERSION_MAJOR 4 #define NRD_VERSION_MINOR 2 -#define NRD_VERSION_BUILD 1 -#define NRD_VERSION_DATE "25 May 2023" +#define NRD_VERSION_BUILD 2 +#define NRD_VERSION_DATE "4 July 2023" #if defined(_MSC_VER) #define NRD_CALL __fastcall diff --git a/Include/NRDDescs.h b/Include/NRDDescs.h index ebeb120..b4269d3 100644 --- a/Include/NRDDescs.h +++ b/Include/NRDDescs.h @@ -266,7 +266,7 @@ namespace nrd OUT_DELTA_MV, // (Optional) Debug output (RGBA8+), .w = transparency - // Written to if "InstanceCreationDesc::allowValidation = true" and "CommonSettings::enableValidation = true" + // Used if "CommonSettings::enableValidation = true" OUT_VALIDATION, //============================================================================================================================= diff --git a/README.md b/README.md index b2499c5..6ac3e77 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# NVIDIA REAL-TIME DENOISERS v4.2.1 (NRD) +# NVIDIA REAL-TIME DENOISERS v4.2.2 (NRD) [![Build NRD SDK](https://github.com/NVIDIAGameWorks/RayTracingDenoiser/actions/workflows/build.yml/badge.svg)](https://github.com/NVIDIAGameWorks/RayTracingDenoiser/actions/workflows/build.yml) @@ -40,7 +40,7 @@ For diffuse and specular signals de-modulated irradiance (i.e. irradiance with " - Install on - Windows: latest *WindowsSDK* (22000+), *VulkanSDK* (1.3.216+) - Linux (x86-64): latest *VulkanSDK* - - Linux (aarch64): find a precompiled binary for [*DXC*](https://github.com/microsoft/DirectXShaderCompiler) or disable shader compilation `NRD_DISABLE_SHADER_COMPILATION=OFF` + - Linux (aarch64): find a precompiled binary for [*DXC*](https://github.com/microsoft/DirectXShaderCompiler) or disable shader compilation `NRD_EMBEDS_SPIRV_SHADERS=OFF` - Build (variant 1) - using *Git* and *CMake* explicitly - Clone project and init submodules - Generate and build the project using *CMake* @@ -49,13 +49,15 @@ For diffuse and specular signals de-modulated irradiance (i.e. irradiance with " - Run `2-Build` CMake options: -- `NRD_DXC_CUSTOM_PATH = "custom/path/to/dxc"` - custom DXC to use if Vulkan SDK is not installed - `NRD_SHADERS_PATH` - shader output path override +- `NRD_STATIC_LIBRARY` - build static library (OFF by default) +- `NRD_DXC_CUSTOM_PATH` - custom DXC to use if Vulkan SDK is not installed - `NRD_NORMAL_ENCODING` - *normal* encoding for the entire library - `NRD_ROUGHNESS_ENCODING` - *roughness* encoding for the entire library -- `NRD_DISABLE_SHADER_COMPILATION` - disable shader compilation (shaders can be compiled on another platform) -- `NRD_USE_PRECOMPILED_SHADERS` - use precompiled shaders (will be embedded into the library) -- `NRD_STATIC_LIBRARY` - build static library +- `NRD_EMBEDS_DXBC_SHADERS` - NRD compiles and embeds DXBC shaders (ON by default on Windows) +- `NRD_EMBEDS_DXIL_SHADERS` - NRD compiles and embeds DXIL shaders (ON by default on Windows) +- `NRD_EMBEDS_SPIRV_SHADERS` - NRD compiles and embeds SPIRV shaders (ON by default) +- `NRD_DISABLE_SHADER_COMPILATION` - disable shader compilation on the NRD side, NRD assumes that shaders are already compiled externally and have been put into `NRD_SHADERS_PATH` folder `NRD_NORMAL_ENCODING` and `NRD_ROUGHNESS_ENCODING` can be defined only *once* during project deployment. These settings are dumped in `NRDEncoding.hlsli` file, which needs to be included on the application side prior `NRD.hlsli` inclusion to deliver encoding settings matching *NRD* settings. `LibraryDesc` includes encoding settings too. It can be used to verify that the library meets the application expectations. @@ -247,6 +249,8 @@ else } ``` +Re-jittering math with minorly modified inputs can also be used with RESTIR produced sampling without involving SH denoisers. You only need to get light direction in the current pixel from RESTIR. Despite that RESTIR produces noisy light selections, its low variations can be easily handled by DLSS or other upscaling techs. + # VALIDATION LAYER ![Validation](Images/Validation.png) diff --git a/Resources/Version.h b/Resources/Version.h index 28b6464..f60f1e2 100644 --- a/Resources/Version.h +++ b/Resources/Version.h @@ -23,6 +23,6 @@ Versioning rules: #define VERSION_MAJOR 4 #define VERSION_MINOR 2 -#define VERSION_BUILD 1 +#define VERSION_BUILD 2 #define VERSION_STRING STR(VERSION_MAJOR.VERSION_MINOR.VERSION_BUILD encoding=NRD_NORMAL_ENCODING.NRD_ROUGHNESS_ENCODING) diff --git a/Shaders/Include/NRD.hlsli b/Shaders/Include/NRD.hlsli index 49e0ffd..b81a409 100644 --- a/Shaders/Include/NRD.hlsli +++ b/Shaders/Include/NRD.hlsli @@ -595,6 +595,7 @@ float4 REBLUR_FrontEnd_PackSh( float3 radiance, float normHitDist, float3 direct { radiance = any( isnan( radiance ) | isinf( radiance ) ) ? 0 : clamp( radiance, 0, NRD_FP16_MAX ); normHitDist = ( isnan( normHitDist ) | isinf( normHitDist ) ) ? 0 : saturate( normHitDist ); + direction = any( isnan( direction ) | isinf( direction ) ) ? 0 : clamp( direction, -NRD_FP16_MAX, NRD_FP16_MAX ); } // "0" is reserved to mark "no data" samples, skipped due to probabilistic sampling @@ -852,6 +853,11 @@ float NRD_SG_ExtractRoughnessAA( NRD_SG sg ) return sg.sharpness; } +void NRD_SG_Rotate( inout NRD_SG sg, float3x3 rotation ) +{ + sg.c1 = mul( rotation, sg.c1 ); +} + float3 NRD_SG_ResolveDiffuse( NRD_SG sg, float3 N ) { // https://therealmjp.github.io/posts/sg-series-part-3-diffuse-lighting-from-an-sg-light-source/ diff --git a/Shaders/Include/REBLUR/REBLUR_Common_DiffuseSpatialFilter.hlsli b/Shaders/Include/REBLUR/REBLUR_Common_DiffuseSpatialFilter.hlsli index 01b5a3a..cd90f05 100644 --- a/Shaders/Include/REBLUR/REBLUR_Common_DiffuseSpatialFilter.hlsli +++ b/Shaders/Include/REBLUR/REBLUR_Common_DiffuseSpatialFilter.hlsli @@ -145,7 +145,7 @@ license agreement from NVIDIA CORPORATION is strictly prohibited. w *= GetCombinedWeight( geometryWeightParams, Nv, Xvs, normalWeightParams, N, Ns ); w *= lerp( minHitDistWeight, 1.0, GetHitDistanceWeight( hitDistanceWeightParams, ExtractHitDist( s ) ) ); - // Get rid of potentially bad values outside of the screen + // Get rid of potential NANs outside of rendering rectangle or denoising range w = ( IsInScreen( uv ) && !isnan( w ) ) ? w : 0.0; s = w != 0.0 ? s : 0.0; @@ -174,12 +174,20 @@ license agreement from NVIDIA CORPORATION is strictly prohibited. REBLUR_TYPE s0 = gIn_Diff[ checkerboardPos.xy ]; REBLUR_TYPE s1 = gIn_Diff[ checkerboardPos.zy ]; + // Get rid of potential NANs outside of rendering rectangle or denoising range + s0 = wc.x != 0.0 ? s0 : 0; + s1 = wc.y != 0.0 ? s1 : 0; + diff = s0 * wc.x + s1 * wc.y; #ifdef REBLUR_SH float4 sh0 = gIn_DiffSh[ checkerboardPos.xy ]; float4 sh1 = gIn_DiffSh[ checkerboardPos.zy ]; + // Get rid of potential NANs outside of rendering rectangle or denoising range + sh0 = wc.x != 0.0 ? sh0 : 0; + sh1 = wc.y != 0.0 ? sh1 : 0; + diffSh = sh0 * wc.x + sh1 * wc.y; #endif } diff --git a/Shaders/Include/REBLUR/REBLUR_Common_SpecularSpatialFilter.hlsli b/Shaders/Include/REBLUR/REBLUR_Common_SpecularSpatialFilter.hlsli index b5594c2..9a48d32 100644 --- a/Shaders/Include/REBLUR/REBLUR_Common_SpecularSpatialFilter.hlsli +++ b/Shaders/Include/REBLUR/REBLUR_Common_SpecularSpatialFilter.hlsli @@ -184,7 +184,7 @@ license agreement from NVIDIA CORPORATION is strictly prohibited. #endif #endif - // Get rid of potentially bad values outside of the screen + // Get rid of potential NANs outside of rendering rectangle or denoising range w = ( IsInScreen( uv ) && !isnan( w ) ) ? w : 0.0; s = w != 0.0 ? s : 0.0; @@ -222,12 +222,20 @@ license agreement from NVIDIA CORPORATION is strictly prohibited. REBLUR_TYPE s0 = gIn_Spec[ checkerboardPos.xy ]; REBLUR_TYPE s1 = gIn_Spec[ checkerboardPos.zy ]; + // Get rid of potential NANs outside of rendering rectangle or denoising range + s0 = wc.x != 0.0 ? s0 : 0; + s1 = wc.y != 0.0 ? s1 : 0; + spec = s0 * wc.x + s1 * wc.y; #ifdef REBLUR_SH float4 sh0 = gIn_SpecSh[ checkerboardPos.xy ]; float4 sh1 = gIn_SpecSh[ checkerboardPos.zy ]; + // Get rid of potential NANs outside of rendering rectangle or denoising range + sh0 = wc.x != 0.0 ? sh0 : 0; + sh1 = wc.y != 0.0 ? sh1 : 0; + specSh = sh0 * wc.x + sh1 * wc.y; #endif } diff --git a/Shaders/Include/REBLUR/REBLUR_DiffuseSpecular_HistoryFix.hlsli b/Shaders/Include/REBLUR/REBLUR_DiffuseSpecular_HistoryFix.hlsli index 176539a..7a72e45 100644 --- a/Shaders/Include/REBLUR/REBLUR_DiffuseSpecular_HistoryFix.hlsli +++ b/Shaders/Include/REBLUR/REBLUR_DiffuseSpecular_HistoryFix.hlsli @@ -156,7 +156,7 @@ NRD_EXPORT void NRD_CS_MAIN( int2 threadPos : SV_GroupThreadId, int2 pixelPos : REBLUR_TYPE s = gIn_Diff.SampleLevel( gNearestClamp, uvScaled, 0 ); - // Get rid of potentially bad values outside of the screen + // Get rid of potential NANs outside of rendering rectangle or denoising range w = IsInScreen( uv ) ? w : 0.0; // no "!isnan" because "s" is not used for "w" calculations s = w != 0.0 ? s : 0.0; @@ -218,7 +218,10 @@ NRD_EXPORT void NRD_CS_MAIN( int2 threadPos : SV_GroupThreadId, int2 pixelPos : if( abs( i ) <= 1 && abs( j ) <= 1 ) continue; - float d = gIn_DiffFast.SampleLevel( gNearestClamp, pixelUv + int2( i, j ) * gInvRectSize, 0 ).x; + float2 uv = pixelUv + float2( i, j ) * gInvRectSize; + float2 uvScaled = uv * gResolutionScale; + + float d = gIn_DiffFast.SampleLevel( gNearestClamp, uvScaled, 0 ).x; m1 += d; m2 += d * d; } @@ -346,7 +349,7 @@ NRD_EXPORT void NRD_CS_MAIN( int2 threadPos : SV_GroupThreadId, int2 pixelPos : // It allows bleeding of background to foreground, but not vice versa ( doesn't suit for 0 roughness ) w *= saturate( 1.0 - hitDistWeightScale * abs( ExtractHitDist( s ) - hitDistNormAtCenter ) / ( max( ExtractHitDist( s ), hitDistNormAtCenter ) + NRD_EPS ) ); - // Get rid of potentially bad values outside of the screen + // Get rid of potential NANs outside of rendering rectangle or denoising range w = ( IsInScreen( uv ) && !isnan( w ) ) ? w : 0.0; s = w != 0.0 ? s : 0.0; @@ -408,7 +411,10 @@ NRD_EXPORT void NRD_CS_MAIN( int2 threadPos : SV_GroupThreadId, int2 pixelPos : if( abs( i ) <= 1 && abs( j ) <= 1 ) continue; - float s = gIn_SpecFast.SampleLevel( gNearestClamp, pixelUv + int2( i, j ) * gInvRectSize, 0 ).x; + float2 uv = pixelUv + float2( i, j ) * gInvRectSize; + float2 uvScaled = uv * gResolutionScale; + + float s = gIn_SpecFast.SampleLevel( gNearestClamp, uvScaled, 0 ).x; m1 += s; m2 += s * s; } diff --git a/Shaders/Include/REBLUR/REBLUR_DiffuseSpecular_HitDistReconstruction.hlsli b/Shaders/Include/REBLUR/REBLUR_DiffuseSpecular_HitDistReconstruction.hlsli index eb35a89..789aeca 100644 --- a/Shaders/Include/REBLUR/REBLUR_DiffuseSpecular_HitDistReconstruction.hlsli +++ b/Shaders/Include/REBLUR/REBLUR_DiffuseSpecular_HitDistReconstruction.hlsli @@ -38,6 +38,9 @@ void Preload( uint2 sharedPos, int2 globalPos ) #endif #endif + // Get rid of potential NANs outside of rendering rectangle or denoising range + hitDist = viewZ > gDenoisingRange ? 0 : hitDist; + s_HitDist_ViewZ[ sharedPos.y ][ sharedPos.x ] = float3( hitDist, viewZ ); } diff --git a/Source/InstanceImpl.cpp b/Source/InstanceImpl.cpp index 5b5602a..4d6aaa3 100644 --- a/Source/InstanceImpl.cpp +++ b/Source/InstanceImpl.cpp @@ -69,19 +69,19 @@ constexpr std::array g_IsIntegerFormat = false, // R9_G9_B9_E5_UFLOAT }; -#ifdef NRD_USE_PRECOMPILED_SHADERS +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "Clear_f.cs.dxbc.h" + #include "Clear_ui.cs.dxbc.h" +#endif - // NRD - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "Clear_f.cs.dxbc.h" - #include "Clear_f.cs.dxil.h" - #include "Clear_ui.cs.dxbc.h" - #include "Clear_ui.cs.dxil.h" - #endif +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "Clear_f.cs.dxil.h" + #include "Clear_ui.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "Clear_f.cs.spirv.h" #include "Clear_ui.cs.spirv.h" - #endif inline bool IsInList(nrd::Identifier identifier, const nrd::Identifier* identifiers, uint32_t identifiersNum) diff --git a/Source/InstanceImpl.h b/Source/InstanceImpl.h index 5413102..19bfac8 100644 --- a/Source/InstanceImpl.h +++ b/Source/InstanceImpl.h @@ -23,29 +23,32 @@ typedef nrd::MemoryAllocatorInterface MemoryAllocatorInterface; #define _NRD_STRINGIFY(s) #s #define NRD_STRINGIFY(s) _NRD_STRINGIFY(s) -#ifdef NRD_USE_PRECOMPILED_SHADERS - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #define AddDispatch(shaderName, constantNum, numThreads, downsampleFactor) \ - AddComputeDispatchDesc(numThreads, downsampleFactor, constantNum, 1, #shaderName ".cs", {g_##shaderName##_cs_dxbc, GetCountOf(g_##shaderName##_cs_dxbc)}, {g_##shaderName##_cs_dxil, GetCountOf(g_## shaderName##_cs_dxil)}, {g_##shaderName##_cs_spirv, GetCountOf(g_##shaderName##_cs_spirv)}) - - #define AddDispatchRepeated(shaderName, constantNum, numThreads, downsampleFactor, repeatNum) \ - AddComputeDispatchDesc(numThreads, downsampleFactor, constantNum, repeatNum, #shaderName ".cs", {g_##shaderName##_cs_dxbc, GetCountOf(g_##shaderName##_cs_dxbc)}, {g_##shaderName##_cs_dxil, GetCountOf(g_##shaderName##_cs_dxil)}, {g_##shaderName##_cs_spirv, GetCountOf(g_##shaderName##_cs_spirv)}) - #else - #define AddDispatch(shaderName, constantNum, numThreads, downsampleFactor) \ - AddComputeDispatchDesc(numThreads, downsampleFactor, constantNum, 1, #shaderName ".cs", {}, {}, {g_##shaderName##_cs_spirv, GetCountOf(g_##shaderName##_cs_spirv)}) - - #define AddDispatchRepeated(shaderName, constantNum, numThreads, downsampleFactor, repeatNum) \ - AddComputeDispatchDesc(numThreads, downsampleFactor, constantNum, repeatNum, #shaderName ".cs", {}, {}, {g_##shaderName##_cs_spirv, GetCountOf(g_##shaderName##_cs_spirv)}) - #endif +#ifdef NRD_EMBEDS_DXBC_SHADERS + #define GET_DXBC_SHADER_DESC(shaderName) {g_##shaderName##_cs_dxbc, GetCountOf(g_##shaderName##_cs_dxbc)} #else - #define AddDispatch(shaderName, constantNum, numThreads, downsampleFactor) \ - AddComputeDispatchDesc(numThreads, downsampleFactor, constantNum, 1, #shaderName ".cs", {}, {}, {}) + #define GET_DXBC_SHADER_DESC(shaderName) {} +#endif - #define AddDispatchRepeated(shaderName, constantNum, numThreads, downsampleFactor, repeatNum) \ - AddComputeDispatchDesc(numThreads, downsampleFactor, constantNum, repeatNum, #shaderName ".cs", {}, {}, {}) +#ifdef NRD_EMBEDS_DXIL_SHADERS + #define GET_DXIL_SHADER_DESC(shaderName) {g_##shaderName##_cs_dxil, GetCountOf(g_## shaderName##_cs_dxil)} +#else + #define GET_DXIL_SHADER_DESC(shaderName) {} #endif -#define PushPass(passName) _PushPass(NRD_STRINGIFY(DENOISER_NAME) " - " passName) +#ifdef NRD_EMBEDS_SPIRV_SHADERS + #define GET_SPIRV_SHADER_DESC(shaderName) {g_##shaderName##_cs_spirv, GetCountOf(g_##shaderName##_cs_spirv)} +#else + #define GET_SPIRV_SHADER_DESC(shaderName) {} +#endif + +#define AddDispatch(shaderName, constantNum, numThreads, downsampleFactor) \ + AddComputeDispatchDesc(numThreads, downsampleFactor, constantNum, 1, #shaderName ".cs", GET_DXBC_SHADER_DESC(shaderName), GET_DXIL_SHADER_DESC(shaderName), GET_SPIRV_SHADER_DESC(shaderName)) + +#define AddDispatchRepeated(shaderName, constantNum, numThreads, downsampleFactor, repeatNum) \ + AddComputeDispatchDesc(numThreads, downsampleFactor, constantNum, repeatNum, #shaderName ".cs", GET_DXBC_SHADER_DESC(shaderName), GET_DXIL_SHADER_DESC(shaderName), GET_SPIRV_SHADER_DESC(shaderName)) + +#define PushPass(passName) \ + _PushPass(NRD_STRINGIFY(DENOISER_NAME) " - " passName) // TODO: rework is needed, but still better than copy-pasting #define NRD_DECLARE_DIMS \ diff --git a/Source/Other.cpp b/Source/Other.cpp index 59cb246..5ed5b7f 100644 --- a/Source/Other.cpp +++ b/Source/Other.cpp @@ -10,37 +10,52 @@ license agreement from NVIDIA CORPORATION is strictly prohibited. #include "InstanceImpl.h" -#ifdef NRD_USE_PRECOMPILED_SHADERS +// REFERENCE +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REFERENCE_TemporalAccumulation.cs.dxbc.h" + #include "REFERENCE_SplitScreen.cs.dxbc.h" +#endif - // REFERENCE - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REFERENCE_TemporalAccumulation.cs.dxbc.h" - #include "REFERENCE_TemporalAccumulation.cs.dxil.h" - #include "REFERENCE_SplitScreen.cs.dxbc.h" - #include "REFERENCE_SplitScreen.cs.dxil.h" - #endif +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REFERENCE_TemporalAccumulation.cs.dxil.h" + #include "REFERENCE_SplitScreen.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REFERENCE_TemporalAccumulation.cs.spirv.h" #include "REFERENCE_SplitScreen.cs.spirv.h" +#endif - // SPECULAR_REFLECTION_MV - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "SpecularReflectionMv_Compute.cs.dxbc.h" - #include "SpecularReflectionMv_Compute.cs.dxil.h" - #endif +#include "Denoisers/Reference.hpp" - #include "SpecularReflectionMv_Compute.cs.spirv.h" - // SPECULAR_DELTA_MV - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "SpecularDeltaMv_Compute.cs.dxbc.h" - #include "SpecularDeltaMv_Compute.cs.dxil.h" - #endif +// SPECULAR_REFLECTION_MV +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "SpecularReflectionMv_Compute.cs.dxbc.h" +#endif - #include "SpecularDeltaMv_Compute.cs.spirv.h" +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "SpecularReflectionMv_Compute.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS + #include "SpecularReflectionMv_Compute.cs.spirv.h" #endif -#include "Denoisers/Reference.hpp" #include "Denoisers/SpecularReflectionMv.hpp" + + +// SPECULAR_DELTA_MV +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "SpecularDeltaMv_Compute.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "SpecularDeltaMv_Compute.cs.dxil.h" +#endif + +#ifdef NRD_EMBEDS_SPIRV_SHADERS + #include "SpecularDeltaMv_Compute.cs.spirv.h" +#endif + #include "Denoisers/SpecularDeltaMv.hpp" diff --git a/Source/Reblur.cpp b/Source/Reblur.cpp index 73f8f7a..309cc33 100644 --- a/Source/Reblur.cpp +++ b/Source/Reblur.cpp @@ -518,64 +518,72 @@ void nrd::InstanceImpl::AddSharedConstants_Reblur(const DenoiserData& denoiserDa AddUint(data, 0); } -#ifdef NRD_USE_PRECOMPILED_SHADERS +// REBLUR_SHARED +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REBLUR_ClassifyTiles.cs.dxbc.h" + #include "REBLUR_Validation.cs.dxbc.h" +#endif - // REBLUR_SHARED - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REBLUR_ClassifyTiles.cs.dxbc.h" - #include "REBLUR_ClassifyTiles.cs.dxil.h" - #include "REBLUR_Validation.cs.dxbc.h" - #include "REBLUR_Validation.cs.dxil.h" - #endif +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REBLUR_ClassifyTiles.cs.dxil.h" + #include "REBLUR_Validation.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REBLUR_ClassifyTiles.cs.spirv.h" #include "REBLUR_Validation.cs.spirv.h" +#endif + +// REBLUR_DIFFUSE +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REBLUR_Diffuse_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_Diffuse_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_Diffuse_PrePass.cs.dxbc.h" + #include "REBLUR_Diffuse_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Diffuse_HistoryFix.cs.dxbc.h" + #include "REBLUR_Diffuse_Blur.cs.dxbc.h" + #include "REBLUR_Diffuse_PostBlur.cs.dxbc.h" + #include "REBLUR_Diffuse_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_Diffuse_CopyStabilizedHistory.cs.dxbc.h" + #include "REBLUR_Diffuse_TemporalStabilization.cs.dxbc.h" + #include "REBLUR_Diffuse_SplitScreen.cs.dxbc.h" + + #include "REBLUR_Perf_Diffuse_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_Perf_Diffuse_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_Perf_Diffuse_PrePass.cs.dxbc.h" + #include "REBLUR_Perf_Diffuse_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Perf_Diffuse_HistoryFix.cs.dxbc.h" + #include "REBLUR_Perf_Diffuse_Blur.cs.dxbc.h" + #include "REBLUR_Perf_Diffuse_PostBlur.cs.dxbc.h" + #include "REBLUR_Perf_Diffuse_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_Perf_Diffuse_TemporalStabilization.cs.dxbc.h" +#endif - // REBLUR_DIFFUSE - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REBLUR_Diffuse_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_Diffuse_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_Diffuse_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_Diffuse_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_Diffuse_PrePass.cs.dxbc.h" - #include "REBLUR_Diffuse_PrePass.cs.dxil.h" - #include "REBLUR_Diffuse_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Diffuse_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Diffuse_HistoryFix.cs.dxbc.h" - #include "REBLUR_Diffuse_HistoryFix.cs.dxil.h" - #include "REBLUR_Diffuse_Blur.cs.dxbc.h" - #include "REBLUR_Diffuse_Blur.cs.dxil.h" - #include "REBLUR_Diffuse_PostBlur.cs.dxbc.h" - #include "REBLUR_Diffuse_PostBlur.cs.dxil.h" - #include "REBLUR_Diffuse_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Diffuse_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_Diffuse_CopyStabilizedHistory.cs.dxbc.h" - #include "REBLUR_Diffuse_CopyStabilizedHistory.cs.dxil.h" - #include "REBLUR_Diffuse_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_Diffuse_TemporalStabilization.cs.dxil.h" - #include "REBLUR_Diffuse_SplitScreen.cs.dxbc.h" - #include "REBLUR_Diffuse_SplitScreen.cs.dxil.h" - - #include "REBLUR_Perf_Diffuse_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_Perf_Diffuse_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_Perf_Diffuse_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_Perf_Diffuse_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_Perf_Diffuse_PrePass.cs.dxbc.h" - #include "REBLUR_Perf_Diffuse_PrePass.cs.dxil.h" - #include "REBLUR_Perf_Diffuse_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Perf_Diffuse_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Perf_Diffuse_HistoryFix.cs.dxbc.h" - #include "REBLUR_Perf_Diffuse_HistoryFix.cs.dxil.h" - #include "REBLUR_Perf_Diffuse_Blur.cs.dxbc.h" - #include "REBLUR_Perf_Diffuse_Blur.cs.dxil.h" - #include "REBLUR_Perf_Diffuse_PostBlur.cs.dxbc.h" - #include "REBLUR_Perf_Diffuse_PostBlur.cs.dxil.h" - #include "REBLUR_Perf_Diffuse_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_Diffuse_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_Perf_Diffuse_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_Diffuse_TemporalStabilization.cs.dxil.h" - #endif +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REBLUR_Diffuse_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_Diffuse_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_Diffuse_PrePass.cs.dxil.h" + #include "REBLUR_Diffuse_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Diffuse_HistoryFix.cs.dxil.h" + #include "REBLUR_Diffuse_Blur.cs.dxil.h" + #include "REBLUR_Diffuse_PostBlur.cs.dxil.h" + #include "REBLUR_Diffuse_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_Diffuse_CopyStabilizedHistory.cs.dxil.h" + #include "REBLUR_Diffuse_TemporalStabilization.cs.dxil.h" + #include "REBLUR_Diffuse_SplitScreen.cs.dxil.h" + + #include "REBLUR_Perf_Diffuse_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_Perf_Diffuse_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_Perf_Diffuse_PrePass.cs.dxil.h" + #include "REBLUR_Perf_Diffuse_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Perf_Diffuse_HistoryFix.cs.dxil.h" + #include "REBLUR_Perf_Diffuse_Blur.cs.dxil.h" + #include "REBLUR_Perf_Diffuse_PostBlur.cs.dxil.h" + #include "REBLUR_Perf_Diffuse_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_Perf_Diffuse_TemporalStabilization.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REBLUR_Diffuse_HitDistReconstruction.cs.spirv.h" #include "REBLUR_Diffuse_HitDistReconstruction_5x5.cs.spirv.h" #include "REBLUR_Diffuse_PrePass.cs.spirv.h" @@ -597,36 +605,45 @@ void nrd::InstanceImpl::AddSharedConstants_Reblur(const DenoiserData& denoiserDa #include "REBLUR_Perf_Diffuse_TemporalStabilization.cs.spirv.h" #include "REBLUR_Perf_Diffuse_PostBlur.cs.spirv.h" #include "REBLUR_Perf_Diffuse_PostBlur_NoTemporalStabilization.cs.spirv.h" +#endif + +#include "Denoisers/Reblur_Diffuse.hpp" + - // REBLUR_DIFFUSE_OCCLUSION - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REBLUR_DiffuseOcclusion_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_DiffuseOcclusion_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_DiffuseOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_DiffuseOcclusion_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_DiffuseOcclusion_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_DiffuseOcclusion_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_DiffuseOcclusion_HistoryFix.cs.dxbc.h" - #include "REBLUR_DiffuseOcclusion_HistoryFix.cs.dxil.h" - #include "REBLUR_DiffuseOcclusion_Blur.cs.dxbc.h" - #include "REBLUR_DiffuseOcclusion_Blur.cs.dxil.h" - #include "REBLUR_DiffuseOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_DiffuseOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" - - #include "REBLUR_Perf_DiffuseOcclusion_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseOcclusion_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_Perf_DiffuseOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseOcclusion_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_Perf_DiffuseOcclusion_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseOcclusion_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Perf_DiffuseOcclusion_HistoryFix.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseOcclusion_HistoryFix.cs.dxil.h" - #include "REBLUR_Perf_DiffuseOcclusion_Blur.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseOcclusion_Blur.cs.dxil.h" - #include "REBLUR_Perf_DiffuseOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" - #endif +// REBLUR_DIFFUSE_OCCLUSION +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REBLUR_DiffuseOcclusion_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_DiffuseOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_DiffuseOcclusion_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_DiffuseOcclusion_HistoryFix.cs.dxbc.h" + #include "REBLUR_DiffuseOcclusion_Blur.cs.dxbc.h" + #include "REBLUR_DiffuseOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" + + #include "REBLUR_Perf_DiffuseOcclusion_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseOcclusion_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseOcclusion_HistoryFix.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseOcclusion_Blur.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REBLUR_DiffuseOcclusion_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_DiffuseOcclusion_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_DiffuseOcclusion_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_DiffuseOcclusion_HistoryFix.cs.dxil.h" + #include "REBLUR_DiffuseOcclusion_Blur.cs.dxil.h" + #include "REBLUR_DiffuseOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" + + #include "REBLUR_Perf_DiffuseOcclusion_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_Perf_DiffuseOcclusion_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_Perf_DiffuseOcclusion_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Perf_DiffuseOcclusion_HistoryFix.cs.dxil.h" + #include "REBLUR_Perf_DiffuseOcclusion_Blur.cs.dxil.h" + #include "REBLUR_Perf_DiffuseOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REBLUR_DiffuseOcclusion_HitDistReconstruction.cs.spirv.h" #include "REBLUR_DiffuseOcclusion_HitDistReconstruction_5x5.cs.spirv.h" #include "REBLUR_DiffuseOcclusion_TemporalAccumulation.cs.spirv.h" @@ -640,44 +657,53 @@ void nrd::InstanceImpl::AddSharedConstants_Reblur(const DenoiserData& denoiserDa #include "REBLUR_Perf_DiffuseOcclusion_HistoryFix.cs.spirv.h" #include "REBLUR_Perf_DiffuseOcclusion_Blur.cs.spirv.h" #include "REBLUR_Perf_DiffuseOcclusion_PostBlur_NoTemporalStabilization.cs.spirv.h" +#endif + +#include "Denoisers/Reblur_DiffuseOcclusion.hpp" + - // REBLUR_DIFFUSE_SH - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REBLUR_DiffuseSh_PrePass.cs.dxbc.h" - #include "REBLUR_DiffuseSh_PrePass.cs.dxil.h" - #include "REBLUR_DiffuseSh_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_DiffuseSh_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_DiffuseSh_HistoryFix.cs.dxbc.h" - #include "REBLUR_DiffuseSh_HistoryFix.cs.dxil.h" - #include "REBLUR_DiffuseSh_Blur.cs.dxbc.h" - #include "REBLUR_DiffuseSh_Blur.cs.dxil.h" - #include "REBLUR_DiffuseSh_PostBlur.cs.dxbc.h" - #include "REBLUR_DiffuseSh_PostBlur.cs.dxil.h" - #include "REBLUR_DiffuseSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_DiffuseSh_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_DiffuseSh_CopyStabilizedHistory.cs.dxbc.h" - #include "REBLUR_DiffuseSh_CopyStabilizedHistory.cs.dxil.h" - #include "REBLUR_DiffuseSh_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_DiffuseSh_TemporalStabilization.cs.dxil.h" - #include "REBLUR_DiffuseSh_SplitScreen.cs.dxbc.h" - #include "REBLUR_DiffuseSh_SplitScreen.cs.dxil.h" - - #include "REBLUR_Perf_DiffuseSh_PrePass.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSh_PrePass.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSh_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSh_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSh_HistoryFix.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSh_HistoryFix.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSh_Blur.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSh_Blur.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSh_PostBlur.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSh_PostBlur.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSh_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSh_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSh_TemporalStabilization.cs.dxil.h" - #endif +// REBLUR_DIFFUSE_SH +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REBLUR_DiffuseSh_PrePass.cs.dxbc.h" + #include "REBLUR_DiffuseSh_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_DiffuseSh_HistoryFix.cs.dxbc.h" + #include "REBLUR_DiffuseSh_Blur.cs.dxbc.h" + #include "REBLUR_DiffuseSh_PostBlur.cs.dxbc.h" + #include "REBLUR_DiffuseSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_DiffuseSh_CopyStabilizedHistory.cs.dxbc.h" + #include "REBLUR_DiffuseSh_TemporalStabilization.cs.dxbc.h" + #include "REBLUR_DiffuseSh_SplitScreen.cs.dxbc.h" + + #include "REBLUR_Perf_DiffuseSh_PrePass.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSh_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSh_HistoryFix.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSh_Blur.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSh_PostBlur.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSh_TemporalStabilization.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REBLUR_DiffuseSh_PrePass.cs.dxil.h" + #include "REBLUR_DiffuseSh_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_DiffuseSh_HistoryFix.cs.dxil.h" + #include "REBLUR_DiffuseSh_Blur.cs.dxil.h" + #include "REBLUR_DiffuseSh_PostBlur.cs.dxil.h" + #include "REBLUR_DiffuseSh_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_DiffuseSh_CopyStabilizedHistory.cs.dxil.h" + #include "REBLUR_DiffuseSh_TemporalStabilization.cs.dxil.h" + #include "REBLUR_DiffuseSh_SplitScreen.cs.dxil.h" + + #include "REBLUR_Perf_DiffuseSh_PrePass.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSh_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSh_HistoryFix.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSh_Blur.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSh_PostBlur.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSh_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSh_TemporalStabilization.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REBLUR_DiffuseSh_PrePass.cs.spirv.h" #include "REBLUR_DiffuseSh_TemporalAccumulation.cs.spirv.h" #include "REBLUR_DiffuseSh_HistoryFix.cs.spirv.h" @@ -695,52 +721,62 @@ void nrd::InstanceImpl::AddSharedConstants_Reblur(const DenoiserData& denoiserDa #include "REBLUR_Perf_DiffuseSh_TemporalStabilization.cs.spirv.h" #include "REBLUR_Perf_DiffuseSh_PostBlur.cs.spirv.h" #include "REBLUR_Perf_DiffuseSh_PostBlur_NoTemporalStabilization.cs.spirv.h" +#endif + +#include "Denoisers/Reblur_DiffuseSh.hpp" + + +// REBLUR_SPECULAR +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REBLUR_Specular_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_Specular_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_Specular_PrePass.cs.dxbc.h" + #include "REBLUR_Specular_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Specular_HistoryFix.cs.dxbc.h" + #include "REBLUR_Specular_Blur.cs.dxbc.h" + #include "REBLUR_Specular_PostBlur.cs.dxbc.h" + #include "REBLUR_Specular_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_Specular_CopyStabilizedHistory.cs.dxbc.h" + #include "REBLUR_Specular_TemporalStabilization.cs.dxbc.h" + #include "REBLUR_Specular_SplitScreen.cs.dxbc.h" + + #include "REBLUR_Perf_Specular_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_Perf_Specular_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_Perf_Specular_PrePass.cs.dxbc.h" + #include "REBLUR_Perf_Specular_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Perf_Specular_HistoryFix.cs.dxbc.h" + #include "REBLUR_Perf_Specular_Blur.cs.dxbc.h" + #include "REBLUR_Perf_Specular_PostBlur.cs.dxbc.h" + #include "REBLUR_Perf_Specular_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_Perf_Specular_TemporalStabilization.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REBLUR_Specular_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_Specular_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_Specular_PrePass.cs.dxil.h" + #include "REBLUR_Specular_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Specular_HistoryFix.cs.dxil.h" + #include "REBLUR_Specular_Blur.cs.dxil.h" + #include "REBLUR_Specular_PostBlur.cs.dxil.h" + #include "REBLUR_Specular_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_Specular_CopyStabilizedHistory.cs.dxil.h" + #include "REBLUR_Specular_TemporalStabilization.cs.dxil.h" + #include "REBLUR_Specular_SplitScreen.cs.dxil.h" + + #include "REBLUR_Perf_Specular_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_Perf_Specular_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_Perf_Specular_PrePass.cs.dxil.h" + #include "REBLUR_Perf_Specular_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Perf_Specular_HistoryFix.cs.dxil.h" + #include "REBLUR_Perf_Specular_Blur.cs.dxil.h" + #include "REBLUR_Perf_Specular_PostBlur.cs.dxil.h" + #include "REBLUR_Perf_Specular_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_Perf_Specular_TemporalStabilization.cs.dxil.h" - // REBLUR_SPECULAR - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REBLUR_Specular_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_Specular_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_Specular_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_Specular_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_Specular_PrePass.cs.dxbc.h" - #include "REBLUR_Specular_PrePass.cs.dxil.h" - #include "REBLUR_Specular_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Specular_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Specular_HistoryFix.cs.dxbc.h" - #include "REBLUR_Specular_HistoryFix.cs.dxil.h" - #include "REBLUR_Specular_Blur.cs.dxbc.h" - #include "REBLUR_Specular_Blur.cs.dxil.h" - #include "REBLUR_Specular_PostBlur.cs.dxbc.h" - #include "REBLUR_Specular_PostBlur.cs.dxil.h" - #include "REBLUR_Specular_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Specular_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_Specular_CopyStabilizedHistory.cs.dxbc.h" - #include "REBLUR_Specular_CopyStabilizedHistory.cs.dxil.h" - #include "REBLUR_Specular_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_Specular_TemporalStabilization.cs.dxil.h" - #include "REBLUR_Specular_SplitScreen.cs.dxbc.h" - #include "REBLUR_Specular_SplitScreen.cs.dxil.h" - - #include "REBLUR_Perf_Specular_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_Perf_Specular_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_Perf_Specular_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_Perf_Specular_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_Perf_Specular_PrePass.cs.dxbc.h" - #include "REBLUR_Perf_Specular_PrePass.cs.dxil.h" - #include "REBLUR_Perf_Specular_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Perf_Specular_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Perf_Specular_HistoryFix.cs.dxbc.h" - #include "REBLUR_Perf_Specular_HistoryFix.cs.dxil.h" - #include "REBLUR_Perf_Specular_Blur.cs.dxbc.h" - #include "REBLUR_Perf_Specular_Blur.cs.dxil.h" - #include "REBLUR_Perf_Specular_PostBlur.cs.dxbc.h" - #include "REBLUR_Perf_Specular_PostBlur.cs.dxil.h" - #include "REBLUR_Perf_Specular_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_Specular_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_Perf_Specular_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_Specular_TemporalStabilization.cs.dxil.h" - #endif +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REBLUR_Specular_HitDistReconstruction.cs.spirv.h" #include "REBLUR_Specular_HitDistReconstruction_5x5.cs.spirv.h" #include "REBLUR_Specular_PrePass.cs.spirv.h" @@ -762,36 +798,45 @@ void nrd::InstanceImpl::AddSharedConstants_Reblur(const DenoiserData& denoiserDa #include "REBLUR_Perf_Specular_PostBlur.cs.spirv.h" #include "REBLUR_Perf_Specular_PostBlur_NoTemporalStabilization.cs.spirv.h" #include "REBLUR_Perf_Specular_TemporalStabilization.cs.spirv.h" +#endif + +#include "Denoisers/Reblur_Specular.hpp" + - // REBLUR_SPECULAR_OCCLUSION - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REBLUR_SpecularOcclusion_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_SpecularOcclusion_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_SpecularOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_SpecularOcclusion_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_SpecularOcclusion_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_SpecularOcclusion_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_SpecularOcclusion_HistoryFix.cs.dxbc.h" - #include "REBLUR_SpecularOcclusion_HistoryFix.cs.dxil.h" - #include "REBLUR_SpecularOcclusion_Blur.cs.dxbc.h" - #include "REBLUR_SpecularOcclusion_Blur.cs.dxil.h" - #include "REBLUR_SpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_SpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" - - #include "REBLUR_Perf_SpecularOcclusion_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_Perf_SpecularOcclusion_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_Perf_SpecularOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_Perf_SpecularOcclusion_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_Perf_SpecularOcclusion_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Perf_SpecularOcclusion_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Perf_SpecularOcclusion_HistoryFix.cs.dxbc.h" - #include "REBLUR_Perf_SpecularOcclusion_HistoryFix.cs.dxil.h" - #include "REBLUR_Perf_SpecularOcclusion_Blur.cs.dxbc.h" - #include "REBLUR_Perf_SpecularOcclusion_Blur.cs.dxil.h" - #include "REBLUR_Perf_SpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_SpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" - #endif +// REBLUR_SPECULAR_OCCLUSION +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REBLUR_SpecularOcclusion_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_SpecularOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_SpecularOcclusion_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_SpecularOcclusion_HistoryFix.cs.dxbc.h" + #include "REBLUR_SpecularOcclusion_Blur.cs.dxbc.h" + #include "REBLUR_SpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" + + #include "REBLUR_Perf_SpecularOcclusion_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_Perf_SpecularOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_Perf_SpecularOcclusion_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Perf_SpecularOcclusion_HistoryFix.cs.dxbc.h" + #include "REBLUR_Perf_SpecularOcclusion_Blur.cs.dxbc.h" + #include "REBLUR_Perf_SpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REBLUR_SpecularOcclusion_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_SpecularOcclusion_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_SpecularOcclusion_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_SpecularOcclusion_HistoryFix.cs.dxil.h" + #include "REBLUR_SpecularOcclusion_Blur.cs.dxil.h" + #include "REBLUR_SpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" + + #include "REBLUR_Perf_SpecularOcclusion_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_Perf_SpecularOcclusion_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_Perf_SpecularOcclusion_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Perf_SpecularOcclusion_HistoryFix.cs.dxil.h" + #include "REBLUR_Perf_SpecularOcclusion_Blur.cs.dxil.h" + #include "REBLUR_Perf_SpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REBLUR_SpecularOcclusion_HitDistReconstruction.cs.spirv.h" #include "REBLUR_SpecularOcclusion_HitDistReconstruction_5x5.cs.spirv.h" #include "REBLUR_SpecularOcclusion_TemporalAccumulation.cs.spirv.h" @@ -805,44 +850,53 @@ void nrd::InstanceImpl::AddSharedConstants_Reblur(const DenoiserData& denoiserDa #include "REBLUR_Perf_SpecularOcclusion_HistoryFix.cs.spirv.h" #include "REBLUR_Perf_SpecularOcclusion_Blur.cs.spirv.h" #include "REBLUR_Perf_SpecularOcclusion_PostBlur_NoTemporalStabilization.cs.spirv.h" +#endif + +#include "Denoisers/Reblur_SpecularOcclusion.hpp" + + +// REBLUR_SPECULAR_SH +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REBLUR_SpecularSh_PrePass.cs.dxbc.h" + #include "REBLUR_SpecularSh_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_SpecularSh_HistoryFix.cs.dxbc.h" + #include "REBLUR_SpecularSh_Blur.cs.dxbc.h" + #include "REBLUR_SpecularSh_PostBlur.cs.dxbc.h" + #include "REBLUR_SpecularSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_SpecularSh_CopyStabilizedHistory.cs.dxbc.h" + #include "REBLUR_SpecularSh_TemporalStabilization.cs.dxbc.h" + #include "REBLUR_SpecularSh_SplitScreen.cs.dxbc.h" + + #include "REBLUR_Perf_SpecularSh_PrePass.cs.dxbc.h" + #include "REBLUR_Perf_SpecularSh_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Perf_SpecularSh_HistoryFix.cs.dxbc.h" + #include "REBLUR_Perf_SpecularSh_Blur.cs.dxbc.h" + #include "REBLUR_Perf_SpecularSh_PostBlur.cs.dxbc.h" + #include "REBLUR_Perf_SpecularSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_Perf_SpecularSh_TemporalStabilization.cs.dxbc.h" +#endif - // REBLUR_SPECULAR_SH - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REBLUR_SpecularSh_PrePass.cs.dxbc.h" - #include "REBLUR_SpecularSh_PrePass.cs.dxil.h" - #include "REBLUR_SpecularSh_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_SpecularSh_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_SpecularSh_HistoryFix.cs.dxbc.h" - #include "REBLUR_SpecularSh_HistoryFix.cs.dxil.h" - #include "REBLUR_SpecularSh_Blur.cs.dxbc.h" - #include "REBLUR_SpecularSh_Blur.cs.dxil.h" - #include "REBLUR_SpecularSh_PostBlur.cs.dxbc.h" - #include "REBLUR_SpecularSh_PostBlur.cs.dxil.h" - #include "REBLUR_SpecularSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_SpecularSh_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_SpecularSh_CopyStabilizedHistory.cs.dxbc.h" - #include "REBLUR_SpecularSh_CopyStabilizedHistory.cs.dxil.h" - #include "REBLUR_SpecularSh_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_SpecularSh_TemporalStabilization.cs.dxil.h" - #include "REBLUR_SpecularSh_SplitScreen.cs.dxbc.h" - #include "REBLUR_SpecularSh_SplitScreen.cs.dxil.h" - - #include "REBLUR_Perf_SpecularSh_PrePass.cs.dxbc.h" - #include "REBLUR_Perf_SpecularSh_PrePass.cs.dxil.h" - #include "REBLUR_Perf_SpecularSh_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Perf_SpecularSh_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Perf_SpecularSh_HistoryFix.cs.dxbc.h" - #include "REBLUR_Perf_SpecularSh_HistoryFix.cs.dxil.h" - #include "REBLUR_Perf_SpecularSh_Blur.cs.dxbc.h" - #include "REBLUR_Perf_SpecularSh_Blur.cs.dxil.h" - #include "REBLUR_Perf_SpecularSh_PostBlur.cs.dxbc.h" - #include "REBLUR_Perf_SpecularSh_PostBlur.cs.dxil.h" - #include "REBLUR_Perf_SpecularSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_SpecularSh_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_Perf_SpecularSh_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_SpecularSh_TemporalStabilization.cs.dxil.h" - #endif +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REBLUR_SpecularSh_PrePass.cs.dxil.h" + #include "REBLUR_SpecularSh_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_SpecularSh_HistoryFix.cs.dxil.h" + #include "REBLUR_SpecularSh_Blur.cs.dxil.h" + #include "REBLUR_SpecularSh_PostBlur.cs.dxil.h" + #include "REBLUR_SpecularSh_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_SpecularSh_CopyStabilizedHistory.cs.dxil.h" + #include "REBLUR_SpecularSh_TemporalStabilization.cs.dxil.h" + #include "REBLUR_SpecularSh_SplitScreen.cs.dxil.h" + + #include "REBLUR_Perf_SpecularSh_PrePass.cs.dxil.h" + #include "REBLUR_Perf_SpecularSh_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Perf_SpecularSh_HistoryFix.cs.dxil.h" + #include "REBLUR_Perf_SpecularSh_Blur.cs.dxil.h" + #include "REBLUR_Perf_SpecularSh_PostBlur.cs.dxil.h" + #include "REBLUR_Perf_SpecularSh_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_Perf_SpecularSh_TemporalStabilization.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REBLUR_SpecularSh_PrePass.cs.spirv.h" #include "REBLUR_SpecularSh_TemporalAccumulation.cs.spirv.h" #include "REBLUR_SpecularSh_HistoryFix.cs.spirv.h" @@ -860,52 +914,61 @@ void nrd::InstanceImpl::AddSharedConstants_Reblur(const DenoiserData& denoiserDa #include "REBLUR_Perf_SpecularSh_PostBlur.cs.spirv.h" #include "REBLUR_Perf_SpecularSh_PostBlur_NoTemporalStabilization.cs.spirv.h" #include "REBLUR_Perf_SpecularSh_TemporalStabilization.cs.spirv.h" +#endif + +#include "Denoisers/Reblur_SpecularSh.hpp" - // REBLUR_DIFFUSE_SPECULAR - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REBLUR_DiffuseSpecular_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_DiffuseSpecular_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_DiffuseSpecular_PrePass.cs.dxbc.h" - #include "REBLUR_DiffuseSpecular_PrePass.cs.dxil.h" - #include "REBLUR_DiffuseSpecular_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_DiffuseSpecular_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_DiffuseSpecular_HistoryFix.cs.dxbc.h" - #include "REBLUR_DiffuseSpecular_HistoryFix.cs.dxil.h" - #include "REBLUR_DiffuseSpecular_Blur.cs.dxbc.h" - #include "REBLUR_DiffuseSpecular_Blur.cs.dxil.h" - #include "REBLUR_DiffuseSpecular_CopyStabilizedHistory.cs.dxbc.h" - #include "REBLUR_DiffuseSpecular_CopyStabilizedHistory.cs.dxil.h" - #include "REBLUR_DiffuseSpecular_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_DiffuseSpecular_TemporalStabilization.cs.dxil.h" - #include "REBLUR_DiffuseSpecular_PostBlur.cs.dxbc.h" - #include "REBLUR_DiffuseSpecular_PostBlur.cs.dxil.h" - #include "REBLUR_DiffuseSpecular_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_DiffuseSpecular_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_DiffuseSpecular_SplitScreen.cs.dxbc.h" - #include "REBLUR_DiffuseSpecular_SplitScreen.cs.dxil.h" - - #include "REBLUR_Perf_DiffuseSpecular_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecular_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecular_PrePass.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecular_PrePass.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecular_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecular_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecular_HistoryFix.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecular_HistoryFix.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecular_Blur.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecular_Blur.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecular_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecular_TemporalStabilization.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecular_PostBlur.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecular_PostBlur.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecular_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecular_PostBlur_NoTemporalStabilization.cs.dxil.h" - #endif +// REBLUR_DIFFUSE_SPECULAR +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REBLUR_DiffuseSpecular_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_DiffuseSpecular_PrePass.cs.dxbc.h" + #include "REBLUR_DiffuseSpecular_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_DiffuseSpecular_HistoryFix.cs.dxbc.h" + #include "REBLUR_DiffuseSpecular_Blur.cs.dxbc.h" + #include "REBLUR_DiffuseSpecular_CopyStabilizedHistory.cs.dxbc.h" + #include "REBLUR_DiffuseSpecular_TemporalStabilization.cs.dxbc.h" + #include "REBLUR_DiffuseSpecular_PostBlur.cs.dxbc.h" + #include "REBLUR_DiffuseSpecular_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_DiffuseSpecular_SplitScreen.cs.dxbc.h" + + #include "REBLUR_Perf_DiffuseSpecular_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecular_PrePass.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecular_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecular_HistoryFix.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecular_Blur.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecular_TemporalStabilization.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecular_PostBlur.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecular_PostBlur_NoTemporalStabilization.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REBLUR_DiffuseSpecular_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_DiffuseSpecular_PrePass.cs.dxil.h" + #include "REBLUR_DiffuseSpecular_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_DiffuseSpecular_HistoryFix.cs.dxil.h" + #include "REBLUR_DiffuseSpecular_Blur.cs.dxil.h" + #include "REBLUR_DiffuseSpecular_CopyStabilizedHistory.cs.dxil.h" + #include "REBLUR_DiffuseSpecular_TemporalStabilization.cs.dxil.h" + #include "REBLUR_DiffuseSpecular_PostBlur.cs.dxil.h" + #include "REBLUR_DiffuseSpecular_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_DiffuseSpecular_SplitScreen.cs.dxil.h" + + #include "REBLUR_Perf_DiffuseSpecular_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecular_PrePass.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecular_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecular_HistoryFix.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecular_Blur.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecular_TemporalStabilization.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecular_PostBlur.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecular_PostBlur_NoTemporalStabilization.cs.dxil.h" +#endif + +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REBLUR_DiffuseSpecular_HitDistReconstruction.cs.spirv.h" #include "REBLUR_DiffuseSpecular_HitDistReconstruction_5x5.cs.spirv.h" #include "REBLUR_DiffuseSpecular_PrePass.cs.spirv.h" @@ -927,36 +990,45 @@ void nrd::InstanceImpl::AddSharedConstants_Reblur(const DenoiserData& denoiserDa #include "REBLUR_Perf_DiffuseSpecular_TemporalStabilization.cs.spirv.h" #include "REBLUR_Perf_DiffuseSpecular_PostBlur.cs.spirv.h" #include "REBLUR_Perf_DiffuseSpecular_PostBlur_NoTemporalStabilization.cs.spirv.h" +#endif - // REBLUR_DIFFUSE_SPECULAR_OCCLUSION - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REBLUR_DiffuseSpecularOcclusion_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularOcclusion_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_DiffuseSpecularOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularOcclusion_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_DiffuseSpecularOcclusion_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularOcclusion_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_DiffuseSpecularOcclusion_HistoryFix.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularOcclusion_HistoryFix.cs.dxil.h" - #include "REBLUR_DiffuseSpecularOcclusion_Blur.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularOcclusion_Blur.cs.dxil.h" - #include "REBLUR_DiffuseSpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" - - #include "REBLUR_Perf_DiffuseSpecularOcclusion_HitDistReconstruction.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularOcclusion_HitDistReconstruction.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecularOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularOcclusion_HitDistReconstruction_5x5.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecularOcclusion_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularOcclusion_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecularOcclusion_HistoryFix.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularOcclusion_HistoryFix.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecularOcclusion_Blur.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularOcclusion_Blur.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" - #endif +#include "Denoisers/Reblur_DiffuseSpecular.hpp" + + +// REBLUR_DIFFUSE_SPECULAR_OCCLUSION +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REBLUR_DiffuseSpecularOcclusion_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularOcclusion_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularOcclusion_HistoryFix.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularOcclusion_Blur.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" + + #include "REBLUR_Perf_DiffuseSpecularOcclusion_HitDistReconstruction.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecularOcclusion_HitDistReconstruction_5x5.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecularOcclusion_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecularOcclusion_HistoryFix.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecularOcclusion_Blur.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REBLUR_DiffuseSpecularOcclusion_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_DiffuseSpecularOcclusion_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_DiffuseSpecularOcclusion_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_DiffuseSpecularOcclusion_HistoryFix.cs.dxil.h" + #include "REBLUR_DiffuseSpecularOcclusion_Blur.cs.dxil.h" + #include "REBLUR_DiffuseSpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" + + #include "REBLUR_Perf_DiffuseSpecularOcclusion_HitDistReconstruction.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecularOcclusion_HitDistReconstruction_5x5.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecularOcclusion_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecularOcclusion_HistoryFix.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecularOcclusion_Blur.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecularOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REBLUR_DiffuseSpecularOcclusion_HitDistReconstruction.cs.spirv.h" #include "REBLUR_DiffuseSpecularOcclusion_HitDistReconstruction_5x5.cs.spirv.h" #include "REBLUR_DiffuseSpecularOcclusion_TemporalAccumulation.cs.spirv.h" @@ -970,44 +1042,53 @@ void nrd::InstanceImpl::AddSharedConstants_Reblur(const DenoiserData& denoiserDa #include "REBLUR_Perf_DiffuseSpecularOcclusion_HistoryFix.cs.spirv.h" #include "REBLUR_Perf_DiffuseSpecularOcclusion_Blur.cs.spirv.h" #include "REBLUR_Perf_DiffuseSpecularOcclusion_PostBlur_NoTemporalStabilization.cs.spirv.h" +#endif + +#include "Denoisers/Reblur_DiffuseSpecularOcclusion.hpp" + - // REBLUR_DIFFUSE_SPECULAR_SH - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REBLUR_DiffuseSpecularSh_PrePass.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularSh_PrePass.cs.dxil.h" - #include "REBLUR_DiffuseSpecularSh_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularSh_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_DiffuseSpecularSh_HistoryFix.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularSh_HistoryFix.cs.dxil.h" - #include "REBLUR_DiffuseSpecularSh_Blur.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularSh_Blur.cs.dxil.h" - #include "REBLUR_DiffuseSpecularSh_CopyStabilizedHistory.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularSh_CopyStabilizedHistory.cs.dxil.h" - #include "REBLUR_DiffuseSpecularSh_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularSh_TemporalStabilization.cs.dxil.h" - #include "REBLUR_DiffuseSpecularSh_PostBlur.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularSh_PostBlur.cs.dxil.h" - #include "REBLUR_DiffuseSpecularSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularSh_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_DiffuseSpecularSh_SplitScreen.cs.dxbc.h" - #include "REBLUR_DiffuseSpecularSh_SplitScreen.cs.dxil.h" - - #include "REBLUR_Perf_DiffuseSpecularSh_PrePass.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularSh_PrePass.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecularSh_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularSh_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecularSh_HistoryFix.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularSh_HistoryFix.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecularSh_Blur.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularSh_Blur.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecularSh_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularSh_TemporalStabilization.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecularSh_PostBlur.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularSh_PostBlur.cs.dxil.h" - #include "REBLUR_Perf_DiffuseSpecularSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseSpecularSh_PostBlur_NoTemporalStabilization.cs.dxil.h" - #endif +// REBLUR_DIFFUSE_SPECULAR_SH +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REBLUR_DiffuseSpecularSh_PrePass.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularSh_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularSh_HistoryFix.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularSh_Blur.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularSh_CopyStabilizedHistory.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularSh_TemporalStabilization.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularSh_PostBlur.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_DiffuseSpecularSh_SplitScreen.cs.dxbc.h" + + #include "REBLUR_Perf_DiffuseSpecularSh_PrePass.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecularSh_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecularSh_HistoryFix.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecularSh_Blur.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecularSh_TemporalStabilization.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecularSh_PostBlur.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseSpecularSh_PostBlur_NoTemporalStabilization.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REBLUR_DiffuseSpecularSh_PrePass.cs.dxil.h" + #include "REBLUR_DiffuseSpecularSh_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_DiffuseSpecularSh_HistoryFix.cs.dxil.h" + #include "REBLUR_DiffuseSpecularSh_Blur.cs.dxil.h" + #include "REBLUR_DiffuseSpecularSh_CopyStabilizedHistory.cs.dxil.h" + #include "REBLUR_DiffuseSpecularSh_TemporalStabilization.cs.dxil.h" + #include "REBLUR_DiffuseSpecularSh_PostBlur.cs.dxil.h" + #include "REBLUR_DiffuseSpecularSh_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_DiffuseSpecularSh_SplitScreen.cs.dxil.h" + + #include "REBLUR_Perf_DiffuseSpecularSh_PrePass.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecularSh_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecularSh_HistoryFix.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecularSh_Blur.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecularSh_TemporalStabilization.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecularSh_PostBlur.cs.dxil.h" + #include "REBLUR_Perf_DiffuseSpecularSh_PostBlur_NoTemporalStabilization.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REBLUR_DiffuseSpecularSh_PrePass.cs.spirv.h" #include "REBLUR_DiffuseSpecularSh_TemporalAccumulation.cs.spirv.h" #include "REBLUR_DiffuseSpecularSh_HistoryFix.cs.spirv.h" @@ -1025,40 +1106,49 @@ void nrd::InstanceImpl::AddSharedConstants_Reblur(const DenoiserData& denoiserDa #include "REBLUR_Perf_DiffuseSpecularSh_TemporalStabilization.cs.spirv.h" #include "REBLUR_Perf_DiffuseSpecularSh_PostBlur.cs.spirv.h" #include "REBLUR_Perf_DiffuseSpecularSh_PostBlur_NoTemporalStabilization.cs.spirv.h" +#endif + +#include "Denoisers/Reblur_DiffuseSpecularSh.hpp" + - // REBLUR_DIFFUSE_DIRECTIONAL_OCCLUSION - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "REBLUR_DiffuseDirectionalOcclusion_PrePass.cs.dxbc.h" - #include "REBLUR_DiffuseDirectionalOcclusion_PrePass.cs.dxil.h" - #include "REBLUR_DiffuseDirectionalOcclusion_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_DiffuseDirectionalOcclusion_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_DiffuseDirectionalOcclusion_HistoryFix.cs.dxbc.h" - #include "REBLUR_DiffuseDirectionalOcclusion_HistoryFix.cs.dxil.h" - #include "REBLUR_DiffuseDirectionalOcclusion_Blur.cs.dxbc.h" - #include "REBLUR_DiffuseDirectionalOcclusion_Blur.cs.dxil.h" - #include "REBLUR_DiffuseDirectionalOcclusion_PostBlur.cs.dxbc.h" - #include "REBLUR_DiffuseDirectionalOcclusion_PostBlur.cs.dxil.h" - #include "REBLUR_DiffuseDirectionalOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_DiffuseDirectionalOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_DiffuseDirectionalOcclusion_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_DiffuseDirectionalOcclusion_TemporalStabilization.cs.dxil.h" - - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PrePass.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PrePass.cs.dxil.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_TemporalAccumulation.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_TemporalAccumulation.cs.dxil.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_HistoryFix.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_HistoryFix.cs.dxil.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_Blur.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_Blur.cs.dxil.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PostBlur.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PostBlur.cs.dxil.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_TemporalStabilization.cs.dxbc.h" - #include "REBLUR_Perf_DiffuseDirectionalOcclusion_TemporalStabilization.cs.dxil.h" - #endif +// REBLUR_DIFFUSE_DIRECTIONAL_OCCLUSION +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "REBLUR_DiffuseDirectionalOcclusion_PrePass.cs.dxbc.h" + #include "REBLUR_DiffuseDirectionalOcclusion_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_DiffuseDirectionalOcclusion_HistoryFix.cs.dxbc.h" + #include "REBLUR_DiffuseDirectionalOcclusion_Blur.cs.dxbc.h" + #include "REBLUR_DiffuseDirectionalOcclusion_PostBlur.cs.dxbc.h" + #include "REBLUR_DiffuseDirectionalOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_DiffuseDirectionalOcclusion_TemporalStabilization.cs.dxbc.h" + + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PrePass.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_TemporalAccumulation.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_HistoryFix.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_Blur.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PostBlur.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PostBlur_NoTemporalStabilization.cs.dxbc.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_TemporalStabilization.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "REBLUR_DiffuseDirectionalOcclusion_PrePass.cs.dxil.h" + #include "REBLUR_DiffuseDirectionalOcclusion_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_DiffuseDirectionalOcclusion_HistoryFix.cs.dxil.h" + #include "REBLUR_DiffuseDirectionalOcclusion_Blur.cs.dxil.h" + #include "REBLUR_DiffuseDirectionalOcclusion_PostBlur.cs.dxil.h" + #include "REBLUR_DiffuseDirectionalOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_DiffuseDirectionalOcclusion_TemporalStabilization.cs.dxil.h" + + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PrePass.cs.dxil.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_TemporalAccumulation.cs.dxil.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_HistoryFix.cs.dxil.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_Blur.cs.dxil.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PostBlur.cs.dxil.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PostBlur_NoTemporalStabilization.cs.dxil.h" + #include "REBLUR_Perf_DiffuseDirectionalOcclusion_TemporalStabilization.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "REBLUR_DiffuseDirectionalOcclusion_PrePass.cs.spirv.h" #include "REBLUR_DiffuseDirectionalOcclusion_TemporalAccumulation.cs.spirv.h" #include "REBLUR_DiffuseDirectionalOcclusion_HistoryFix.cs.spirv.h" @@ -1074,16 +1164,6 @@ void nrd::InstanceImpl::AddSharedConstants_Reblur(const DenoiserData& denoiserDa #include "REBLUR_Perf_DiffuseDirectionalOcclusion_TemporalStabilization.cs.spirv.h" #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PostBlur.cs.spirv.h" #include "REBLUR_Perf_DiffuseDirectionalOcclusion_PostBlur_NoTemporalStabilization.cs.spirv.h" - #endif -#include "Denoisers/Reblur_Diffuse.hpp" -#include "Denoisers/Reblur_DiffuseOcclusion.hpp" -#include "Denoisers/Reblur_DiffuseSh.hpp" -#include "Denoisers/Reblur_Specular.hpp" -#include "Denoisers/Reblur_SpecularOcclusion.hpp" -#include "Denoisers/Reblur_SpecularSh.hpp" -#include "Denoisers/Reblur_DiffuseSpecular.hpp" -#include "Denoisers/Reblur_DiffuseSpecularOcclusion.hpp" -#include "Denoisers/Reblur_DiffuseSpecularSh.hpp" #include "Denoisers/Reblur_DiffuseDirectionalOcclusion.hpp" diff --git a/Source/Relax.cpp b/Source/Relax.cpp index e8eb5cb..abc9cc4 100644 --- a/Source/Relax.cpp +++ b/Source/Relax.cpp @@ -128,42 +128,49 @@ void nrd::InstanceImpl::AddSharedConstants_Relax(const DenoiserData& denoiserDat AddUint(data, 0); } -#ifdef NRD_USE_PRECOMPILED_SHADERS +// RELAX_SHARED +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "RELAX_ClassifyTiles.cs.dxbc.h" +#endif - // RELAX_SHARED - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "RELAX_ClassifyTiles.cs.dxbc.h" - #include "RELAX_ClassifyTiles.cs.dxil.h" - #endif +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "RELAX_ClassifyTiles.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "RELAX_ClassifyTiles.cs.spirv.h" +#endif - // RELAX_DIFFUSE - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "RELAX_Diffuse_HitDistReconstruction.cs.dxbc.h" - #include "RELAX_Diffuse_HitDistReconstruction.cs.dxil.h" - #include "RELAX_Diffuse_HitDistReconstruction_5x5.cs.dxbc.h" - #include "RELAX_Diffuse_HitDistReconstruction_5x5.cs.dxil.h" - #include "RELAX_Diffuse_PrePass.cs.dxbc.h" - #include "RELAX_Diffuse_PrePass.cs.dxil.h" - #include "RELAX_Diffuse_TemporalAccumulation.cs.dxbc.h" - #include "RELAX_Diffuse_TemporalAccumulation.cs.dxil.h" - #include "RELAX_Diffuse_HistoryFix.cs.dxbc.h" - #include "RELAX_Diffuse_HistoryFix.cs.dxil.h" - #include "RELAX_Diffuse_HistoryClamping.cs.dxbc.h" - #include "RELAX_Diffuse_HistoryClamping.cs.dxil.h" - #include "RELAX_Diffuse_AntiFirefly.cs.dxbc.h" - #include "RELAX_Diffuse_AntiFirefly.cs.dxil.h" - #include "RELAX_Diffuse_AtrousSmem.cs.dxbc.h" - #include "RELAX_Diffuse_AtrousSmem.cs.dxil.h" - #include "RELAX_Diffuse_Atrous.cs.dxbc.h" - #include "RELAX_Diffuse_Atrous.cs.dxil.h" - #include "RELAX_Diffuse_SplitScreen.cs.dxbc.h" - #include "RELAX_Diffuse_SplitScreen.cs.dxil.h" - #include "RELAX_Validation.cs.dxbc.h" - #include "RELAX_Validation.cs.dxil.h" - #endif +// RELAX_DIFFUSE +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "RELAX_Diffuse_HitDistReconstruction.cs.dxbc.h" + #include "RELAX_Diffuse_HitDistReconstruction_5x5.cs.dxbc.h" + #include "RELAX_Diffuse_PrePass.cs.dxbc.h" + #include "RELAX_Diffuse_TemporalAccumulation.cs.dxbc.h" + #include "RELAX_Diffuse_HistoryFix.cs.dxbc.h" + #include "RELAX_Diffuse_HistoryClamping.cs.dxbc.h" + #include "RELAX_Diffuse_AntiFirefly.cs.dxbc.h" + #include "RELAX_Diffuse_AtrousSmem.cs.dxbc.h" + #include "RELAX_Diffuse_Atrous.cs.dxbc.h" + #include "RELAX_Diffuse_SplitScreen.cs.dxbc.h" + #include "RELAX_Validation.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "RELAX_Diffuse_HitDistReconstruction.cs.dxil.h" + #include "RELAX_Diffuse_HitDistReconstruction_5x5.cs.dxil.h" + #include "RELAX_Diffuse_PrePass.cs.dxil.h" + #include "RELAX_Diffuse_TemporalAccumulation.cs.dxil.h" + #include "RELAX_Diffuse_HistoryFix.cs.dxil.h" + #include "RELAX_Diffuse_HistoryClamping.cs.dxil.h" + #include "RELAX_Diffuse_AntiFirefly.cs.dxil.h" + #include "RELAX_Diffuse_AtrousSmem.cs.dxil.h" + #include "RELAX_Diffuse_Atrous.cs.dxil.h" + #include "RELAX_Diffuse_SplitScreen.cs.dxil.h" + #include "RELAX_Validation.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "RELAX_Diffuse_HitDistReconstruction.cs.spirv.h" #include "RELAX_Diffuse_HitDistReconstruction_5x5.cs.spirv.h" #include "RELAX_Diffuse_PrePass.cs.spirv.h" @@ -175,27 +182,35 @@ void nrd::InstanceImpl::AddSharedConstants_Relax(const DenoiserData& denoiserDat #include "RELAX_Diffuse_Atrous.cs.spirv.h" #include "RELAX_Diffuse_SplitScreen.cs.spirv.h" #include "RELAX_Validation.cs.spirv.h" +#endif + +#include "Denoisers/Relax_Diffuse.hpp" + + +// RELAX_DIFFUSE_SH +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "RELAX_DiffuseSh_PrePass.cs.dxbc.h" + #include "RELAX_DiffuseSh_TemporalAccumulation.cs.dxbc.h" + #include "RELAX_DiffuseSh_HistoryFix.cs.dxbc.h" + #include "RELAX_DiffuseSh_HistoryClamping.cs.dxbc.h" + #include "RELAX_DiffuseSh_AntiFirefly.cs.dxbc.h" + #include "RELAX_DiffuseSh_AtrousSmem.cs.dxbc.h" + #include "RELAX_DiffuseSh_Atrous.cs.dxbc.h" + #include "RELAX_DiffuseSh_SplitScreen.cs.dxbc.h" +#endif - // RELAX_DIFFUSE_SH - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "RELAX_DiffuseSh_PrePass.cs.dxbc.h" - #include "RELAX_DiffuseSh_PrePass.cs.dxil.h" - #include "RELAX_DiffuseSh_TemporalAccumulation.cs.dxbc.h" - #include "RELAX_DiffuseSh_TemporalAccumulation.cs.dxil.h" - #include "RELAX_DiffuseSh_HistoryFix.cs.dxbc.h" - #include "RELAX_DiffuseSh_HistoryFix.cs.dxil.h" - #include "RELAX_DiffuseSh_HistoryClamping.cs.dxbc.h" - #include "RELAX_DiffuseSh_HistoryClamping.cs.dxil.h" - #include "RELAX_DiffuseSh_AntiFirefly.cs.dxbc.h" - #include "RELAX_DiffuseSh_AntiFirefly.cs.dxil.h" - #include "RELAX_DiffuseSh_AtrousSmem.cs.dxbc.h" - #include "RELAX_DiffuseSh_AtrousSmem.cs.dxil.h" - #include "RELAX_DiffuseSh_Atrous.cs.dxbc.h" - #include "RELAX_DiffuseSh_Atrous.cs.dxil.h" - #include "RELAX_DiffuseSh_SplitScreen.cs.dxbc.h" - #include "RELAX_DiffuseSh_SplitScreen.cs.dxil.h" - #endif +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "RELAX_DiffuseSh_PrePass.cs.dxil.h" + #include "RELAX_DiffuseSh_TemporalAccumulation.cs.dxil.h" + #include "RELAX_DiffuseSh_HistoryFix.cs.dxil.h" + #include "RELAX_DiffuseSh_HistoryClamping.cs.dxil.h" + #include "RELAX_DiffuseSh_AntiFirefly.cs.dxil.h" + #include "RELAX_DiffuseSh_AtrousSmem.cs.dxil.h" + #include "RELAX_DiffuseSh_Atrous.cs.dxil.h" + #include "RELAX_DiffuseSh_SplitScreen.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "RELAX_DiffuseSh_PrePass.cs.spirv.h" #include "RELAX_DiffuseSh_TemporalAccumulation.cs.spirv.h" #include "RELAX_DiffuseSh_HistoryFix.cs.spirv.h" @@ -204,31 +219,39 @@ void nrd::InstanceImpl::AddSharedConstants_Relax(const DenoiserData& denoiserDat #include "RELAX_DiffuseSh_AtrousSmem.cs.spirv.h" #include "RELAX_DiffuseSh_Atrous.cs.spirv.h" #include "RELAX_DiffuseSh_SplitScreen.cs.spirv.h" +#endif + +#include "Denoisers/Relax_DiffuseSh.hpp" + + +// RELAX_SPECULAR +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "RELAX_Specular_HitDistReconstruction.cs.dxbc.h" + #include "RELAX_Specular_HitDistReconstruction_5x5.cs.dxbc.h" + #include "RELAX_Specular_PrePass.cs.dxbc.h" + #include "RELAX_Specular_TemporalAccumulation.cs.dxbc.h" + #include "RELAX_Specular_HistoryFix.cs.dxbc.h" + #include "RELAX_Specular_HistoryClamping.cs.dxbc.h" + #include "RELAX_Specular_AntiFirefly.cs.dxbc.h" + #include "RELAX_Specular_AtrousSmem.cs.dxbc.h" + #include "RELAX_Specular_Atrous.cs.dxbc.h" + #include "RELAX_Specular_SplitScreen.cs.dxbc.h" +#endif - // RELAX_SPECULAR - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "RELAX_Specular_HitDistReconstruction.cs.dxbc.h" - #include "RELAX_Specular_HitDistReconstruction.cs.dxil.h" - #include "RELAX_Specular_HitDistReconstruction_5x5.cs.dxbc.h" - #include "RELAX_Specular_HitDistReconstruction_5x5.cs.dxil.h" - #include "RELAX_Specular_PrePass.cs.dxbc.h" - #include "RELAX_Specular_PrePass.cs.dxil.h" - #include "RELAX_Specular_TemporalAccumulation.cs.dxbc.h" - #include "RELAX_Specular_TemporalAccumulation.cs.dxil.h" - #include "RELAX_Specular_HistoryFix.cs.dxbc.h" - #include "RELAX_Specular_HistoryFix.cs.dxil.h" - #include "RELAX_Specular_HistoryClamping.cs.dxbc.h" - #include "RELAX_Specular_HistoryClamping.cs.dxil.h" - #include "RELAX_Specular_AntiFirefly.cs.dxbc.h" - #include "RELAX_Specular_AntiFirefly.cs.dxil.h" - #include "RELAX_Specular_AtrousSmem.cs.dxbc.h" - #include "RELAX_Specular_AtrousSmem.cs.dxil.h" - #include "RELAX_Specular_Atrous.cs.dxbc.h" - #include "RELAX_Specular_Atrous.cs.dxil.h" - #include "RELAX_Specular_SplitScreen.cs.dxbc.h" - #include "RELAX_Specular_SplitScreen.cs.dxil.h" - #endif +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "RELAX_Specular_HitDistReconstruction.cs.dxil.h" + #include "RELAX_Specular_HitDistReconstruction_5x5.cs.dxil.h" + #include "RELAX_Specular_PrePass.cs.dxil.h" + #include "RELAX_Specular_TemporalAccumulation.cs.dxil.h" + #include "RELAX_Specular_HistoryFix.cs.dxil.h" + #include "RELAX_Specular_HistoryClamping.cs.dxil.h" + #include "RELAX_Specular_AntiFirefly.cs.dxil.h" + #include "RELAX_Specular_AtrousSmem.cs.dxil.h" + #include "RELAX_Specular_Atrous.cs.dxil.h" + #include "RELAX_Specular_SplitScreen.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "RELAX_Specular_HitDistReconstruction.cs.spirv.h" #include "RELAX_Specular_HitDistReconstruction_5x5.cs.spirv.h" #include "RELAX_Specular_PrePass.cs.spirv.h" @@ -239,27 +262,35 @@ void nrd::InstanceImpl::AddSharedConstants_Relax(const DenoiserData& denoiserDat #include "RELAX_Specular_AtrousSmem.cs.spirv.h" #include "RELAX_Specular_Atrous.cs.spirv.h" #include "RELAX_Specular_SplitScreen.cs.spirv.h" +#endif + +#include "Denoisers/Relax_Specular.hpp" - // RELAX_SPECULAR_SH - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "RELAX_SpecularSh_PrePass.cs.dxbc.h" - #include "RELAX_SpecularSh_PrePass.cs.dxil.h" - #include "RELAX_SpecularSh_TemporalAccumulation.cs.dxbc.h" - #include "RELAX_SpecularSh_TemporalAccumulation.cs.dxil.h" - #include "RELAX_SpecularSh_HistoryFix.cs.dxbc.h" - #include "RELAX_SpecularSh_HistoryFix.cs.dxil.h" - #include "RELAX_SpecularSh_HistoryClamping.cs.dxbc.h" - #include "RELAX_SpecularSh_HistoryClamping.cs.dxil.h" - #include "RELAX_SpecularSh_AntiFirefly.cs.dxbc.h" - #include "RELAX_SpecularSh_AntiFirefly.cs.dxil.h" - #include "RELAX_SpecularSh_AtrousSmem.cs.dxbc.h" - #include "RELAX_SpecularSh_AtrousSmem.cs.dxil.h" - #include "RELAX_SpecularSh_Atrous.cs.dxbc.h" - #include "RELAX_SpecularSh_Atrous.cs.dxil.h" - #include "RELAX_SpecularSh_SplitScreen.cs.dxbc.h" - #include "RELAX_SpecularSh_SplitScreen.cs.dxil.h" - #endif +// RELAX_SPECULAR_SH +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "RELAX_SpecularSh_PrePass.cs.dxbc.h" + #include "RELAX_SpecularSh_TemporalAccumulation.cs.dxbc.h" + #include "RELAX_SpecularSh_HistoryFix.cs.dxbc.h" + #include "RELAX_SpecularSh_HistoryClamping.cs.dxbc.h" + #include "RELAX_SpecularSh_AntiFirefly.cs.dxbc.h" + #include "RELAX_SpecularSh_AtrousSmem.cs.dxbc.h" + #include "RELAX_SpecularSh_Atrous.cs.dxbc.h" + #include "RELAX_SpecularSh_SplitScreen.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "RELAX_SpecularSh_PrePass.cs.dxil.h" + #include "RELAX_SpecularSh_TemporalAccumulation.cs.dxil.h" + #include "RELAX_SpecularSh_HistoryFix.cs.dxil.h" + #include "RELAX_SpecularSh_HistoryClamping.cs.dxil.h" + #include "RELAX_SpecularSh_AntiFirefly.cs.dxil.h" + #include "RELAX_SpecularSh_AtrousSmem.cs.dxil.h" + #include "RELAX_SpecularSh_Atrous.cs.dxil.h" + #include "RELAX_SpecularSh_SplitScreen.cs.dxil.h" +#endif + +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "RELAX_SpecularSh_PrePass.cs.spirv.h" #include "RELAX_SpecularSh_TemporalAccumulation.cs.spirv.h" #include "RELAX_SpecularSh_HistoryFix.cs.spirv.h" @@ -268,31 +299,39 @@ void nrd::InstanceImpl::AddSharedConstants_Relax(const DenoiserData& denoiserDat #include "RELAX_SpecularSh_AtrousSmem.cs.spirv.h" #include "RELAX_SpecularSh_Atrous.cs.spirv.h" #include "RELAX_SpecularSh_SplitScreen.cs.spirv.h" +#endif + +#include "Denoisers/Relax_SpecularSh.hpp" - // RELAX_DIFFUSE_SPECULAR - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "RELAX_DiffuseSpecular_HitDistReconstruction.cs.dxbc.h" - #include "RELAX_DiffuseSpecular_HitDistReconstruction.cs.dxil.h" - #include "RELAX_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxbc.h" - #include "RELAX_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxil.h" - #include "RELAX_DiffuseSpecular_PrePass.cs.dxbc.h" - #include "RELAX_DiffuseSpecular_PrePass.cs.dxil.h" - #include "RELAX_DiffuseSpecular_TemporalAccumulation.cs.dxbc.h" - #include "RELAX_DiffuseSpecular_TemporalAccumulation.cs.dxil.h" - #include "RELAX_DiffuseSpecular_HistoryFix.cs.dxbc.h" - #include "RELAX_DiffuseSpecular_HistoryFix.cs.dxil.h" - #include "RELAX_DiffuseSpecular_HistoryClamping.cs.dxbc.h" - #include "RELAX_DiffuseSpecular_HistoryClamping.cs.dxil.h" - #include "RELAX_DiffuseSpecular_AntiFirefly.cs.dxbc.h" - #include "RELAX_DiffuseSpecular_AntiFirefly.cs.dxil.h" - #include "RELAX_DiffuseSpecular_AtrousSmem.cs.dxbc.h" - #include "RELAX_DiffuseSpecular_AtrousSmem.cs.dxil.h" - #include "RELAX_DiffuseSpecular_Atrous.cs.dxbc.h" - #include "RELAX_DiffuseSpecular_Atrous.cs.dxil.h" - #include "RELAX_DiffuseSpecular_SplitScreen.cs.dxbc.h" - #include "RELAX_DiffuseSpecular_SplitScreen.cs.dxil.h" - #endif +// RELAX_DIFFUSE_SPECULAR +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "RELAX_DiffuseSpecular_HitDistReconstruction.cs.dxbc.h" + #include "RELAX_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxbc.h" + #include "RELAX_DiffuseSpecular_PrePass.cs.dxbc.h" + #include "RELAX_DiffuseSpecular_TemporalAccumulation.cs.dxbc.h" + #include "RELAX_DiffuseSpecular_HistoryFix.cs.dxbc.h" + #include "RELAX_DiffuseSpecular_HistoryClamping.cs.dxbc.h" + #include "RELAX_DiffuseSpecular_AntiFirefly.cs.dxbc.h" + #include "RELAX_DiffuseSpecular_AtrousSmem.cs.dxbc.h" + #include "RELAX_DiffuseSpecular_Atrous.cs.dxbc.h" + #include "RELAX_DiffuseSpecular_SplitScreen.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "RELAX_DiffuseSpecular_HitDistReconstruction.cs.dxil.h" + #include "RELAX_DiffuseSpecular_HitDistReconstruction_5x5.cs.dxil.h" + #include "RELAX_DiffuseSpecular_PrePass.cs.dxil.h" + #include "RELAX_DiffuseSpecular_TemporalAccumulation.cs.dxil.h" + #include "RELAX_DiffuseSpecular_HistoryFix.cs.dxil.h" + #include "RELAX_DiffuseSpecular_HistoryClamping.cs.dxil.h" + #include "RELAX_DiffuseSpecular_AntiFirefly.cs.dxil.h" + #include "RELAX_DiffuseSpecular_AtrousSmem.cs.dxil.h" + #include "RELAX_DiffuseSpecular_Atrous.cs.dxil.h" + #include "RELAX_DiffuseSpecular_SplitScreen.cs.dxil.h" +#endif + +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "RELAX_DiffuseSpecular_HitDistReconstruction.cs.spirv.h" #include "RELAX_DiffuseSpecular_HitDistReconstruction_5x5.cs.spirv.h" #include "RELAX_DiffuseSpecular_PrePass.cs.spirv.h" @@ -303,27 +342,35 @@ void nrd::InstanceImpl::AddSharedConstants_Relax(const DenoiserData& denoiserDat #include "RELAX_DiffuseSpecular_AtrousSmem.cs.spirv.h" #include "RELAX_DiffuseSpecular_Atrous.cs.spirv.h" #include "RELAX_DiffuseSpecular_SplitScreen.cs.spirv.h" +#endif - // RELAX_DIFFUSE_SPECULAR_SH - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "RELAX_DiffuseSpecularSh_PrePass.cs.dxbc.h" - #include "RELAX_DiffuseSpecularSh_PrePass.cs.dxil.h" - #include "RELAX_DiffuseSpecularSh_TemporalAccumulation.cs.dxbc.h" - #include "RELAX_DiffuseSpecularSh_TemporalAccumulation.cs.dxil.h" - #include "RELAX_DiffuseSpecularSh_HistoryFix.cs.dxbc.h" - #include "RELAX_DiffuseSpecularSh_HistoryFix.cs.dxil.h" - #include "RELAX_DiffuseSpecularSh_HistoryClamping.cs.dxbc.h" - #include "RELAX_DiffuseSpecularSh_HistoryClamping.cs.dxil.h" - #include "RELAX_DiffuseSpecularSh_AntiFirefly.cs.dxbc.h" - #include "RELAX_DiffuseSpecularSh_AntiFirefly.cs.dxil.h" - #include "RELAX_DiffuseSpecularSh_AtrousSmem.cs.dxbc.h" - #include "RELAX_DiffuseSpecularSh_AtrousSmem.cs.dxil.h" - #include "RELAX_DiffuseSpecularSh_Atrous.cs.dxbc.h" - #include "RELAX_DiffuseSpecularSh_Atrous.cs.dxil.h" - #include "RELAX_DiffuseSpecularSh_SplitScreen.cs.dxbc.h" - #include "RELAX_DiffuseSpecularSh_SplitScreen.cs.dxil.h" - #endif +#include "Denoisers/Relax_DiffuseSpecular.hpp" + +// RELAX_DIFFUSE_SPECULAR_SH +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "RELAX_DiffuseSpecularSh_PrePass.cs.dxbc.h" + #include "RELAX_DiffuseSpecularSh_TemporalAccumulation.cs.dxbc.h" + #include "RELAX_DiffuseSpecularSh_HistoryFix.cs.dxbc.h" + #include "RELAX_DiffuseSpecularSh_HistoryClamping.cs.dxbc.h" + #include "RELAX_DiffuseSpecularSh_AntiFirefly.cs.dxbc.h" + #include "RELAX_DiffuseSpecularSh_AtrousSmem.cs.dxbc.h" + #include "RELAX_DiffuseSpecularSh_Atrous.cs.dxbc.h" + #include "RELAX_DiffuseSpecularSh_SplitScreen.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "RELAX_DiffuseSpecularSh_PrePass.cs.dxil.h" + #include "RELAX_DiffuseSpecularSh_TemporalAccumulation.cs.dxil.h" + #include "RELAX_DiffuseSpecularSh_HistoryFix.cs.dxil.h" + #include "RELAX_DiffuseSpecularSh_HistoryClamping.cs.dxil.h" + #include "RELAX_DiffuseSpecularSh_AntiFirefly.cs.dxil.h" + #include "RELAX_DiffuseSpecularSh_AtrousSmem.cs.dxil.h" + #include "RELAX_DiffuseSpecularSh_Atrous.cs.dxil.h" + #include "RELAX_DiffuseSpecularSh_SplitScreen.cs.dxil.h" +#endif + +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "RELAX_DiffuseSpecularSh_PrePass.cs.spirv.h" #include "RELAX_DiffuseSpecularSh_TemporalAccumulation.cs.spirv.h" #include "RELAX_DiffuseSpecularSh_HistoryFix.cs.spirv.h" @@ -332,12 +379,6 @@ void nrd::InstanceImpl::AddSharedConstants_Relax(const DenoiserData& denoiserDat #include "RELAX_DiffuseSpecularSh_AtrousSmem.cs.spirv.h" #include "RELAX_DiffuseSpecularSh_Atrous.cs.spirv.h" #include "RELAX_DiffuseSpecularSh_SplitScreen.cs.spirv.h" - #endif -#include "Denoisers/Relax_Diffuse.hpp" -#include "Denoisers/Relax_DiffuseSh.hpp" -#include "Denoisers/Relax_Specular.hpp" -#include "Denoisers/Relax_SpecularSh.hpp" -#include "Denoisers/Relax_DiffuseSpecular.hpp" #include "Denoisers/Relax_DiffuseSpecularSh.hpp" diff --git a/Source/Sigma.cpp b/Source/Sigma.cpp index 51eca7d..faf6e6d 100644 --- a/Source/Sigma.cpp +++ b/Source/Sigma.cpp @@ -65,7 +65,7 @@ void nrd::InstanceImpl::Update_SigmaShadow(const DenoiserData& denoiserData) // SMOOTH_TILES data = PushDispatch(denoiserData, AsUint(Dispatch::SMOOTH_TILES)); AddSharedConstants_Sigma(denoiserData, settings, data); - AddUint2(data, tilesW, tilesH); + AddUint2(data, tilesW - 1, tilesH - 1); ValidateConstants(data); // BLUR @@ -134,52 +134,60 @@ void nrd::InstanceImpl::AddSharedConstants_Sigma(const DenoiserData& denoiserDat AddUint(data, m_CommonSettings.frameIndex); } -#ifdef NRD_USE_PRECOMPILED_SHADERS - - // SIGMA_SHADOW - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "SIGMA_Shadow_ClassifyTiles.cs.dxbc.h" - #include "SIGMA_Shadow_ClassifyTiles.cs.dxil.h" - #include "SIGMA_Shadow_SmoothTiles.cs.dxbc.h" - #include "SIGMA_Shadow_SmoothTiles.cs.dxil.h" - #include "SIGMA_Shadow_Blur.cs.dxbc.h" - #include "SIGMA_Shadow_Blur.cs.dxil.h" - #include "SIGMA_Shadow_PostBlur.cs.dxbc.h" - #include "SIGMA_Shadow_PostBlur.cs.dxil.h" - #include "SIGMA_Shadow_TemporalStabilization.cs.dxbc.h" - #include "SIGMA_Shadow_TemporalStabilization.cs.dxil.h" - #include "SIGMA_Shadow_SplitScreen.cs.dxbc.h" - #include "SIGMA_Shadow_SplitScreen.cs.dxil.h" - #endif +// SIGMA_SHADOW +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "SIGMA_Shadow_ClassifyTiles.cs.dxbc.h" + #include "SIGMA_Shadow_SmoothTiles.cs.dxbc.h" + #include "SIGMA_Shadow_Blur.cs.dxbc.h" + #include "SIGMA_Shadow_PostBlur.cs.dxbc.h" + #include "SIGMA_Shadow_TemporalStabilization.cs.dxbc.h" + #include "SIGMA_Shadow_SplitScreen.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "SIGMA_Shadow_ClassifyTiles.cs.dxil.h" + #include "SIGMA_Shadow_SmoothTiles.cs.dxil.h" + #include "SIGMA_Shadow_Blur.cs.dxil.h" + #include "SIGMA_Shadow_PostBlur.cs.dxil.h" + #include "SIGMA_Shadow_TemporalStabilization.cs.dxil.h" + #include "SIGMA_Shadow_SplitScreen.cs.dxil.h" +#endif +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "SIGMA_Shadow_ClassifyTiles.cs.spirv.h" #include "SIGMA_Shadow_SmoothTiles.cs.spirv.h" #include "SIGMA_Shadow_Blur.cs.spirv.h" #include "SIGMA_Shadow_PostBlur.cs.spirv.h" #include "SIGMA_Shadow_TemporalStabilization.cs.spirv.h" #include "SIGMA_Shadow_SplitScreen.cs.spirv.h" +#endif + +#include "Denoisers/Sigma_Shadow.hpp" - // SIGMA_SHADOW_TRANSLUCENCY - #if !NRD_ONLY_SPIRV_SHADERS_AVAILABLE - #include "SIGMA_ShadowTranslucency_ClassifyTiles.cs.dxbc.h" - #include "SIGMA_ShadowTranslucency_ClassifyTiles.cs.dxil.h" - #include "SIGMA_ShadowTranslucency_Blur.cs.dxbc.h" - #include "SIGMA_ShadowTranslucency_Blur.cs.dxil.h" - #include "SIGMA_ShadowTranslucency_PostBlur.cs.dxbc.h" - #include "SIGMA_ShadowTranslucency_PostBlur.cs.dxil.h" - #include "SIGMA_ShadowTranslucency_TemporalStabilization.cs.dxbc.h" - #include "SIGMA_ShadowTranslucency_TemporalStabilization.cs.dxil.h" - #include "SIGMA_ShadowTranslucency_SplitScreen.cs.dxbc.h" - #include "SIGMA_ShadowTranslucency_SplitScreen.cs.dxil.h" - #endif +// SIGMA_SHADOW_TRANSLUCENCY +#ifdef NRD_EMBEDS_DXBC_SHADERS + #include "SIGMA_ShadowTranslucency_ClassifyTiles.cs.dxbc.h" + #include "SIGMA_ShadowTranslucency_Blur.cs.dxbc.h" + #include "SIGMA_ShadowTranslucency_PostBlur.cs.dxbc.h" + #include "SIGMA_ShadowTranslucency_TemporalStabilization.cs.dxbc.h" + #include "SIGMA_ShadowTranslucency_SplitScreen.cs.dxbc.h" +#endif + +#ifdef NRD_EMBEDS_DXIL_SHADERS + #include "SIGMA_ShadowTranslucency_ClassifyTiles.cs.dxil.h" + #include "SIGMA_ShadowTranslucency_Blur.cs.dxil.h" + #include "SIGMA_ShadowTranslucency_PostBlur.cs.dxil.h" + #include "SIGMA_ShadowTranslucency_TemporalStabilization.cs.dxil.h" + #include "SIGMA_ShadowTranslucency_SplitScreen.cs.dxil.h" +#endif + +#ifdef NRD_EMBEDS_SPIRV_SHADERS #include "SIGMA_ShadowTranslucency_ClassifyTiles.cs.spirv.h" #include "SIGMA_ShadowTranslucency_Blur.cs.spirv.h" #include "SIGMA_ShadowTranslucency_PostBlur.cs.spirv.h" #include "SIGMA_ShadowTranslucency_TemporalStabilization.cs.spirv.h" #include "SIGMA_ShadowTranslucency_SplitScreen.cs.spirv.h" - #endif -#include "Denoisers/Sigma_Shadow.hpp" #include "Denoisers/Sigma_ShadowTranslucency.hpp"