diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..0f45ee9 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,40 @@ +name: CI + +on: [push] + +jobs: + build: + name: Build + runs-on: windows-2022 + steps: + - name: Sync + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: Configure + shell: pwsh + run: cmake -S . -B build + + - name: Build Debug + shell: pwsh + run: cmake --build build --config Debug + + - name: Upload Debug artifacts + uses: actions/upload-artifact@v4 + with: + name: D3d12info - Debug + path: ./build/Debug/ + + - name: Build Release + shell: pwsh + run: cmake --build build --config Release + + - name: Upload Release artifacts + uses: actions/upload-artifact@v4 + with: + name: D3d12info - Release + path: | + ./build/Release/ + ! ./build/Release/*.lib + ! ./build/Release/*.exp diff --git a/.github/workflows/Package.yml b/.github/workflows/Package.yml new file mode 100644 index 0000000..2880213 --- /dev/null +++ b/.github/workflows/Package.yml @@ -0,0 +1,76 @@ +name: Package + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +permissions: + id-token: write + contents: read + +jobs: + package: + name: Package + runs-on: windows-2022 + environment: production + steps: + - name: Azure login + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Sync + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: Configure + shell: pwsh + run: cmake -S . -B build + + - name: Build Release + shell: pwsh + run: cmake --build build --config Release + + - name: Sign with Trusted Signing + uses: azure/trusted-signing-action@v0.5.0 + with: + endpoint: https://eus.codesigning.azure.net/ + trusted-signing-account-name: dmytro-bulatov-sign + certificate-profile-name: dmytro-bulatov + files: | + ${{ github.workspace }}/build/Release/D3d12info.exe + ${{ github.workspace }}/build/Release/D3d12info_preview.exe + file-digest: SHA256 + timestamp-rfc3161: http://timestamp.acs.microsoft.com + timestamp-digest: SHA256 + exclude-environment-credential: true + exclude-workload-identity-credential: true + exclude-managed-identity-credential: true + exclude-shared-token-cache-credential: true + exclude-visual-studio-credential: true + exclude-visual-studio-code-credential: true + exclude-azure-cli-credential: false + exclude-azure-powershell-credential: true + exclude-azure-developer-cli-credential: true + exclude-interactive-browser-credential: true + + - name: Prepare Package + shell: pwsh + run: | + $PackagePath = "./package/D3d12info" + New-Item -ItemType Directory -Path $PackagePath + Copy-Item -Path "./build/Release/*" -Destination $PackagePath -Recurse -Exclude *.lib, *.exp + Copy-Item -Path "./LICENSE.txt" -Destination $PackagePath + Copy-Item -Path "./CHANGELOG.md" -Destination $PackagePath + Copy-Item -Path "./D3d12info on GitHub.url" -Destination $PackagePath + + - name: Upload Package + uses: actions/upload-artifact@v4 + with: + name: D3d12info + path: ./package/ + compression-level: 9 diff --git a/.gitignore b/.gitignore index 84c048a..83b4f06 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /build/ +/package/ diff --git a/.gitmodules b/.gitmodules index 4d646e1..98a8da7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "Src/ThirdParty/AGS_SDK"] path = Src/ThirdParty/AGS_SDK url = https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK.git +[submodule "Src/ThirdParty/Vulkan-Headers"] + path = Src/ThirdParty/Vulkan-Headers + url = https://github.com/KhronosGroup/Vulkan-Headers.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 54ac13d..2e68160 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,18 +43,17 @@ else() message(STATUS "NVAPI library not used.") endif() -option(ENABLE_VULKAN "Enables usage of Vulkan SDK." ON) +option(ENABLE_VULKAN "Enables usage of Vulkan." ON) if(ENABLE_VULKAN) - # 1.3.231 is oldest tested Vulkan SDK version - # if Cmake finds older version, it will print warning and set Vulkan_FOUND to false - find_package(Vulkan 1.3.231) - if (Vulkan_FOUND) - message(STATUS "Vulkan SDK found. Include directory is \"${Vulkan_INCLUDE_DIRS}\".") + if(EXISTS "${PROJECT_SOURCE_DIR}/Src/ThirdParty/Vulkan-Headers/CMakeLists.txt") + message(STATUS "Vulkan library used.") + add_subdirectory("${PROJECT_SOURCE_DIR}/Src/ThirdParty/Vulkan-Headers" Vulkan-Headers) else() - message(STATUS "Vulkan SDK not found. Please install Vulkan SDK or set ENABLE_VULKAN to OFF.") + message(STATUS "Vulkan library not found. This is likely due to missing submodule. Please initialize submodules or set ENABLE_VULKAN to OFF.") + set(ENABLE_VULKAN OFF) endif() else() - message(STATUS "Vulkan SDK not used.") + message(STATUS "Vulkan library not used.") endif() option(ENABLE_INTEL_GPUDETECT "Enable usage of Intel GPU Detect library." ON) @@ -119,10 +118,9 @@ function(add_my_executable USE_PREVIEW_AGILITY_SDK) target_link_libraries(${EXE_NAME} PRIVATE "${PROJECT_SOURCE_DIR}/Src/ThirdParty/nvapi/amd64/nvapi64.lib") endif() - if (Vulkan_FOUND) + if (ENABLE_VULKAN) target_compile_definitions(${EXE_NAME} PRIVATE USE_VULKAN=1) - target_include_directories(${EXE_NAME} PRIVATE ${Vulkan_INCLUDE_DIRS}) - target_link_libraries(${EXE_NAME} PRIVATE ${Vulkan_LIBRARIES}) + target_link_libraries(${EXE_NAME} PRIVATE Vulkan::Headers) endif() if(ENABLE_INTEL_GPUDETECT) diff --git a/README.md b/README.md index a2d7847..25b6efd 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,6 @@ It uses following thirt-party libraries: - **[Intel GPU Detect](https://github.com/GameTechDev/gpudetect)** - custom vendor extensions to graphics APIs by Intel. License: Apache 2.0. - Linked via submodule. - Optional, controlled by Cmake variable `ENABLE_INTEL_GPUDETECT` - on by default. -- **[Vulkan SDK](https://www.lunarg.com/vulkan-sdk/)** - - Linked externally. Cmake automatically detects Vulkan SDK path. +- **[Vulkan Headers](https://github.com/KhronosGroup/Vulkan-Headers)** + - Linked via submodule. - Optional, controlled by Cmake variable `ENABLE_VULKAN` - on by default. diff --git a/Src/ThirdParty/Vulkan-Headers b/Src/ThirdParty/Vulkan-Headers new file mode 160000 index 0000000..98f440c --- /dev/null +++ b/Src/ThirdParty/Vulkan-Headers @@ -0,0 +1 @@ +Subproject commit 98f440ce6868c94f5ec6e198cc1adda4760e8849