Skip to content

Commit

Permalink
v4.9.4:
Browse files Browse the repository at this point in the history
HIGHLIGHTS:
- Cmake: minor improvements
- updated deps
  • Loading branch information
dzhdanNV committed Sep 20, 2024
1 parent d27094b commit ebf92ab
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 12 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ message ("NRD v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}")
project (NRD LANGUAGES C CXX)
message ("NRD encoding: NRD_NORMAL_ENCODING = ${NRD_NORMAL_ENCODING}; NRD_ROUGHNESS_ENCODING = ${NRD_ROUGHNESS_ENCODING}")

if (IS_SUBMODULE)
file (RELATIVE_PATH PROJECT_FOLDER ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
else ()
set (PROJECT_FOLDER ${PROJECT_NAME})
endif ()

# Generate "NRDEncoding.hlsli"
file (WRITE Shaders/Include/NRDEncoding.hlsli
"// This file is auto-generated during project deployment. Do not modify!\n"
Expand Down Expand Up @@ -150,7 +156,7 @@ target_include_directories (${PROJECT_NAME} PRIVATE "External")
target_compile_definitions (${PROJECT_NAME} PRIVATE ${COMPILE_DEFINITIONS})
target_compile_options (${PROJECT_NAME} PRIVATE ${COMPILE_OPTIONS})

set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "${PROJECT_NAME}")
set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER ${PROJECT_FOLDER})

set_target_properties (${PROJECT_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
message ("NRD output path: '${CMAKE_RUNTIME_OUTPUT_DIRECTORY}'")
Expand All @@ -166,6 +172,8 @@ if (NOT NRD_DISABLE_SHADER_COMPILATION)
if (NOT TARGET ShaderMake)
set (SHADERMAKE_BIN_OUTPUT_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} CACHE STRING "")
add_subdirectory (External/ShaderMake)
set_property (TARGET ShaderMake PROPERTY FOLDER "${PROJECT_FOLDER}/External")
set_property (TARGET ShaderMakeBlob PROPERTY FOLDER "${PROJECT_FOLDER}/External")
endif ()

# ShaderMake general arguments
Expand Down Expand Up @@ -212,6 +220,6 @@ if (NOT NRD_DISABLE_SHADER_COMPILATION)
SOURCES ${SHADERS}
)

set_property (TARGET ${PROJECT_NAME}_Shaders PROPERTY FOLDER ${PROJECT_NAME})
set_property (TARGET ${PROJECT_NAME}_Shaders PROPERTY FOLDER ${PROJECT_FOLDER})
add_dependencies (${PROJECT_NAME} ${PROJECT_NAME}_Shaders)
endif ()
2 changes: 1 addition & 1 deletion External/MathLib
Submodule MathLib updated 2 files
+2 −0 Guts/f16.h
+2 −2 Guts/f32.h
2 changes: 1 addition & 1 deletion External/ShaderMake
Submodule ShaderMake updated 2 files
+1 −0 README.md
+67 −1 src/ShaderMake.cpp
4 changes: 2 additions & 2 deletions Include/NRD.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.

#define NRD_VERSION_MAJOR 4
#define NRD_VERSION_MINOR 9
#define NRD_VERSION_BUILD 3
#define NRD_VERSION_DATE "6 September 2024"
#define NRD_VERSION_BUILD 4
#define NRD_VERSION_DATE "20 September 2024"

#if defined(_MSC_VER)
#define NRD_CALL __fastcall
Expand Down
17 changes: 13 additions & 4 deletions Integration/NRDIntegration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license agreement from NVIDIA CORPORATION is strictly prohibited.
#include "NRDIntegration.h"

static_assert(NRD_VERSION_MAJOR >= 4 && NRD_VERSION_MINOR >= 9, "Unsupported NRD version!");
static_assert(NRI_VERSION_MAJOR >= 1 && NRI_VERSION_MINOR >= 147, "Unsupported NRI version!");
static_assert(NRI_VERSION_MAJOR >= 1 && NRI_VERSION_MINOR >= 151, "Unsupported NRI version!");

#ifdef _WIN32
#define alloca _alloca
Expand Down Expand Up @@ -188,7 +188,7 @@ void NrdIntegration::CreatePipelines()
for (uint32_t i = 0; i < instanceDesc.pipelinesNum; i++)
{
const nrd::PipelineDesc& nrdPipelineDesc = instanceDesc.pipelines[i];
const nrd::ComputeShaderDesc& nrdComputeShader = (&nrdPipelineDesc.computeShaderDXBC)[(uint32_t)deviceDesc.graphicsAPI];
const nrd::ComputeShaderDesc& nrdComputeShader = (&nrdPipelineDesc.computeShaderDXBC)[std::max((int32_t)deviceDesc.graphicsAPI - 1, 0)];

// Resources
for (uint32_t j = 0; j < nrdPipelineDesc.resourceRangesNum; j++)
Expand Down Expand Up @@ -283,7 +283,15 @@ void NrdIntegration::CreateResources(uint16_t resourceWidth, uint16_t resourceHe

uint16_t w = NRD_DivideUp(resourceWidth, nrdTextureDesc.downsampleFactor);
uint16_t h = NRD_DivideUp(resourceHeight, nrdTextureDesc.downsampleFactor);
nri::TextureDesc textureDesc = nri::Texture2D(format, w, h, 1, 1, nri::TextureUsageBits::SHADER_RESOURCE | nri::TextureUsageBits::SHADER_RESOURCE_STORAGE);

nri::TextureDesc textureDesc = {};
textureDesc.type = nri::TextureType::TEXTURE_2D;
textureDesc.usageMask = nri::TextureUsageBits::SHADER_RESOURCE | nri::TextureUsageBits::SHADER_RESOURCE_STORAGE;
textureDesc.format = format;
textureDesc.width = w;
textureDesc.height = h;
textureDesc.mipNum = 1;

nri::Texture* texture = nullptr;
NRD_INTEGRATION_ABORT_ON_FAILURE(m_NRI->CreateTexture(*m_Device, textureDesc, texture));

Expand Down Expand Up @@ -565,7 +573,8 @@ void NrdIntegration::Dispatch(nri::CommandBuffer& commandBuffer, nri::Descriptor

// TODO: persistent mapping? But no D3D11 support...
void* data = m_NRI->MapBuffer(*m_ConstantBuffer, m_ConstantBufferOffset, dispatchDesc.constantBufferDataSize);
memcpy(data, dispatchDesc.constantBufferData, dispatchDesc.constantBufferDataSize);
if (data)
memcpy(data, dispatchDesc.constantBufferData, dispatchDesc.constantBufferDataSize);
m_NRI->UnmapBuffer(*m_ConstantBuffer);
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NVIDIA REAL-TIME DENOISERS v4.9.3 (NRD)
# NVIDIA REAL-TIME DENOISERS v4.9.4 (NRD)

[![Build NRD SDK](https://github.com/NVIDIAGameWorks/RayTracingDenoiser/actions/workflows/build.yml/badge.svg)](https://github.com/NVIDIAGameWorks/RayTracingDenoiser/actions/workflows/build.yml)

Expand Down
2 changes: 1 addition & 1 deletion Resources/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ Versioning rules:

#define VERSION_MAJOR 4
#define VERSION_MINOR 9
#define VERSION_BUILD 3
#define VERSION_BUILD 4

#define VERSION_STRING STR(VERSION_MAJOR.VERSION_MINOR.VERSION_BUILD encoding=NRD_NORMAL_ENCODING.NRD_ROUGHNESS_ENCODING)

0 comments on commit ebf92ab

Please sign in to comment.