summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGangzheng Tong <tonggangzheng@gmail.com>2025-07-10 21:03:54 -0700
committerGitHub <noreply@github.com>2025-07-11 04:03:54 +0000
commit0ddb2fcbbaa5387990c8812341fbe8e2848f8989 (patch)
treea69c16f22d39ffa998e542e591c09aee7a249d8a
parent1eb62804b2c2c1acff94558acc648bb62ea7d051 (diff)
Add slang-gfx build target back for Falcor (#7700)
* Update falcor perf test CI * Add slang-gfx build back since Falcor is still using it * format code (#7704) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
-rw-r--r--.github/workflows/falcor-compiler-perf-test.yml28
-rw-r--r--tools/CMakeLists.txt61
2 files changed, 82 insertions, 7 deletions
diff --git a/.github/workflows/falcor-compiler-perf-test.yml b/.github/workflows/falcor-compiler-perf-test.yml
index 6b2a072de..109230693 100644
--- a/.github/workflows/falcor-compiler-perf-test.yml
+++ b/.github/workflows/falcor-compiler-perf-test.yml
@@ -25,7 +25,7 @@ concurrency:
jobs:
build:
timeout-minutes: 100
- continue-on-error: true
+ continue-on-error: false
strategy:
fail-fast: false
matrix:
@@ -66,7 +66,7 @@ jobs:
-DSLANG_ENABLE_CUDA=1
cmake --workflow --preset "${{matrix.config}}"
- - uses: robinraju/release-downloader@v1.11
+ - uses: robinraju/release-downloader@v1.12
id: download
with:
# The source repository path.
@@ -83,13 +83,10 @@ jobs:
# Supports wildcard pattern (eg: '*', '*.deb', '*.zip' etc..)
fileName: "falcor_perf_test-*-win-64.zip"
- # Download the attached zipball (*.zip)
- zipBall: true
-
# Relative path under $GITHUB_WORKSPACE to place the downloaded file(s)
# It will create the target directory automatically if not present
# eg: out-file-path: "my-downloads" => It will create directory $GITHUB_WORKSPACE/my-downloads
- out-file-path: "./falcor-perf-test"
+ out-file-path: "falcor-perf-test"
# Somehow there is a bug in this flag, the executable extracted is not runnable. We have to
# extract ourselves.
@@ -98,7 +95,24 @@ jobs:
- name: run falcor-compiler-perf-test
shell: pwsh
run: |
+ $ErrorActionPreference = "Stop"
$filename = '${{ fromJson(steps.download.outputs.downloaded_files)[0] }}'
+ # Check if the downloaded file exists
+ if (-not (Test-Path $filename)) {
+ Write-Error "Downloaded file not found: $filename"
+ exit 1
+ }
Expand-Archive $filename -DestinationPath .\falcor-perf-test
$env:PATH = ".\build\${{matrix.config}}\bin;" + $env:PATH
- .\falcor-perf-test\bin\Release\falcor_perftest.exe
+
+ # View current PATH
+ Write-Host "PATH is $env:PATH"
+
+ # Run the executable and check exit code
+ Write-Host "Running falcor performance test..."
+ & .\falcor-perf-test\bin\Release\falcor_perftest.exe
+ if ($LASTEXITCODE -ne 0) {
+ Write-Error "falcor_perftest.exe failed with exit code: $LASTEXITCODE"
+ exit $LASTEXITCODE
+ }
+ Write-Host "falcor performance test completed successfully"
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index a004a87ca..00bd93c49 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -127,6 +127,67 @@ endif()
if(SLANG_ENABLE_GFX)
#
+ # GFX
+ #
+ slang_add_target(
+ gfx
+ ${SLANG_LIB_TYPE}
+ USE_FEWER_WARNINGS
+ LINK_WITH_PRIVATE
+ core
+ slang
+ Vulkan-Headers
+ metal-cpp
+ stb
+ $<$<BOOL:${SLANG_ENABLE_XLIB}>:X11::X11>
+ $<$<BOOL:${SLANG_ENABLE_CUDA}>:CUDA::cuda_driver>
+ $<$<BOOL:${SLANG_ENABLE_NVAPI}>:${NVAPI_LIBRARIES}>
+ LINK_WITH_FRAMEWORK Foundation Cocoa QuartzCore Metal
+ EXTRA_COMPILE_DEFINITIONS_PRIVATE
+ $<$<BOOL:${SLANG_ENABLE_CUDA}>:GFX_ENABLE_CUDA>
+ $<$<BOOL:${SLANG_ENABLE_OPTIX}>:GFX_OPTIX>
+ $<$<BOOL:${SLANG_ENABLE_NVAPI}>:GFX_NVAPI>
+ $<$<BOOL:${SLANG_ENABLE_XLIB}>:SLANG_ENABLE_XLIB>
+ # This is a shared library, so we need to set a preprocessor macro to mark
+ # exported symbols
+ EXPORT_MACRO_PREFIX SLANG_GFX
+ # slang-gfx is in this directory, anything which depends on gfx should include
+ # this
+ INCLUDE_DIRECTORIES_PUBLIC
+ ${slang_SOURCE_DIR}
+ ${slang_SOURCE_DIR}/include
+ if
+ (not ${SLANG_OVERRIDE_SPIRV_TOOLS_PATH})
+ INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR}/external else ()
+ INCLUDE_DIRECTORIES_PUBLIC
+ ${SLANG_OVERRIDE_SPIRV_TOOLS_PATH}
+ endif
+ ()
+ if
+ (not ${SLANG_OVERRIDE_GLM_PATH})
+ INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR}/external else ()
+ INCLUDE_DIRECTORIES_PUBLIC
+ ${SLANG_OVERRIDE_GLM_PATH}
+ endif
+ ()
+ if
+ (not ${SLANG_OVERRIDE_IMGUI_PATH})
+ INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR}/external else ()
+ INCLUDE_DIRECTORIES_PUBLIC
+ ${SLANG_OVERRIDE_IMGUI_PATH}
+ endif
+ ()
+ if
+ (not ${SLANG_OVERRIDE_TINYOBJLOADER_PATH})
+ INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR}/external else ()
+ INCLUDE_DIRECTORIES_PUBLIC ${SLANG_OVERRIDE_TINYOBJLOADER_PATH} endif ()
+ INCLUDE_DIRECTORIES_PRIVATE ${NVAPI_INCLUDE_DIRS}
+ INSTALL
+ EXPORT_SET_NAME SlangTargets
+ FOLDER gfx
+ )
+
+ #
# `platform` contains all the platform abstractions for a GUI application.
#
slang_add_target(