diff --git a/CMakeLists.txt b/CMakeLists.txt index 572b1c5..8228721 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/apps/LoopThroughWithOpenGLCompositing") set(GPUDIRECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/Blackmagic DeckLink SDK 16.0/Win/Samples/NVIDIA_GPUDirect" CACHE PATH "Path to the NVIDIA_GPUDirect sample directory from the Blackmagic DeckLink SDK") +set(SLANG_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/slang-2026.8-windows-x86_64" CACHE PATH "Path to a Slang binary release containing bin/slangc.exe") if(NOT EXISTS "${APP_DIR}/LoopThroughWithOpenGLCompositing.cpp") message(FATAL_ERROR "Imported app sources were not found under ${APP_DIR}") @@ -17,6 +18,23 @@ if(NOT EXISTS "${GPUDIRECT_DIR}/lib/x64/dvp.lib") message(FATAL_ERROR "NVIDIA GPUDirect library not found under ${GPUDIRECT_DIR}") endif() +set(SLANG_RUNTIME_FILES + "${SLANG_ROOT}/bin/slangc.exe" + "${SLANG_ROOT}/bin/slang-compiler.dll" + "${SLANG_ROOT}/bin/slang-glslang.dll" +) + +foreach(SLANG_RUNTIME_FILE IN LISTS SLANG_RUNTIME_FILES) + if(NOT EXISTS "${SLANG_RUNTIME_FILE}") + message(FATAL_ERROR "Required Slang runtime file not found: ${SLANG_RUNTIME_FILE}") + endif() +endforeach() + +set(SLANG_LICENSE_FILE "${SLANG_ROOT}/LICENSE") +if(NOT EXISTS "${SLANG_LICENSE_FILE}") + message(FATAL_ERROR "Slang license file not found: ${SLANG_LICENSE_FILE}") +endif() + set(APP_SOURCES "${APP_DIR}/ControlServer.cpp" "${APP_DIR}/ControlServer.h" @@ -161,6 +179,15 @@ install(FILES "${GPUDIRECT_DIR}/bin/x64/dvp.dll" DESTINATION "." ) +install(FILES ${SLANG_RUNTIME_FILES} + DESTINATION "3rdParty/slang/bin" +) + +install(FILES "${SLANG_LICENSE_FILE}" + DESTINATION "third_party_notices" + RENAME "SLANG_LICENSE.txt" +) + install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/config/" DESTINATION "config" ) diff --git a/README.md b/README.md index e6b8156..69fdf97 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The app loads shader packages from `shaders/`, compiles Slang to GLSL at runtime - CMake 3.24 or newer. - Node.js and npm for the control UI. - Blackmagic DeckLink SDK 16.0 with the NVIDIA GPUDirect sample files available locally. -- Slang compiler available under the repo/tooling paths expected by the runtime, or otherwise discoverable by the existing app setup. +- Slang binary release with `slangc.exe`, `slang-compiler.dll`, `slang-glslang.dll`, and `LICENSE`. The Blackmagic/GPUDirect SDK should not be committed to this repository. `CMakeLists.txt` exposes `GPUDIRECT_DIR` as a cache path so local machines and CI runners can point at their installed SDK location. @@ -37,6 +37,18 @@ Override example: cmake --preset vs2022-x64-debug -DGPUDIRECT_DIR="D:/SDKs/Blackmagic DeckLink SDK 16.0/Win/Samples/NVIDIA_GPUDirect" ``` +Default expected Slang path: + +```text +3rdParty/slang-2026.8-windows-x86_64 +``` + +Override example: + +```powershell +cmake --preset vs2022-x64-debug -DSLANG_ROOT="D:/SDKs/slang-2026.8-windows-x86_64" +``` + ## Build Configure and build the native app: @@ -78,11 +90,15 @@ dist/VideoShader/ dvp.dll config/ shaders/ + 3rdParty/slang/bin/ ui/dist/ runtime/templates/ + third_party_notices/ ``` -You can run `LoopThroughWithOpenGLCompositing.exe` directly from that folder. In packaged mode, the app resolves `config/`, `shaders/`, `ui/dist/`, and `runtime/templates/` relative to the exe folder. In development mode, it still falls back to repo-root discovery. +You can run `LoopThroughWithOpenGLCompositing.exe` directly from that folder. In packaged mode, the app resolves `config/`, `shaders/`, `3rdParty/slang/bin/slangc.exe`, `ui/dist/`, and `runtime/templates/` relative to the exe folder. In development mode, it still falls back to repo-root discovery. + +The install step copies only the Slang runtime files required by the shader compiler (`slangc.exe`, `slang-compiler.dll`, and `slang-glslang.dll`) plus `third_party_notices/SLANG_LICENSE.txt`. It does not copy the full Slang release folder. Create a zip for distribution: