-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a perf test for slang spirv-direct
Implement a perf test for measuring the Vulkan compiles the spirv code generated by slang's glslang backedn and spirv-direct backend. All the shaders and host code are copied from Nvidia's Falcor project. The host code are extremely simplified and trimmed to focus on the shader compile of one specific render pass while keeps the same workflow of how Falcor does the compile. Add cmake file Add cmake build system supports. Add simple readme Add implementation of IPipelineCreationAPIDispatcher Because slang-gfx doesn't provide a fine granularity APIs such that we can time the spirv generation phase and Vulkan pipeline creation phase, we have to use gfx::IPipelineCreationAPIDispatcher callback interface so that the gfx will call it when creating pipeline. We simply call Vulkan pipeline creation inside the callback function and measure the time so that we can get the time of Vulkan driver compiling the spirv code. Create linux-x86_64.yml Update linux-x86_64.yml minor fixes remove internal code update the dependency packages Change the package from vulkansdk to vulkan headers since to build the app we only need vulkan headers. Vulkan loader is loaded at runtime. Change SLANG_UUID_IPipelineCreationAPIDispatcher to SLANG_UUID_IVulkanPipelineCreationAPIDispatcher since slang v2024.0.4. Add windows build workflow Add workflow for uploading release package Remove RUNPATH from executable Change release-linux workflow to build a release version Add release-windows workflow to upload binary
- Loading branch information
1 parent
d9e6e40
commit d6a3123
Showing
478 changed files
with
75,007 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: build-linux-x86_64 | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install prerequisite | ||
run: sudo apt-get install ninja-build | ||
- name: configure | ||
run: cmake --preset linux-gcc | ||
- name: make | ||
run: cmake --build build/linux-gcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: release-linux | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install prerequisite | ||
run: sudo apt-get install ninja-build | ||
- name: configure | ||
run: cmake --preset linux-gcc | ||
- name: build release package | ||
id: build | ||
run: | | ||
echo "starting to build..." | ||
cmake --build build/linux-gcc --config Release | ||
export TAG_NAME=`git describe --tags` | ||
echo "tag:$TAG_NAME" | ||
export OS_NAME=linux | ||
export ARCH_NAME=`uname -p` | ||
export FALCOR_PERF_TEST_PACKAGE=falcor_perf_test-${TAG_NAME}-${OS_NAME}-${ARCH_NAME}.zip | ||
echo "creating zip at ${FALCOR_PERF_TEST_PACKAGE}" | ||
zip -r ${FALCOR_PERF_TEST_PACKAGE} build/linux-gcc/bin/Release/* | ||
echo "FALCOR_PERF_TEST_PACKAGE=${FALCOR_PERF_TEST_PACKAGE}" >> $GITHUB_OUTPUT | ||
- name: Upload Assert | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
${{ steps.build.outputs.FALCOR_PERF_TEST_PACKAGE }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: release-win64 | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Ninja | ||
uses: ashutoshvarma/setup-ninja@master | ||
with: | ||
# ninja version to download. Default: 1.10.0 | ||
version: 1.10.0 | ||
|
||
- name: configure | ||
run: cmake --preset windows-ninja-msvc | ||
- name: make | ||
id: build | ||
run: | | ||
echo "build app" | ||
cmake --build build/windows-ninja-msvc --config Release | ||
$tagName = & git describe --tags | ||
$binArchive = "falcor_perf_test-$tagName-win-64.zip" | ||
echo "package name=$binArchive" | ||
echo "FALCOR_PERF_TEST_PACKAGE=$binArchive" >> $env:GITHUB_OUTPUT | ||
7z a "$binArchive" build/windows-ninja-msvc/bin/Release/* | ||
- name: UploadBinary | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
${{ steps.build.outputs.FALCOR_PERF_TEST_PACKAGE }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: build-win64 | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Ninja | ||
uses: ashutoshvarma/setup-ninja@master | ||
with: | ||
# ninja version to download. Default: 1.10.0 | ||
version: 1.10.0 | ||
|
||
- name: configure | ||
run: cmake --preset windows-ninja-msvc | ||
- name: make | ||
run: cmake --build build/windows-ninja-msvc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
external/packman | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
cmake_policy(SET CMP0077 NEW) | ||
cmake_policy(SET CMP0091 NEW) | ||
cmake_policy(SET CMP0104 NEW) | ||
cmake_policy(SET CMP0057 NEW) | ||
|
||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) | ||
|
||
project(Falcor | ||
DESCRIPTION "Falcor Perf-Test" | ||
LANGUAGES CXX C | ||
) | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Check platform | ||
# ----------------------------------------------------------------------------- | ||
|
||
if(${CMAKE_SYSTEM_NAME} MATCHES "Window") | ||
set(FALCOR_PLATFORM "Windows") | ||
set(FALCOR_WINDOWS TRUE) | ||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||
set(FALCOR_PLATFORM "Linux") | ||
set(FALCOR_LINUX TRUE) | ||
else() | ||
message(FATAL_ERROR "Unsupported platform!") | ||
endif() | ||
message(STATUS "Platform: ${FALCOR_PLATFORM}") | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Packman | ||
# ----------------------------------------------------------------------------- | ||
|
||
# Falcor uses packman to pull binary dependencies. We need to pull the dependencies | ||
# before CMake starts configuring the project as some of the configuration relies | ||
# on these dependencies being available. We also add additional targets to pull | ||
# the dependencies when the project is built such that they are updated automatically | ||
# if the manifest files change. | ||
|
||
if(FALCOR_WINDOWS) | ||
set(PACKMAN "${CMAKE_SOURCE_DIR}/tools/packman/packman.cmd") | ||
set(PACKMAN_PLATFORM "windows-x86_64") | ||
elseif(FALCOR_LINUX) | ||
set(PACKMAN "${CMAKE_SOURCE_DIR}/tools/packman/packman") | ||
set(PACKMAN_PLATFORM "linux-x86_64") | ||
endif() | ||
|
||
# Pull dependencies at configure time. | ||
message(STATUS "Updating packman dependencies ...") | ||
execute_process( | ||
COMMAND ${PACKMAN} pull ${CMAKE_SOURCE_DIR}/dependencies.xml --platform ${PACKMAN_PLATFORM} | ||
COMMAND_ERROR_IS_FATAL ANY | ||
) | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Global setup | ||
# ----------------------------------------------------------------------------- | ||
|
||
# Require builds to be outside of source tree. | ||
file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH) | ||
if(EXISTS "${LOC_PATH}") | ||
message(FATAL_ERROR "You cannot build in a source directory (or any directory with a CMakeLists.txt file). Please use a build directory instead.") | ||
endif() | ||
|
||
# Enable folders (for Visual Studio). | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
|
||
# Setup available build configurations. | ||
if(NOT SETUP_CONFIGURATION_TYPES) | ||
set(SETUP_CONFIGURATION_TYPES 1) | ||
|
||
if(CMAKE_CONFIGURATION_TYPES) | ||
# multi config generator | ||
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) | ||
else() | ||
# single config generator | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY HELPSTRING "Choose the type of build") | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release") | ||
endif() | ||
endif() | ||
|
||
set(FALCOR_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
set(FALCOR_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
||
if(CMAKE_CONFIGURATION_TYPES) | ||
set(FALCOR_OUTPUT_DIRECTORY ${FALCOR_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>) | ||
else() | ||
set(FALCOR_OUTPUT_DIRECTORY ${FALCOR_RUNTIME_OUTPUT_DIRECTORY}) | ||
endif() | ||
|
||
set(FALCOR_SHADER_OUTPUT_DIRECTORY ${FALCOR_OUTPUT_DIRECTORY}/shaders) | ||
|
||
# # ----------------------------------------------------------------------------- | ||
# # External dependencies | ||
# # ----------------------------------------------------------------------------- | ||
# | ||
add_subdirectory(external) | ||
|
||
# | ||
# ----------------------------------------------------------------------------- | ||
# Packman dependencies | ||
# ----------------------------------------------------------------------------- | ||
|
||
add_custom_target(packman_dependencies DEPENDS packman_dependencies_stamp) | ||
set_target_properties(packman_dependencies PROPERTIES FOLDER "Misc") | ||
add_custom_command( | ||
OUTPUT packman_dependencies_stamp | ||
COMMAND ${PACKMAN} pull ${CMAKE_SOURCE_DIR}/dependencies.xml --platform ${PACKMAN_PLATFORM} | ||
COMMAND ${CMAKE_COMMAND} -E touch packman_dependencies_stamp | ||
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/dependencies.xml | ||
COMMENT "Updating packman dependencies" | ||
) | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Shader file handling | ||
# ----------------------------------------------------------------------------- | ||
|
||
# Setup build rules to copy all shaders of a target to the output directory. | ||
# The specified output_dir is relative to the global shader output directory (FALCOR_SHADER_OUTPUT_DIRECTORY). | ||
function(target_copy_shaders target source_dir output_dir) | ||
|
||
get_target_property(target_source_dir ${target} SOURCE_DIR) | ||
|
||
# Create custom commands for copying shader sources. | ||
set(src_file ${target_source_dir}/${source_dir}) | ||
|
||
add_custom_command( | ||
TARGET ${target} | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${src_file} ${FALCOR_SHADER_OUTPUT_DIRECTORY} | ||
COMMENT "${target}: Copying shader ${source_dir}" | ||
) | ||
endfunction() | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Project sources | ||
# ----------------------------------------------------------------------------- | ||
|
||
add_subdirectory(source) |
Oops, something went wrong.