Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 20 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ on:
push:
pull_request:


jobs:
build:
runs-on: windows-2025-vs2026
strategy:
matrix:
configuration: [Debug-D3D12, Debug-Vulkan]

steps:
- name: Checkout repository
Expand Down Expand Up @@ -59,40 +61,42 @@ jobs:
shell: powershell
run: |
msbuild ./projects/modules/modules.vcxproj `
/p:Configuration=Retail /p:Platform=x64 `
/p:Configuration="${{ matrix.configuration }}" /p:Platform=x64 `
/pp:preprocessed.xml
Select-String "_ZVcpkgCurrentInstalledDir" preprocessed.xml | Select-Object -First 5

- name: Build solution
run: msbuild ./projects/spectrum.sln /p:Configuration=Retail /p:Platform=x64 /m /v:minimal

- name: Copy build output to workdir
shell: powershell
run: |
Copy-Item -Path ./bin/Retail/* -Destination ./workdir/ -Recurse -Force
run: msbuild ./projects/spectrum.sln /p:Configuration="${{ matrix.configuration }}" /p:Platform=x64 /m /v:minimal

- name: Upload build artifacts
- name: Upload build output
uses: actions/upload-artifact@v4
if: always()
with:
name: build-output
path: ./workdir/
retention-days: 7
name: build-${{ matrix.configuration }}
path: ./bin/Debug/
retention-days: 1

test:
runs-on: windows-2025-vs2026
needs: build
strategy:
matrix:
configuration: [Debug-D3D12, Debug-Vulkan]

steps:
- name: Download build output
uses: actions/download-artifact@v4
with:
name: build-output
path: ./workdir
name: build-${{ matrix.configuration }}
path: ./bin/Debug

- name: Run tests
shell: powershell
working-directory: ./workdir
working-directory: ./bin/Debug
run: |
& ".\test.exe"
exit $LASTEXITCODE
if ($LASTEXITCODE -ne 0) {
Write-Error "Tests failed with exit code $LASTEXITCODE"
exit $LASTEXITCODE
}
Write-Host "All tests passed!"
28 changes: 28 additions & 0 deletions custom-overlay/directx-dxc/directx-dxc-config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
get_filename_component(_dxc_root "${CMAKE_CURRENT_LIST_DIR}" PATH)
get_filename_component(_dxc_root "${_dxc_root}" PATH)

set(DIRECTX_DXC_TOOL "${_dxc_root}/@tool_path@" CACHE PATH "Location of the dxc tool")
mark_as_advanced(DIRECTX_DXC_TOOL)

add_library(Microsoft::DirectXShaderCompiler SHARED IMPORTED)
set_target_properties(Microsoft::DirectXShaderCompiler PROPERTIES
IMPORTED_CONFIGURATIONS "Debug;Release"
IMPORTED_LOCATION_DEBUG "${_dxc_root}/@dll_debug_dir@/@dll_name_dxc@"
IMPORTED_LOCATION_RELEASE "${_dxc_root}/@dll_dir@/@dll_name_dxc@"
IMPORTED_IMPLIB "${_dxc_root}/lib/@lib_name@"
IMPORTED_SONAME "@lib_name@"
INTERFACE_INCLUDE_DIRECTORIES "${_dxc_root}/include/directx-dxc"
INTERFACE_LINK_LIBRARIES "Microsoft::DXIL"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")

add_library(Microsoft::DXIL SHARED IMPORTED)
set_target_properties(Microsoft::DXIL PROPERTIES
IMPORTED_CONFIGURATIONS "Debug;Release"
IMPORTED_LOCATION_DEBUG "${_dxc_root}/@dll_debug_dir@/@dll_name_dxil@"
IMPORTED_LOCATION_RELASE "${_dxc_root}/@dll_dir@/@dll_name_dxil@"
IMPORTED_IMPLIB "${_dxc_root}/lib/@lib_name@"
IMPORTED_NO_SONAME TRUE
INTERFACE_INCLUDE_DIRECTORIES "${_dxc_root}/include/directx-dxc"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")

unset(_dxc_root)
135 changes: 135 additions & 0 deletions custom-overlay/directx-dxc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled)

# DXC v1.10.2605.24 — "Shader Model 6.10 Preview" (May 2026, patch 1)
# This preview release fixes the nested-struct SPIR-V codegen bug present in
# the v1.9 stable line (OpTypeStruct ID mismatch under ResourceDescriptorHeap).
set(DIRECTX_DXC_TAG v1.10.2605.24)
set(DIRECTX_DXC_VERSION preview_2026_05_22)

if (NOT VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
message(STATUS "Note: ${PORT} always requires dynamic library linkage at runtime.")
endif()

if (VCPKG_TARGET_IS_LINUX)
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/microsoft/DirectXShaderCompiler/releases/download/${DIRECTX_DXC_TAG}/linux_dxc_${DIRECTX_DXC_VERSION}.x86_64.tar.gz"
FILENAME "linux_dxc_${DIRECTX_DXC_VERSION}.tar.gz"
SHA512 0
)
else()
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/microsoft/DirectXShaderCompiler/releases/download/${DIRECTX_DXC_TAG}/dxc_${DIRECTX_DXC_VERSION}.zip"
FILENAME "dxc_${DIRECTX_DXC_VERSION}.zip"
SHA512 0dce57b47a13974ab700615d883c72eb2adcf8e2e7c1b03636ae0e7c2bbcd4b62d69ea9366f47cd80dedbb9d23c0ce1d2c2e92f1a166954b8160c0e61b4116ec
)
endif()

vcpkg_download_distfile(
LICENSE_TXT
URLS "https://raw.githubusercontent.com/microsoft/DirectXShaderCompiler/${DIRECTX_DXC_TAG}/LICENSE.TXT"
FILENAME "LICENSE.${DIRECTX_DXC_VERSION}"
SHA512 9feaa85ca6d42d5a2d6fe773706bbab8241e78390a9d61ea9061c8f0eeb5a3e380ff07c222e02fbf61af7f2b2f6dd31c5fc87247a94dae275dc0a20cdfcc8c9d
)

vcpkg_extract_source_archive(
PACKAGE_PATH
ARCHIVE ${ARCHIVE}
NO_REMOVE_ONE_LEVEL
)

if (VCPKG_TARGET_IS_LINUX)
file(INSTALL
"${PACKAGE_PATH}/include/dxc/dxcapi.h"
"${PACKAGE_PATH}/include/dxc/dxcerrors.h"
"${PACKAGE_PATH}/include/dxc/dxcisense.h"
"${PACKAGE_PATH}/include/dxc/WinAdapter.h"
DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}")

file(INSTALL
"${PACKAGE_PATH}/lib/libdxcompiler.so"
"${PACKAGE_PATH}/lib/libdxil.so"
DESTINATION "${CURRENT_PACKAGES_DIR}/lib")

if(NOT DEFINED VCPKG_BUILD_TYPE)
file(INSTALL
"${PACKAGE_PATH}/lib/libdxcompiler.so"
"${PACKAGE_PATH}/lib/libdxil.so"
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
endif()

file(INSTALL
"${PACKAGE_PATH}/bin/dxc"
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/"
FILE_PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)

set(dll_name_dxc "libdxcompiler.so")
set(dll_name_dxil "libdxil.so")
set(dll_dir "lib")
if(NOT DEFINED VCPKG_BUILD_TYPE)
set(dll_debug_dir "debug/lib")
else()
set(dll_debug_dir "lib")
endif()
set(lib_name "libdxcompiler.so")
set(tool_path "tools/${PORT}/dxc")
else()
# VCPKG_TARGET_IS_WINDOWS
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(DXC_ARCH arm64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(DXC_ARCH x86)
else()
set(DXC_ARCH x64)
endif()

file(INSTALL
"${PACKAGE_PATH}/inc/dxcapi.h"
"${PACKAGE_PATH}/inc/dxcerrors.h"
"${PACKAGE_PATH}/inc/dxcisense.h"
"${PACKAGE_PATH}/inc/d3d12shader.h"
DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}")

file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
if(NOT DEFINED VCPKG_BUILD_TYPE)
file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
endif()

file(INSTALL
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll"
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll"
DESTINATION "${CURRENT_PACKAGES_DIR}/bin")

if(NOT DEFINED VCPKG_BUILD_TYPE)
file(INSTALL
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll"
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll"
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/")

file(INSTALL
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxc.exe"
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll"
"${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll"
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/")

set(dll_name_dxc "dxcompiler.dll")
set(dll_name_dxil "dxil.dll")
set(dll_dir "bin")
set(dll_debug_dir "bin")
set(lib_name "dxcompiler.lib")
set(tool_path "tools/${PORT}/dxc.exe")
endif()

vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")

configure_file("${CMAKE_CURRENT_LIST_DIR}/directx-dxc-config.cmake.in"
"${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake"
@ONLY)

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${LICENSE_TXT}")
6 changes: 6 additions & 0 deletions custom-overlay/directx-dxc/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The DirectX Shader Compiler package provides CMake targets:

find_package(directx-dxc CONFIG REQUIRED)
target_link_libraries(main PRIVATE Microsoft::DirectXShaderCompiler)

The CMake variable DIRECTX_DXC_TOOL is also set to point to the appropriate DXC command-line tool.
24 changes: 24 additions & 0 deletions custom-overlay/directx-dxc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "directx-dxc",
"version-date": "2026-05-27",
"port-version": 1,
"description": "DirectX Shader Compiler v1.10.2605.24 (Shader Model 6.10 Preview)",
"homepage": "https://github.com/microsoft/DirectXShaderCompiler",
"documentation": "https://github.com/microsoft/DirectXShaderCompiler/wiki",
"license": null,
"supports": "(windows & !arm32 & !uwp & !xbox) | (linux & x64)",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "zlib",
"platform": "linux & !static"
}
]
}
Loading
Loading