Skip to content

Commit

Permalink
v1.2.12a release
Browse files Browse the repository at this point in the history
  • Loading branch information
acmarrs-nvidia committed Jun 30, 2022
1 parent da38b17 commit 3f9fdfc
Show file tree
Hide file tree
Showing 19 changed files with 467 additions and 1,809 deletions.
8 changes: 0 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@
path = thirdparty/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers.git
branch = sdk-1.2.170
[submodule "thirdparty/libpng"]
path = thirdparty/libpng
url = https://github.com/glennrp/libpng.git
branch = libpng16
[submodule "thirdparty/zlib-ng"]
path = thirdparty/zlib-ng
url = https://github.com/zlib-ng/zlib-ng.git
branch = stable
27 changes: 7 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,13 @@ if(RTXGI_BUILD_SAMPLES)
target_compile_definitions(tinygltf PUBLIC _CRT_SECURE_NO_WARNINGS) # suppress the sprintf CRT warnings
set_target_properties(tinygltf PROPERTIES FOLDER "Thirdparty/")

# zlib-ng
option(ZLIB_COMPAT "" ON)
option(ZLIB_ENABLE_TESTS "" OFF)
add_subdirectory(thirdparty/zlib-ng)
set_target_properties(zlib PROPERTIES FOLDER "Thirdparty/")

# libpng
option(PNG_BUILD_ZLIB "" ON)
option(PNG_STATIC "" ON)
option(PNG_SHARED "" OFF)
option(PNG_EXECUTABLES "" OFF)
option(PNG_FRAMEWORK "" OFF)
option(PNG_TESTS "" OFF)
if(UNIX AND NOT APPLE)
set(ZLIB_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/thirdparty/zlib-ng" "${CMAKE_BINARY_DIR}/thirdparty/zlib-ng")
endif()
set(ZLIB_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/thirdparty/zlib-ng" "${CMAKE_BINARY_DIR}/thirdparty/zlib-ng")
add_subdirectory(thirdparty/libpng)
set_target_properties(png_static genfiles PROPERTIES FOLDER "Thirdparty/libpng")

# Samples
add_subdirectory(samples)

# Set the default project. If D3D is an option, set it as default.
if(RTXGI_API_D3D12_ENABLE)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT TestHarness-D3D12)
elseif(NOT RTXGI_API_D3D12_ENABLE AND RTXGI_API_VULKAN_ENABLE)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT TestHarness-VK)
endif()
endif()
21 changes: 21 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# RTXGI SDK Change Log

## 1.2.12a

### SDK
- No changes

### Test Harness
Features and Improvements:
- Uses stb (stb_image_write) for image saving and screenshot functionality (included with the tinygltf dependency)
- Removes zlib-ng and libpng dependencies
- Updates Windows DXC (packman) dependencies to version 1.6.2112 which includes ```dxil.dll```
- Now using std::filesystem on Windows and Linux
- CMake
- Adds option to select in CMake whether to use the DXC & DXIL binaries from Packman or an installed Win10 SDK (Windows only)
- Properly sets the default startup project for RTXGI.sln (it really works now!)
- Adds arguments to automatically set the available config ini files for the SmartCmdArgs extension
- Removes DirectXTK ```ScreenGrab[.h|.cpp]``` files

Bug Fixes:
- Fixes VK validation layer error related to the back buffer not being marked as a possible copy source
- Fixes D3D12 and VK swapchain creation failures (causing a crash) when alt+tabbing or minimizing the application when in fullscreen mode

## 1.2.12

### SDK
Expand Down
5 changes: 3 additions & 2 deletions packman/dependencies.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<project toolsVersion="5.0">
<dependency name="dxc" linkPath="../dxc" >
<package name="dxc" version="1.6.2106-${platform}" platforms="windows-x86_64 linux-x86_64" />
<package name="dxc" version="1.6.2112-${platform}" platforms="windows-x86_64" />
<package name="dxc" version="1.6.2106-${platform}" platforms="linux-x86_64" />
<package name="dxc" version="1.6.2106_glibc2.27_linux-aarch64" platforms="linux-aarch64" />
</dependency>
</project>
</project>
2 changes: 1 addition & 1 deletion rtxgi-sdk/FindSDKs.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
Expand Down
2 changes: 1 addition & 1 deletion samples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
Expand Down
29 changes: 29 additions & 0 deletions samples/test-harness/.args
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"FileVersion": 2,
"Items": [
{
"Command": "Scene Configs",
"Items": [
{
"Command": "../../../samples/test-harness/config/cornell.ini",
"DefaultChecked": true
},
{
"Command": "../../../samples/test-harness/config/furnace.ini"
},
{
"Command": "../../../samples/test-harness/config/multi-cornell.ini"
},
{
"Command": "../../../samples/test-harness/config/sponza.ini"
},
{
"Command": "../../../samples/test-harness/config/tunnel.ini"
},
{
"Command": "../../../samples/test-harness/config/two-rooms.ini"
}
]
}
]
}
92 changes: 48 additions & 44 deletions samples/test-harness/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,6 @@ file(GLOB THIRD_PARTY_DIRECTXTEX_GPU_COMPRESS_SOURCE
"src/thirdparty/directxtex/BCDirectCompute.cpp"
)

