Skip to content

Commit

Permalink
Falcor 4.0 Preview (#222)
Browse files Browse the repository at this point in the history
* 4.0 dev snapshot
  • Loading branch information
kyaoNV authored Oct 30, 2019
1 parent f2b53b1 commit 48aa4e2
Show file tree
Hide file tree
Showing 916 changed files with 55,089 additions and 56,113 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ charset = utf-8
# Override trailing whitespace setting for Markdown since there it's actually useful
[*.{md}]
trim_trailing_whitespace = false

# Override settings for project files to use the same settings as Visual Studio
[*.{vcxproj,vcxproj.filters}]
indent_size = 2
insert_final_newline = false
24 changes: 6 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,16 @@ Bin/*
*.suo
*.ptx
*.pyc
Falcor.VC.db
FalcorTest.VC.db
Framework/BuildScripts/PatchFalcorProps/PatchFalcorPropertySheet/PatchFalcorPropertySheet.VC.db
*.VC.db
FalcorTest/TestResults/*
Falcor.VC.VC.opendb
*.VC.opendb
.vs/*
.vscode/
*.pyc
*.o
*slang-dump-*

# A bit of a song and dance to ignore all the files
# in the Slang codebase except for the ones we need.
Framework/Externals/slang/*
!Framework/Externals/slang/source/
Framework/Externals/slang/source/**/*.vcxproj
Framework/Externals/slang/source/**/*.filters
Framework/Externals/slang/source/**/*.natvis
!Framework/Externals/slang/source/**/*.cpp
!Framework/Externals/slang/source/**/*.cpp
!Framework/Externals/slang/source/**/*.h
Framework/Externals/*
!Framework/Externals/dear_imgui_addons/
!Framework/Externals/dear_imgui_addons/imguinodegrapheditor/
Source/Externals/.packman/*
Media
/Tests/TestResults/*
/Tests/Solution_BuildLog.txt
/Tests/robocopy.txt
48 changes: 48 additions & 0 deletions Build/deploycommon.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@echo off
setlocal

rem %1 -> Falcor Core Directory Path
rem %2 -> Platform Short Name
rem %3 -> Output Directory
rem %4 -> WINDSDK Directory

setlocal

SET ExtDir=%1\Externals\.packman\
SET OutDir=%3
SET FalcorDir=%1\Falcor\
if not exist "%OutDir%" mkdir "%OutDir%"

rem Copy Falcor's files
IF not exist %OutDir%\Data\ mkdir %OutDir%\Data >nul
IF exist %FalcorDir%\ShadingUtils\ (xcopy %FalcorDir%\ShadingUtils\*.* %OutDir%\Data /s /y /d)
IF exist %FalcorDir%\Raytracing\Data\ (xcopy %FalcorDir%\Raytracing\Data\*.* %OutDir%\Data /s /y /d /q >nul)
call %~dp0\deployproject.bat %FalcorDir% %OutDir%

rem Copy externals
robocopy %ExtDir%\Python\ %OutDir% Python37*.dll /r:0 >nul
robocopy %ExtDir%\Python %OutDir%\Python /E /r:0 >nul
robocopy %ExtDir%\AntTweakBar\lib %OutDir% AntTweakBar64.dll /r:0 >nul
robocopy %ExtDir%\FreeImage %OutDir% freeimage.dll /r:0 >nul
robocopy %ExtDir%\assimp\bin\%2 %OutDir% *.dll /r:0 >nul
robocopy %ExtDir%\FFMpeg\bin\%2 %OutDir% *.dll /r:0 >nul
robocopy %ExtDir%\dxcompiler\%2 %OutDir% dxcompiler.dll /r:0 >nul
rem robocopy %ExtDir%\dxcompiler\windows-x86_64\release\%2 %OutDir% *.dll /r:0 >nul
robocopy %ExtDir%\OptiX\bin64 %OutDir% *.dll /r:0 >nul
robocopy %ExtDir%\openvr\bin\win64 %OutDir% openvr_api.dll /r:0 >nul
robocopy %ExtDir%\Slang\bin\windows-x64\release %OutDir% *.dll /r:0 >nul
robocopy %ExtDir%\GLFW\lib %OutDir% *.dll /r:0 >nul
robocopy %ExtDir%\WinPixEventRuntime\bin\x64 %OutDir% WinPixEventRuntime.dll /r:0 >nul
robocopy "%~4\Redist\D3D\%2" %OutDir% dxil.dll /r:0 >nul

rem Copy NVAPI
set NvApiDir=%ExtDir%\NVAPI
IF exist %NvApiDir% (
IF not exist %OutDir%\Data\NVAPI mkdir %OutDir%\Data\NVAPI >nul
copy /y %NvApiDir%\nvHLSLExtns.h %OutDir%\Data\NVAPI
copy /y %NvApiDir%\nvHLSLExtnsInternal.h %OutDir%\Data\NVAPI
copy /y %NvApiDir%\nvShaderExtnEnums.h %OutDir%\Data\NVAPI
)

rem robocopy sets the error level to something that is not zero even if the copy operation was successful. Set the error level to zero
exit /b 0
7 changes: 7 additions & 0 deletions Build/deployproject.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

rem %1==projectDir %2==outputdir
setlocal

IF not exist %2\Data\ ( mkdir %2\Data >nul )
IF exist %1\data\ ( xcopy %1\Data\*.* %2\Data /s /y /d /q >nul)

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions Build/patchpropssheet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import sys
import os

def patchGroup(propSheet, group, val):
groupStart = "<" + group + ">"
groupEnd = "</" + group + ">"
s = propSheet.find(groupStart)
e = propSheet.find(groupEnd)
if(s == -1 or e == -1):
sys.exit("Can't find a `" + groupStart + "` section in the file. This is probably because someone deleted it for the property sheet. Revert the changes and try again.\n")

if(s >= e):
sys.exit("The property sheet is corrupted. `" + groupEnd + "` can't appear before `" + groupStart + "` \n")

s += len(groupStart)
propSheet = propSheet[:s] + val + propSheet[e:]
return propSheet

if(len(sys.argv) != 4):
sys.exit("Usage:\npatchpropssheet.py <Falcor Core Directory> <Current Solution Directory> <Backend [FALCOR_D3D12, FALCOR_VK]>")

coreDir = sys.argv[1]
solutionDir = sys.argv[2]
backend = sys.argv[3]
propsFileName = coreDir + "\\Falcor\\falcor.props"
# Open and read the file
f = open(propsFileName)
propSheet = f.read()
f.close()

# Get a relative path from the Current Solution Directory to the Falcor Core Directory.
relcorepath = os.path.relpath(coreDir, solutionDir)
coreDir = "$(SolutionDir)\\" + relcorepath

propSheet = patchGroup(propSheet, "FALCOR_CORE_DIRECTORY", coreDir)
propSheet = patchGroup(propSheet, "FALCOR_BACKEND", backend)

# Save the file
f = open(propsFileName, "w")
f.write(propSheet)
f.close()
13 changes: 5 additions & 8 deletions Framework/BuildScripts/prebuild.bat → Build/prebuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,11 @@ if /I "%6"=="ReleaseD3D12" set falcor_backend=FALCOR_D3D12
if /I "%6"=="DebugVK" set falcor_backend=FALCOR_VK
if /I "%6"=="ReleaseVK" set falcor_backend=FALCOR_VK

if /I "%6"=="DebugDXR" set falcor_backend=FALCOR_DXR
if /I "%6"=="ReleaseDXR" set falcor_backend=FALCOR_DXR

rem Change the Props File to Align with the Backend.
rem This also changes the FALCOR_CORE_DIRECTORY
start /wait /b %1BuildScripts\PatchFalcorProps\PatchFalcorPropertySheet.exe %1 %2 %falcor_backend%

rem Call Update Dependencies - Runs packman.
call %1\..\update_dependencies.bat
call %~dp0\update_dependencies.bat %1\Falcor\dependencies.xml
if errorlevel 1 exit /b 1

%1\Externals\.packman\Python\python.exe %~dp0\patchpropssheet.py %1 %2 %falcor_backend%
if errorlevel 1 exit /b 1
if exist %1\Internal\internal_dependencies.xml (call %~dp0\update_dependencies.bat %1\Internal\internal_dependencies.xml)
if errorlevel 1 exit /b 1
10 changes: 10 additions & 0 deletions Build/update_dependencies.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
IF [%1] == [] GOTO helpMsg
set PM_DISABLE_VS_WARNING=true
call "%~dp0packman\packman.cmd " pull "%1" --platform win
if errorlevel 1 exit /b 1
exit /b 0

:helpMsg
echo Please specify a dependency file
exit /b 1
File renamed without changes.
43 changes: 12 additions & 31 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
v3.2.2
------
Bug Fixes:
- Fixed referencing a temporary variable in Vulkan MSAA state creation that causes it to not work on some systems
- Fixed unreachable code when reflecting sample shading configuration
- Fixed comment in Material.h incorrectly describing material channel layout

Dependencies:
- Updates Slang to 0.12.5

v3.2.1
------
WIP
----
- Added `Fbo::create()` which creates a new objects given a list of textures
- Added `RenderContext::clearTexture()` which uses the bind-flag to determin which clear function to call
- Added `Resource::BindFlags::AllColorViews` and `Resource::BindFlags::AllDepthViews`
- `Ctrl+Pause` freezes/unfreezes the renderer. This if useful in low framerates situations when the user wants to change an attribute using the GUI
- File open dialog filters for images now include .hdr files for HDR formats (Bitmap::getFileDialogFilters)
- Added ability to force execution of render passes through a flag when adding the pass to a render graph
- GUI groups can be opened as a separate window by right-clicking on the group header bar
- Added support for sliders in the GUI
- Added support for buttons with images in the GUI (Gui::addImageButton)
- Added option to include a close button when creating GUI windows

New Samples:
- PathTracer: A basic path tracer implemented using DXR and the render graph system

Bug Fixes:
- Messages logged in dll's will no longer output to a separate text file
- Updated make_new_project.py to use Python 3 print()'s
- Python copied from Externals to executable folder after build to be used as Python home directory

Dependencies:
- Updated Slang to 0.11.21
- Added `ComputeContext::dispatchProgram()` - a convenience function to dispatch a compute program without altering the state of context.
- Integration with WinPixEvent
- Refactored `ProgramVars::operator[]` to also work with resources
- New build rule for hlsl and slang files, which will copy them to the `Data` directory while preserving the directory structure
- Packman fetches into Externals/.packman

v3.2
------
Expand All @@ -54,7 +35,7 @@ v3.2
- Renamed getGeometricNormal to getGeometricNormalW to clarify it's in world space
- Loading of GLTF models has been enabled

New Samples:
New samples
- RenderGraphEditor: A visual, node-based tool for creating and editing render graph scripts.
- RenderGraphViewer: Load scenes and render them with a render graph.
- SamplePassLibrary: Demonstration of how to write render passes that compile to DLLs, and how they can be loaded from render graph scripts.
Expand All @@ -70,7 +51,7 @@ Deprecations:

Dependencies:
- Updated packman to 5.7.1
- Updated Slang to 0.11.8
- Updated Slang to 0.11.7
- Updated Falcor Media to 2.2.1

v3.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ Function names should be descriptive
* Function that perform an action should be named after the action it performs - Fbo::clear(), createTextureFromFile().
* Getters/Setters should start with 'get' and 'set'
* Functions names that return a bool should be phrased as a question - isWhite(), doesFileExist(), hasTexture()
Use the following pointers guidelines:
- Every class you add must define a SharedPtr, like so - `using SharedPtr = std::shared_ptr<MyClass>`
- Classes must expose a `SharedPtr create(...);` function. All the class' constructors must be private.
- When writing interfaces:
o Use a raw-pointer/reference if the object is used only during the function's lifetime (i.e. the function doesn't store it in a member variable for future use)
o Use `const SomeObject::SharedPtr&` if the called function takes ownership of the object (i.e. store it in a member variable for future use). The const-ref thing is to avoid incrementing the reference twice (last I checked, the compiler didn't optimize it).
We don't really use unique_ptr. shared_ptr works just fine. Not to say that you can't use unique_ptr, but if you do - you better have a very good reason to do that.
*/

///////////////////////////////// Variable prefixes ////////////////////////////////////
Expand All @@ -39,7 +47,7 @@ In addition 'p' is used for pointers.
//Global Variables:
const uint32_t kConstGlobal; // compile-time-const, so 'k' takes precedence
int32_t gSomeGlobal; // global start with 'g'
static int gStaticGlobal; // Static globals start with 'g'
static int32_t gStaticGlobal; // Static globals start with 'g'
void* gpSomePointer; // Global variables which is a pointer is prefixed with 'gp'
const void* gpPointer2; // Not compile-time constant.

Expand Down
Loading

0 comments on commit 48aa4e2

Please sign in to comment.