From aca70dadd6ec3f86e4c6ce030d65a8270294858a Mon Sep 17 00:00:00 2001 From: acmarrs-nvidia Date: Mon, 12 Sep 2022 17:14:03 -0400 Subject: [PATCH] v1.2.13 release --- .gitignore | 1 + ChangeLog.md | 11 ++++ rtxgi-sdk/include/rtxgi/Common.h | 4 +- .../include/rtxgi/ddgi/DDGIVolumeDescGPU.h | 66 +++++++++---------- samples/test-harness/src/Vulkan.cpp | 8 ++- .../src/graphics/Composite_VK.cpp | 4 +- .../test-harness/src/graphics/DDGI_D3D12.cpp | 4 +- samples/test-harness/src/graphics/DDGI_VK.cpp | 4 +- .../test-harness/src/graphics/GBuffer_VK.cpp | 6 +- .../src/graphics/PathTracing_VK.cpp | 6 +- 10 files changed, 64 insertions(+), 50 deletions(-) diff --git a/.gitignore b/.gitignore index d911a49..ec04594 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .venv/* .vscode/settings.json +.vscode/*.log log.txt build/* dxc diff --git a/ChangeLog.md b/ChangeLog.md index 86f55c5..40cf5ed 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,16 @@ # RTXGI SDK Change Log +## 1.2.13 + +### SDK +Bug Fixes: +- Fixes a bit packing issue in `DDGIVolumeDescGPU.h` + - This bug causes the irradiance texture format to be improperly packed and unpacked. This problem may also affect feature bits, depending on which ones are set. + +### Test Harness +Bug Fixes: +- Fixes Vulkan validation layer errors related to the ray query extension not being enabled + ## 1.2.12a ### SDK diff --git a/rtxgi-sdk/include/rtxgi/Common.h b/rtxgi-sdk/include/rtxgi/Common.h index bc8e49a..7690748 100644 --- a/rtxgi-sdk/include/rtxgi/Common.h +++ b/rtxgi-sdk/include/rtxgi/Common.h @@ -20,11 +20,11 @@ namespace rtxgi { static const int major = 1; static const int minor = 2; - static const int revision = 12; + static const int revision = 13; inline static const char* getVersionString() { - return "1.2.12"; + return "1.2.13"; } }; diff --git a/rtxgi-sdk/include/rtxgi/ddgi/DDGIVolumeDescGPU.h b/rtxgi-sdk/include/rtxgi/ddgi/DDGIVolumeDescGPU.h index 818dc7a..b504f9f 100644 --- a/rtxgi-sdk/include/rtxgi/ddgi/DDGIVolumeDescGPU.h +++ b/rtxgi-sdk/include/rtxgi/ddgi/DDGIVolumeDescGPU.h @@ -98,10 +98,10 @@ struct DDGIVolumeDescGPU bool probeRelocationEnabled; // whether probe relocation is enabled for this volume bool probeClassificationEnabled; // whether probe classification is enabled for this volume -#ifndef HLSL +#ifndef HLSL // CPU only rtxgi::DDGIVolumeDescGPUPacked GetPackedData() { - rtxgi::DDGIVolumeDescGPUPacked data; + rtxgi::DDGIVolumeDescGPUPacked data = {}; data.origin = origin; data.probeHysteresis = probeHysteresis; data.rotation = rotation; @@ -115,7 +115,7 @@ struct DDGIVolumeDescGPU data.packed0 = (uint32_t)probeCounts.x; data.packed0 |= (uint32_t)probeCounts.y << 8; data.packed0 |= (uint32_t)probeCounts.z << 16; - //data.packed0 |= 8 bits unused + //data.packed0, 8 bits unused data.probeIrradianceEncodingGamma = probeIrradianceEncodingGamma; data.probeIrradianceThreshold = probeIrradianceThreshold; @@ -131,36 +131,36 @@ struct DDGIVolumeDescGPU data.packed2 |= (uint32_t)probeNumDistanceTexels << 24; // Probe Scroll Offsets - data.packed3 = (uint32_t)abs(probeScrollOffsets.x); - data.packed3 |= ((uint32_t)(probeScrollOffsets.x < 0) << 15); - data.packed3 |= (uint32_t)abs(probeScrollOffsets.y) << 16; - data.packed3 |= ((uint32_t)(probeScrollOffsets.y < 0) << 31); - data.packed4 = (uint32_t)abs(probeScrollOffsets.z); - data.packed4 |= ((uint32_t)(probeScrollOffsets.z < 0) << 15); + data.packed3 = (data.packed3 & ~0x7FFF) | abs(probeScrollOffsets.x); + data.packed3 = (data.packed3 & ~0x8000) | ((probeScrollOffsets.x < 0) << 15); + data.packed3 = (data.packed3 & ~0x10000) | abs(probeScrollOffsets.y) << 16; + data.packed3 = (data.packed3 & ~0x80000000) | ((probeScrollOffsets.y < 0) << 31); + data.packed4 = (data.packed4 & ~0x7FFF) | abs(probeScrollOffsets.z); + data.packed4 = (data.packed4 & ~0x8000) | ((probeScrollOffsets.z < 0) << 15); // Feature Bits - data.packed4 |= movementType << 16; - data.packed4 |= probeRayDataFormat << 17; - data.packed4 |= probeIrradianceFormat << 18; - data.packed4 |= (uint32_t)probeRelocationEnabled << 19; - data.packed4 |= (uint32_t)probeClassificationEnabled << 20; - data.packed4 |= (uint32_t)probeScrollClear[0] << 21; - data.packed4 |= (uint32_t)probeScrollClear[1] << 22; - data.packed4 |= (uint32_t)probeScrollClear[2] << 23; - data.packed4 |= (uint32_t)(probeScrollDirections[0]) << 24; - data.packed4 |= (uint32_t)(probeScrollDirections[1]) << 25; - data.packed4 |= (uint32_t)(probeScrollDirections[2]) << 26; - //data.packed4 |= 5 bits unused + data.packed4 = (data.packed4 & ~0x10000) | (movementType << 16); + data.packed4 = (data.packed4 & ~0x20000) | (probeRayDataFormat << 17); + data.packed4 = (data.packed4 & ~0xC0000) | (probeIrradianceFormat << 18); + data.packed4 = (data.packed4 & ~0x100000) | (probeRelocationEnabled << 20); + data.packed4 = (data.packed4 & ~0x200000) | (probeClassificationEnabled << 21); + data.packed4 = (data.packed4 & ~0x400000) | (probeScrollClear[0] << 22); + data.packed4 = (data.packed4 & ~0x800000) | (probeScrollClear[1] << 23); + data.packed4 = (data.packed4 & ~0x1000000) | (probeScrollClear[2] << 24); + data.packed4 = (data.packed4 & ~0x2000000) | (probeScrollDirections[0] << 25); + data.packed4 = (data.packed4 & ~0x4000000) | (probeScrollDirections[1] << 26); + data.packed4 = (data.packed4 & ~0x8000000) | (probeScrollDirections[2] << 27); + //data.packed4, 4 bits unused return data; } -#endif +#endif // ifndef HLSL }; -#ifdef HLSL +#ifdef HLSL // GPU DDGIVolumeDescGPU UnpackDDGIVolumeDescGPU(DDGIVolumeDescGPUPacked input) { - DDGIVolumeDescGPU output; + DDGIVolumeDescGPU output = (DDGIVolumeDescGPU)0; output.origin = input.origin; output.probeHysteresis = input.probeHysteresis; output.rotation = input.rotation; @@ -201,15 +201,15 @@ DDGIVolumeDescGPU UnpackDDGIVolumeDescGPU(DDGIVolumeDescGPUPacked input) // Feature Bits output.movementType = (input.packed4 >> 16) & 0x00000001; output.probeRayDataFormat = (uint)((input.packed4 >> 17) & 0x00000001); - output.probeIrradianceFormat = (uint)((input.packed4 >> 18) & 0x00000001); - output.probeRelocationEnabled = (bool)((input.packed4 >> 19) & 0x00000001); - output.probeClassificationEnabled = (bool)((input.packed4 >> 20) & 0x00000001); - output.probeScrollClear[0] = (bool)((input.packed4 >> 21) & 0x00000001); - output.probeScrollClear[1] = (bool)((input.packed4 >> 22) & 0x00000001); - output.probeScrollClear[2] = (bool)((input.packed4 >> 23) & 0x00000001); - output.probeScrollDirections[0] = (bool)((input.packed4 >> 24) & 0x00000001); - output.probeScrollDirections[1] = (bool)((input.packed4 >> 25) & 0x00000001); - output.probeScrollDirections[2] = (bool)((input.packed4 >> 26) & 0x00000001); + output.probeIrradianceFormat = (uint)((input.packed4 >> 18) & 0x00000003); + output.probeRelocationEnabled = (bool)((input.packed4 >> 20) & 0x00000001); + output.probeClassificationEnabled = (bool)((input.packed4 >> 21) & 0x00000001); + output.probeScrollClear[0] = (bool)((input.packed4 >> 22) & 0x00000001); + output.probeScrollClear[1] = (bool)((input.packed4 >> 23) & 0x00000001); + output.probeScrollClear[2] = (bool)((input.packed4 >> 24) & 0x00000001); + output.probeScrollDirections[0] = (bool)((input.packed4 >> 25) & 0x00000001); + output.probeScrollDirections[1] = (bool)((input.packed4 >> 26) & 0x00000001); + output.probeScrollDirections[2] = (bool)((input.packed4 >> 27) & 0x00000001); return output; } diff --git a/samples/test-harness/src/Vulkan.cpp b/samples/test-harness/src/Vulkan.cpp index 8d538a7..400e8d7 100644 --- a/samples/test-harness/src/Vulkan.cpp +++ b/samples/test-harness/src/Vulkan.cpp @@ -330,6 +330,7 @@ namespace Graphics { VK_KHR_SWAPCHAIN_EXTENSION_NAME, VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, + VK_KHR_RAY_QUERY_EXTENSION_NAME, VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME, VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME, VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, @@ -353,9 +354,14 @@ namespace Graphics bufferDeviceAdressFeatures.pNext = &robusness2Features; bufferDeviceAdressFeatures.bufferDeviceAddress = VK_TRUE; + VkPhysicalDeviceRayQueryFeaturesKHR rayQueryFeatures = {}; + rayQueryFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR; + rayQueryFeatures.pNext = &bufferDeviceAdressFeatures; + rayQueryFeatures.rayQuery = VK_TRUE; + VkPhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeatures = {}; accelerationStructureFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR; - accelerationStructureFeatures.pNext = &bufferDeviceAdressFeatures; + accelerationStructureFeatures.pNext = &rayQueryFeatures; accelerationStructureFeatures.accelerationStructure = VK_TRUE; accelerationStructureFeatures.accelerationStructureCaptureReplay = VK_FALSE; accelerationStructureFeatures.accelerationStructureIndirectBuild = VK_FALSE; diff --git a/samples/test-harness/src/graphics/Composite_VK.cpp b/samples/test-harness/src/graphics/Composite_VK.cpp index 3ffdd9d..ccb35c7 100644 --- a/samples/test-harness/src/graphics/Composite_VK.cpp +++ b/samples/test-harness/src/graphics/Composite_VK.cpp @@ -32,14 +32,14 @@ namespace Graphics // Load and compile the vertex shader resources.shaders.vs.filepath = shaderPath.c_str(); resources.shaders.vs.entryPoint = L"VS"; - resources.shaders.vs.targetProfile = L"vs_6_5"; + resources.shaders.vs.targetProfile = L"vs_6_4"; resources.shaders.vs.arguments = { L"-spirv", L"-D SPIRV=1", L"-fspv-target-env=vulkan1.2" }; CHECK(Shaders::Compile(vk.shaderCompiler, resources.shaders.vs, true), "compile composition vertex shader!\n", log); // Load and compile the pixel shader resources.shaders.ps.filepath = shaderPath.c_str(); resources.shaders.ps.entryPoint = L"PS"; - resources.shaders.ps.targetProfile = L"ps_6_5"; + resources.shaders.ps.targetProfile = L"ps_6_4"; resources.shaders.ps.arguments = { L"-spirv", L"-D SPIRV=1", L"-fspv-target-env=vulkan1.2" }; CHECK(Shaders::Compile(vk.shaderCompiler, resources.shaders.ps, true), "compile composition pixel shader!\n", log); diff --git a/samples/test-harness/src/graphics/DDGI_D3D12.cpp b/samples/test-harness/src/graphics/DDGI_D3D12.cpp index 3cad690..898d407 100644 --- a/samples/test-harness/src/graphics/DDGI_D3D12.cpp +++ b/samples/test-harness/src/graphics/DDGI_D3D12.cpp @@ -941,8 +941,8 @@ namespace Graphics // Validate the SDK version assert(RTXGI_VERSION::major == 1); assert(RTXGI_VERSION::minor == 2); - assert(RTXGI_VERSION::revision == 12); - assert(std::strcmp(RTXGI_VERSION::getVersionString(), "1.2.12") == 0); + assert(RTXGI_VERSION::revision == 13); + assert(std::strcmp(RTXGI_VERSION::getVersionString(), "1.2.13") == 0); UINT numVolumes = static_cast(config.ddgi.volumes.size()); diff --git a/samples/test-harness/src/graphics/DDGI_VK.cpp b/samples/test-harness/src/graphics/DDGI_VK.cpp index 4cac21b..968e7f0 100644 --- a/samples/test-harness/src/graphics/DDGI_VK.cpp +++ b/samples/test-harness/src/graphics/DDGI_VK.cpp @@ -1368,8 +1368,8 @@ namespace Graphics // Validate the SDK version assert(RTXGI_VERSION::major == 1); assert(RTXGI_VERSION::minor == 2); - assert(RTXGI_VERSION::revision == 12); - assert(std::strcmp(RTXGI_VERSION::getVersionString(), "1.2.12") == 0); + assert(RTXGI_VERSION::revision == 13); + assert(std::strcmp(RTXGI_VERSION::getVersionString(), "1.2.13") == 0); // Reset the command list before initialization CHECK(ResetCmdList(vk), "reset command list!", log); diff --git a/samples/test-harness/src/graphics/GBuffer_VK.cpp b/samples/test-harness/src/graphics/GBuffer_VK.cpp index 7ea7c1a..b6d8d1d 100644 --- a/samples/test-harness/src/graphics/GBuffer_VK.cpp +++ b/samples/test-harness/src/graphics/GBuffer_VK.cpp @@ -55,8 +55,7 @@ namespace Graphics group.chs.filepath = shaderPath.c_str(); group.chs.entryPoint = L"CHS_PRIMARY"; group.chs.exportName = L"GBufferCHS"; - group.chs.targetProfile = L"lib_6_4"; - group.chs.arguments = { L"-spirv", L"-T lib_6_4", L"-D SPIRV=1", L"-fspv-target-env=vulkan1.2" }; + group.chs.arguments = { L"-spirv", L"-D SPIRV=1", L"-fspv-target-env=vulkan1.2" }; CHECK(Shaders::Compile(vk.shaderCompiler, group.chs, true), "compile GBuffer closest hit shader!\n", log); // Load and compile the AHS @@ -64,8 +63,7 @@ namespace Graphics group.ahs.filepath = shaderPath.c_str(); group.ahs.entryPoint = L"AHS_PRIMARY"; group.ahs.exportName = L"GBufferAHS"; - group.ahs.targetProfile = L"lib_6_4"; - group.ahs.arguments = { L"-spirv", L"-T lib_6_4", L"-D SPIRV=1", L"-fspv-target-env=vulkan1.2" }; + group.ahs.arguments = { L"-spirv", L"-D SPIRV=1", L"-fspv-target-env=vulkan1.2" }; CHECK(Shaders::Compile(vk.shaderCompiler, group.ahs, true), "compile GBuffer any hit shader!\n", log); return true; diff --git a/samples/test-harness/src/graphics/PathTracing_VK.cpp b/samples/test-harness/src/graphics/PathTracing_VK.cpp index cdf6d7b..d9308e2 100644 --- a/samples/test-harness/src/graphics/PathTracing_VK.cpp +++ b/samples/test-harness/src/graphics/PathTracing_VK.cpp @@ -90,8 +90,7 @@ namespace Graphics group.chs.filepath = shaderPath.c_str(); group.chs.entryPoint = L"CHS_LOD0"; group.chs.exportName = L"PathTraceCHS"; - group.chs.targetProfile = L"lib_6_4"; - group.chs.arguments = { L"-spirv", L"-T lib_6_4", L"-D SPIRV=1", L"-fspv-target-env=vulkan1.2" }; + group.chs.arguments = { L"-spirv", L"-D SPIRV=1", L"-fspv-target-env=vulkan1.2" }; CHECK(Shaders::Compile(vk.shaderCompiler, group.chs, true), "compile path tracing closest hit shader!\n", log); // Load and compile the AHS @@ -99,8 +98,7 @@ namespace Graphics group.ahs.filepath = shaderPath.c_str(); group.ahs.entryPoint = L"AHS_LOD0"; group.ahs.exportName = L"PathTraceAHS"; - group.ahs.targetProfile = L"lib_6_4"; - group.ahs.arguments = { L"-spirv", L"-T lib_6_4", L"-D SPIRV=1", L"-fspv-target-env=vulkan1.2" }; + group.ahs.arguments = { L"-spirv", L"-D SPIRV=1", L"-fspv-target-env=vulkan1.2" }; CHECK(Shaders::Compile(vk.shaderCompiler, group.ahs, true), "compile path tracing any hit shader!\n", log); return true;