file(GLOB THIRD_PARTY_DIRECTXTK_INCLUDE
"include/thirdparty/directxtk/ScreenGrab12.h"
)

file(GLOB THIRD_PARTY_DIRECTXTK_SOURCE
"src/thirdparty/directxtk/ScreenGrab12.cpp"
)

file(GLOB THIRD_PARTY_IMGUI_SOURCE
"../../thirdparty/imgui/imgui.cpp"
"../../thirdparty/imgui/imgui_demo.cpp"
Expand Down Expand Up @@ -235,6 +227,13 @@ option(RTXGISAMPLES_TEST_HARNESS_DDGI_DEBUG_BORDER_COPY_INDEXING "Enable a borde
# Setup the Test Harness options
function(SetupOptions ARG_TARGET_EXE)

if(WIN32)
# Setup the dxcompiler and dxil binary options
set(RTXGISAMPLES_DXC_BINARIES "Packman" CACHE STRING "The dxcompiler and dxil binaries to use")
set(RTXGISAMPLES_DXC_BINARIES "Win10 SDK" CACHE STRING "The dxcompiler and dxil binaries to use")
set_property(CACHE RTXGISAMPLES_DXC_BINARIES PROPERTY STRINGS "Packman" "Win10 SDK")
endif()

# Set GFX object naming
if(RTXGISAMPLES_GFX_NAME_OBJECTS)
target_compile_definitions(${ARG_TARGET_EXE} PRIVATE GFX_NAME_OBJECTS)
Expand Down Expand Up @@ -268,7 +267,6 @@ set(GLFW_INCLUDE "${ROOT_DIR}/thirdparty/glfw/include")
set(IMGUI_INCLUDE "${ROOT_DIR}/thirdparty/imgui")
set(IMGUI_BACKENDS_INCLUDE "${ROOT_DIR}/thirdparty/imgui/backends")
set(TINYGLTF_INCLUDE "${ROOT_DIR}/thirdparty/tinygltf")
set(LIBPNG_INCLUDE "${ROOT_DIR}/thirdparty/libpng" "${CMAKE_BINARY_DIR}/thirdparty/libpng")

# ---- WINDOWS / D3D12 --------------------------------------------------------------------------------------

Expand All @@ -293,13 +291,12 @@ if(RTXGI_API_D3D12_ENABLE)
${THIRD_PARTY_DIRECTXTEX_SOURCE}
${THIRD_PARTY_DIRECTXTEX_GPU_COMPRESS_SOURCE}
${THIRD_PARTY_DIRECTXTK_INCLUDE}
${THIRD_PARTY_DIRECTXTK_SOURCE}
${THIRD_PARTY_IMGUI_SOURCE}
${THIRD_PARTY_IMGUI_D3D12_SOURCE}
)

# Add dependencies
add_dependencies(${TARGET_EXE} glfw tinygltf png_static zlib)
add_dependencies(${TARGET_EXE} glfw tinygltf)

# Add the include directories
target_include_directories(${TARGET_EXE} PRIVATE
Expand All @@ -309,16 +306,16 @@ if(RTXGI_API_D3D12_ENABLE)
"include/thirdparty/directxtex"
"include/thirdparty/directxtk"
"include/thirdparty/dxc"
"include/thirdparty/stb"
${DIRECTXMATH_INCLUDE}
${GLFW_INCLUDE}
${IMGUI_INCLUDE}
${IMGUI_BACKENDS_INCLUDE}
${TINYGLTF_INCLUDE}
${LIBPNG_INCLUDE}
)

# Add statically linked libs
target_link_libraries(${TARGET_EXE} RTXGI-D3D12 glfw png_static zlib d3d11 d3d12 dxgi)
target_link_libraries(${TARGET_EXE} RTXGI-D3D12 glfw d3d11 d3d12 dxgi)

# Add common compiler definitions for exposed Test Harness options
SetupOptions(${TARGET_EXE})
Expand Down Expand Up @@ -371,12 +368,12 @@ if(RTXGI_API_VULKAN_ENABLE)
"include/thirdparty"
"include/thirdparty/directxtex"
"include/thirdparty/dxc"
"include/thirdparty/stb"
${DIRECTXMATH_INCLUDE}
${GLFW_INCLUDE}
${IMGUI_INCLUDE}
${IMGUI_BACKENDS_INCLUDE}
${TINYGLTF_INCLUDE}
${LIBPNG_INCLUDE}
)

