Skip to content

Commit

Permalink
FidelityFX SSSR release v1.0
Browse files Browse the repository at this point in the history
DominikBaumeisterAMD committed May 11, 2020
1 parent 0b1c05b commit b9c98e6
Showing 63 changed files with 1,467 additions and 1,500 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -2,3 +2,4 @@
*.jpg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.gltf filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
78 changes: 20 additions & 58 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,41 @@
variables:
SampleName: SSSRSample
SolutionDirDX12: sample\build\DX12
SolutionDX12: SSSRSample_DX12.sln
SampleName: SssrSample
GIT_SUBMODULE_STRATEGY: normal

before_script:
- 'for /f "usebackq delims=" %%i in (`vswhere.exe -version "[15.0,16.0)" -products Microsoft.VisualStudio.Product.BuildTools -property installationPath`) do set MSBUILD_PATH=%%i'
- 'call "%MSBUILD_PATH%\VC\Auxiliary\Build\vcvars64.bat"'
- 'cd sample\build'
- 'call GenerateSolutions.bat -T v141'
- 'cd ..\..'

stages:
- build
- deploy

build d3d12 sample release:
build_dx12:
tags:
- windows
- amd64
stage: deploy
except:
- tags
stage: build
script:
- echo Building "%SolutionDX12%"
- cd %SolutionDirDX12%
- 'msbuild.exe "%SolutionDX12%" /p:Configuration=Release /p:Platform=x64'
- cd ../../..
- mkdir %SampleName%
- copy sample\src\Common bin
- move sample\bin %SampleName%
- move sample\media %SampleName%
- move sample\README.md %SampleName%
- move sample\screenshot.png %SampleName%
- move NOTICES.txt %SampleName%
- echo cd .\%SampleName%\bin\ > %SampleName%_DX12.bat
- echo start %SampleName%_DX12.exe >> %SampleName%_DX12.bat
- 'cmake -S sample -B sample/build/DX12 -G "Visual Studio 15 2017" -A x64 -DGFX_API=DX12'
- 'cmake --build sample/build/DX12 --config Release'
artifacts:
name: "%SampleName%-%CI_COMMIT_REF_NAME%-%CI_COMMIT_SHORT_SHA%"
paths:
- "%SampleName%/bin/"
- "%SampleName%/media/"
- "%SampleName%/NOTICES.txt"
- "%SampleName%/README.md"
- "%SampleName%/screenshot.png"
- "%SampleName%_DX12.bat"

build d3d12 sample release tagged:
- sample/bin/

package_sample:
tags:
- windows
- amd64
stage: deploy
only:
- tags
dependencies:
- build_dx12
script:
- echo Building "%SolutionDX12%"
- cd %SolutionDirDX12%
- 'msbuild.exe "%SolutionDX12%" /p:Configuration=Release /p:Platform=x64'
- cd ../../..
- mkdir %SampleName%
- copy sample\src\Common bin
- move sample\bin %SampleName%
- move sample\media %SampleName%
- move sample\README.md %SampleName%
- move sample\screenshot.png %SampleName%
- move NOTICES.txt %SampleName%
- echo cd .\%SampleName%\bin\ > %SampleName%_DX12.bat
- echo "Packaging build"
- echo cd .\sample\bin\ > %SampleName%_DX12.bat
- echo start %SampleName%_DX12.exe >> %SampleName%_DX12.bat
artifacts:
name: "%SampleName%-%CI_COMMIT_TAG%"
name: "%SampleName%-%CI_COMMIT_TAG%-%CI_COMMIT_REF_NAME%-%CI_COMMIT_SHORT_SHA%"
paths:
- "%SampleName%/bin/"
- "%SampleName%/media/"
- "%SampleName%/NOTICES.txt"
- "%SampleName%/README.md"
- "%SampleName%/screenshot.png"
- "%SampleName%_DX12.bat"