# Add VS filters
Expand Down Expand Up @@ -422,17 +419,17 @@ if(RTXGI_API_VULKAN_ENABLE)
"include/thirdparty/directxmath"
"include/thirdparty/directxtex"
"include/thirdparty/dxc"
"include/thirdparty/stb"
${GLFW_INCLUDE}
${IMGUI_INCLUDE}
${IMGUI_BACKENDS_INCLUDE}
${TINYGLTF_INCLUDE}
${LIBPNG_INCLUDE}
)

endif()

# Add dependencies
add_dependencies(${TARGET_EXE} glfw tinygltf png_static zlib)
add_dependencies(${TARGET_EXE} glfw tinygltf)

# Add compiler definitions
target_compile_definitions(${TARGET_EXE} PUBLIC API_VULKAN)
Expand All @@ -446,7 +443,7 @@ if(RTXGI_API_VULKAN_ENABLE)
# Add statically linked libs
if(WIN32)
# Note: Even when targeting Vulkan, Windows uses D3D11 GPU-based texture compression with DirectXTex
target_link_libraries(${TARGET_EXE} RTXGI-VK ${Vulkan_LIBRARY} glfw png_static zlib d3d11)
target_link_libraries(${TARGET_EXE} RTXGI-VK ${Vulkan_LIBRARY} glfw d3d11)
elseif(UNIX AND NOT APPLE)
# Note: UNIX can't use D3D11 GPU-based texture compression with DirectXTex
target_link_libraries(${TARGET_EXE} RTXGI-VK -lglfw -lvulkan -ldl -lpthread -lX11 -lXrandr -lXi -lstdc++fs)
Expand All @@ -462,7 +459,7 @@ if(RTXGI_API_VULKAN_ENABLE)
set_target_properties(${TARGET_EXE} PROPERTIES FOLDER "RTXGI Samples")
endif() # VULKAN_ENABLE

if(WIN32)
if(WIN32 AND MSVC)

# Add VS filters
source_group("Config" FILES ${TEST_HARNESS_CONFIG})
Expand All @@ -477,55 +474,62 @@ if(WIN32)
source_group("Source Files/Thirdparty/DirectXTex" FILES ${THIRD_PARTY_DIRECTXTEX_SOURCE} ${THIRD_PARTY_DIRECTXTEX_GPU_COMPRESS_SOURCE})
source_group("Source Files/Thirdparty/ImGui" FILES ${THIRD_PARTY_IMGUI_SOURCE} ${THIRD_PARTY_IMGUI_D3D12_SOURCE} ${THIRD_PARTY_IMGUI_VULKAN_SOURCE})

# D3D12 only toolkit files
if(RTXGI_API_D3D12_ENABLE)
source_group("Header Files/Thirdparty/DirectXTK" FILES ${THIRD_PARTY_DIRECTXTK_INCLUDE})
source_group("Source Files/Thirdparty/DirectXTK" FILES ${THIRD_PARTY_DIRECTXTK_SOURCE})
endif()
# Set arguments for Visual Studio Smart Command Line Arguments extension
# https://github.com/MBulli/SmartCommandlineArgs
configure_file("${ROOT_DIR}/samples/test-harness/.args" "${CMAKE_BINARY_DIR}/samples/test-harness/TestHarness-D3D12.args.json" COPYONLY)
configure_file("${ROOT_DIR}/samples/test-harness/.args" "${CMAKE_BINARY_DIR}/samples/test-harness/TestHarness-VK.args.json" COPYONLY)
endif() # WIN32 and MSVC

# Set the default project. If D3D is an option, set it as default.
if(RTXGI_API_D3D12_ENABLE)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT TestHarness-D3D12)
elseif(NOT RTXGI_API_D3D12_ENABLE AND RTXGI_API_VULKAN_ENABLE)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT TestHarness-VK)
# Set the dxc binaries location (Windows only)
if(WIN32)
if(${RTXGISAMPLES_DXC_BINARIES} MATCHES "Packman")
set(DXC_BINARY ${ROOT_DIR}/dxc/bin/dxcompiler.dll)
set(DXIL_BINARY ${ROOT_DIR}/dxc/bin/dxil.dll)
elseif(${RTXGISAMPLES_DXC_BINARIES} MATCHES "Win10 SDK")
set(DXC_BINARY ${RTXGI_API_D3D12_DXIL_PATH}/dxcompiler.dll)
set(DXIL_BINARY ${RTXGI_API_D3D12_DXIL_PATH}/dxil.dll)
endif()