- NOTICES.txt
- sample/README.md
- sample/screenshot.png
- sample/bin/
- sample/media/
- docs/
- "%SampleName%_DX12.bat"
Binary file added docs/FFX_SSSR_API.pdf
Binary file not shown.
Binary file added docs/FFX_SSSR_GUI.pdf
Binary file not shown.
Binary file added docs/FFX_SSSR_Technology.pdf
Binary file not shown.
82 changes: 41 additions & 41 deletions ffx-sssr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@ project(stochastic-screen-space-reflections)

find_package(PythonInterp 3.6 REQUIRED)

option(SSSR_NO_D3D12 "Stochastic Screen Space Reflections - Skip D3D12 backend" OFF)
option(SSSR_NO_VK "Stochastic Screen Space Reflections - Skip VK backend" OFF)
option(FFX_SSSR_NO_D3D12 "Stochastic Screen Space Reflections - Skip D3D12 backend" OFF)
option(FFX_SSSR_NO_VK "Stochastic Screen Space Reflections - Skip VK backend" OFF)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

@@ -15,39 +15,39 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Werror -std=c++17")
endif()

file(GLOB SSSR_HEADER_FILES
file(GLOB FFX_SSSR_HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/inc/ffx_sssr.h
${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)
file(GLOB SSSR_INLINE_FILES
file(GLOB FFX_SSSR_INLINE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/*.inl)
file(GLOB SSSR_SOURCE_FILES
file(GLOB FFX_SSSR_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
file(GLOB SSSR_SHADER_FILES
file(GLOB FFX_SSSR_SHADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/shaders/*.hlsl)

if(SSSR_NO_D3D12)
if(FFX_SSSR_NO_D3D12)
else()
file(GLOB SSSR_HEADER_FILES_D3D12
file(GLOB FFX_SSSR_HEADER_FILES_D3D12
${CMAKE_CURRENT_SOURCE_DIR}/inc/ffx_sssr_d3d12.h
${CMAKE_CURRENT_SOURCE_DIR}/src/d3d12/*.h)
file(GLOB SSSR_INLINE_FILES_D3D12
file(GLOB FFX_SSSR_INLINE_FILES_D3D12
${CMAKE_CURRENT_SOURCE_DIR}/src/d3d12/*.inl)
file(GLOB SSSR_SOURCE_FILES_D3D12
file(GLOB FFX_SSSR_SOURCE_FILES_D3D12
${CMAKE_CURRENT_SOURCE_DIR}/src/d3d12/*.cpp)
endif()

if(SSSR_NO_VK)
if(FFX_SSSR_NO_VK)
else()
file(GLOB SSSR_HEADER_FILES_VK
file(GLOB FFX_SSSR_HEADER_FILES_VK
${CMAKE_CURRENT_SOURCE_DIR}/inc/ffx_sssr_vk.h
${CMAKE_CURRENT_SOURCE_DIR}/src/vk/*.h)
file(GLOB SSSR_INLINE_FILES_VK
file(GLOB FFX_SSSR_INLINE_FILES_VK
${CMAKE_CURRENT_SOURCE_DIR}/src/vk/*.inl)
file(GLOB SSSR_SOURCE_FILES_VK
file(GLOB FFX_SSSR_SOURCE_FILES_VK
${CMAKE_CURRENT_SOURCE_DIR}/src/vk/*.cpp)
endif()

set(SSSR_HEADER_FILES_SHADERS)
set(FFX_SSSR_HEADER_FILES_SHADERS)

foreach(shaderfile classify_tiles
common
@@ -69,15 +69,15 @@ foreach(shaderfile classify_tiles
"Generate shader header shader_${shaderfile}.h for ${shaderfile}.hlsl"
USES_TERMINAL)

list(APPEND SSSR_HEADER_FILES_SHADERS "${CMAKE_CURRENT_SOURCE_DIR}/shaders/shader_${shaderfile}.h")
list(APPEND FFX_SSSR_HEADER_FILES_SHADERS "${CMAKE_CURRENT_SOURCE_DIR}/shaders/shader_${shaderfile}.h")

endforeach()

add_library(FFX_SSSR
${SSSR_SOURCE_FILES}
${SSSR_SOURCE_FILES_D3D12}
${SSSR_SOURCE_FILES_VK}
${SSSR_HEADER_FILES_SHADERS})
${FFX_SSSR_SOURCE_FILES}
${FFX_SSSR_SOURCE_FILES_D3D12}
${FFX_SSSR_SOURCE_FILES_VK}
${FFX_SSSR_HEADER_FILES_SHADERS})

target_include_directories(FFX_SSSR PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc)
target_include_directories(FFX_SSSR PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
@@ -87,39 +87,39 @@ target_include_directories(FFX_SSSR PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/external
target_include_directories(FFX_SSSR PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/externals/dxc)
target_include_directories(FFX_SSSR PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/externals/samplerCPP)

if(SSSR_NO_D3D12)
target_compile_definitions(FFX_SSSR PRIVATE SSSR_NO_D3D12)
if(FFX_SSSR_NO_D3D12)
target_compile_definitions(FFX_SSSR PRIVATE FFX_SSSR_NO_D3D12)
endif()

if(SSSR_NO_VK)
target_compile_definitions(FFX_SSSR PRIVATE SSSR_NO_VK)
if(FFX_SSSR_NO_VK)
target_compile_definitions(FFX_SSSR PRIVATE FFX_SSSR_NO_VK)
endif()

target_sources(FFX_SSSR PRIVATE
${SSSR_HEADER_FILES}
${SSSR_INLINE_FILES}
${SSSR_SHADER_FILES}
${SSSR_HEADER_FILES_D3D12}
${SSSR_INLINE_FILES_D3D12}
${SSSR_HEADER_FILES_VK}
${SSSR_INLINE_FILES_VK})
${FFX_SSSR_HEADER_FILES}
${FFX_SSSR_INLINE_FILES}
${FFX_SSSR_SHADER_FILES}
${FFX_SSSR_HEADER_FILES_D3D12}
${FFX_SSSR_INLINE_FILES_D3D12}
${FFX_SSSR_HEADER_FILES_VK}
${FFX_SSSR_INLINE_FILES_VK})

source_group("Header Files\\Shaders" FILES ${SSSR_HEADER_FILES_SHADERS})
source_group("Header Files\\Shaders" FILES ${FFX_SSSR_HEADER_FILES_SHADERS})

source_group("Inline Files" FILES ${SSSR_INLINE_FILES})
source_group("Media Files\\Shaders" FILES ${SSSR_SHADER_FILES})
source_group("Inline Files" FILES ${FFX_SSSR_INLINE_FILES})
source_group("Media Files\\Shaders" FILES ${FFX_SSSR_SHADER_FILES})


source_group("Header Files\\D3D12" FILES ${SSSR_HEADER_FILES_D3D12})
source_group("Inline Files\\D3D12" FILES ${SSSR_INLINE_FILES_D3D12})
source_group("Source Files\\D3D12" FILES ${SSSR_SOURCE_FILES_D3D12})
source_group("Header Files\\D3D12" FILES ${FFX_SSSR_HEADER_FILES_D3D12})
source_group("Inline Files\\D3D12" FILES ${FFX_SSSR_INLINE_FILES_D3D12})
source_group("Source Files\\D3D12" FILES ${FFX_SSSR_SOURCE_FILES_D3D12})

source_group("Header Files\\VK" FILES ${SSSR_HEADER_FILES_VK})
source_group("Inline Files\\VK" FILES ${SSSR_INLINE_FILES_VK})
source_group("Source Files\\VK" FILES ${SSSR_SOURCE_FILES_VK})
source_group("Header Files\\VK" FILES ${FFX_SSSR_HEADER_FILES_VK})
source_group("Inline Files\\VK" FILES ${FFX_SSSR_INLINE_FILES_VK})
source_group("Source Files\\VK" FILES ${FFX_SSSR_SOURCE_FILES_VK})

if(MSVC)
set_source_files_properties(${SSSR_SHADER_FILES}
set_source_files_properties(${FFX_SSSR_SHADER_FILES}
PROPERTIES
VS_TOOL_OVERRIDE
"None")
Loading

0 comments on commit b9c98e6

Please sign in to comment.