endif() # WIN32
endif()

if(WIN32 AND RTXGI_API_D3D12_ENABLE)
# Copy required DLLs and logo images to the working directories
# Copy required DLLs next to the executable
add_custom_command( TARGET TestHarness-D3D12 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DXIL_BINARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/d3d12/$<CONFIG>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DXC_BINARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/d3d12/$<CONFIG>
)

# Copy logo image to the working directories
add_custom_command( TARGET TestHarness-D3D12 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RTXGI_API_D3D12_DXIL_PATH}/dxil.dll ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/d3d12/$<CONFIG>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/dxc/bin/dxcompiler.dll ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/d3d12/$<CONFIG>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/docs/nvidia.jpg ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/d3d12/$<CONFIG>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/docs/nvidia.jpg ${CMAKE_BINARY_DIR}/samples/test-harness/
)
endif()

if(WIN32 AND RTXGI_API_VULKAN_ENABLE)
# Copy required DLLs and logo images to the working directories
# Copy required DLLs next to the executable
add_custom_command( TARGET TestHarness-VK POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DXC_BINARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vulkan/$<CONFIG>
)

# Copy logo image to the working directories
add_custom_command( TARGET TestHarness-VK POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/dxc/bin/dxcompiler.dll ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vulkan/$<CONFIG>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/docs/nvidia.jpg ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vulkan/$<CONFIG>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/docs/nvidia.jpg ${CMAKE_BINARY_DIR}/samples/test-harness/
)
endif()

if(UNIX AND RTXGI_API_VULKAN_ENABLE)
# Copy required shared libraries and logo images to the working directories
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
# Copy required shared libraries next to the executable
add_custom_command( TARGET TestHarness-VK POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/dxc/lib/libdxcompiler.so ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vulkan/$<CONFIG>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/dxc/lib/libdxcompiler.so ${CMAKE_BINARY_DIR}/samples/test-harness
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/docs/nvidia.jpg ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vulkan/$<CONFIG>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/docs/nvidia.jpg ${CMAKE_BINARY_DIR}/samples/test-harness
)
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
add_custom_command( TARGET TestHarness-VK POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/dxc/lib/libdxcompiler.so ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vulkan/$<CONFIG>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/dxc/lib/libdxcompiler.so ${CMAKE_BINARY_DIR}/samples/test-harness

# Copy logo image to the working directories
add_custom_command( TARGET TestHarness-VK POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/docs/nvidia.jpg ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vulkan/$<CONFIG>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ROOT_DIR}/docs/nvidia.jpg ${CMAKE_BINARY_DIR}/samples/test-harness
)
)
endif()
endif()
2 changes: 2 additions & 0 deletions samples/test-harness/include/Direct3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Graphics
{
static const D3D12_HEAP_PROPERTIES defaultHeapProps = { D3D12_HEAP_TYPE_DEFAULT, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 0, 0 };
static const D3D12_HEAP_PROPERTIES uploadHeapProps = { D3D12_HEAP_TYPE_UPLOAD, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 0, 0 };
static const D3D12_HEAP_PROPERTIES readbackHeapProps = { D3D12_HEAP_TYPE_READBACK, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 0, 0 };

bool Check(HRESULT hr, std::string fileName, uint32_t lineNumber);
#define D3DCHECK(hr) if(!Check(hr, __FILE__, __LINE__)) { return false; }
Expand All @@ -40,6 +41,7 @@ namespace Graphics
{
DEFAULT = 0,
UPLOAD = 1,
READBACK = 2
};

struct BufferDesc
Expand Down
16 changes: 14 additions & 2 deletions samples/test-harness/include/ImageCapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,21 @@

#include <stdint.h>
#include <string>

#if defined(_WIN32) || defined(WIN32)
#include <wincodec.h>
#include <d3d12.h>
#include <vector>
#endif

namespace ImageCapture
{
bool CapturePng(std::string file, uint32_t width, uint32_t height, std::vector<unsigned char*>& rows);
}
const static uint32_t NumChannels = 4;
bool CapturePng(std::string file, uint32_t width, uint32_t height, const unsigned char* data);

#if defined(_WIN32) || defined(WIN32)
IWICImagingFactory2* CreateWICImagingFactory();
HRESULT ConvertTextureResource(const D3D12_RESOURCE_DESC desc, UINT64 imageSize, UINT64 dstRowPitch, unsigned char* pMappedMemory, std::vector<unsigned char>& converted);
#endif

}
Loading

0 comments on commit 3f9fdfc

Please sign in to comment.