From ef3c22a08d07607d5bfb8348e3996438a737f18e Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Fri, 30 Aug 2024 12:36:33 -0700 Subject: [PATCH 01/18] Fixed -Wsign-conversion with clang --- DirectXTex/DirectXTexDDS.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DirectXTex/DirectXTexDDS.cpp b/DirectXTex/DirectXTexDDS.cpp index de5deb08..91a1f9b6 100644 --- a/DirectXTex/DirectXTexDDS.cpp +++ b/DirectXTex/DirectXTexDDS.cpp @@ -1369,8 +1369,8 @@ namespace int8_t v = ((((t >> 5) & 0x1f) ^ m) - m) + 16; int8_t u = (((t & 0x1f) ^ m) - m) + 16; - uint32_t t2 = u << 3 | u >> 2; - uint32_t t3 = v << 3 | v >> 2; + auto t2 = static_cast(u << 3 | u >> 2); + auto t3 = static_cast(v << 3 | v >> 2); *(dPtr++) = t1 | (t2 << 8) | (t3 << 16) | 0xff000000; } From 460d3b27a7a18c84f59d01ffb465edcb1b6e7f3d Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Fri, 30 Aug 2024 12:38:55 -0700 Subject: [PATCH 02/18] Update YAML for ADO triggers --- build/DirectXTex-GitHub-CMake-Xbox-Dev17.yml | 1 + build/DirectXTex-GitHub-Dev17.yml | 1 + build/DirectXTex-GitHub-GDK-Dev17.yml | 1 + build/DirectXTex-GitHub-Test-Dev17.yml | 1 + build/DirectXTex-GitHub-Test.yml | 1 + build/DirectXTex-GitHub.yml | 1 + 6 files changed, 6 insertions(+) diff --git a/build/DirectXTex-GitHub-CMake-Xbox-Dev17.yml b/build/DirectXTex-GitHub-CMake-Xbox-Dev17.yml index 995f8bde..a1beda21 100644 --- a/build/DirectXTex-GitHub-CMake-Xbox-Dev17.yml +++ b/build/DirectXTex-GitHub-CMake-Xbox-Dev17.yml @@ -24,6 +24,7 @@ pr: - build/*.cmake - build/*.in - build/DirectXTex-GitHub-CMake-Xbox-Dev17.yml + - DirectXTex/Shaders/CompileShaders.cmd resources: repositories: diff --git a/build/DirectXTex-GitHub-Dev17.yml b/build/DirectXTex-GitHub-Dev17.yml index 5a39c051..2660d8dc 100644 --- a/build/DirectXTex-GitHub-Dev17.yml +++ b/build/DirectXTex-GitHub-Dev17.yml @@ -21,6 +21,7 @@ pr: paths: include: - build/DirectXTex-GitHub-Dev17.yml + - DirectXTex/Shaders/CompileShaders.cmd resources: repositories: diff --git a/build/DirectXTex-GitHub-GDK-Dev17.yml b/build/DirectXTex-GitHub-GDK-Dev17.yml index df93d41a..ffd57a8c 100644 --- a/build/DirectXTex-GitHub-GDK-Dev17.yml +++ b/build/DirectXTex-GitHub-GDK-Dev17.yml @@ -25,6 +25,7 @@ pr: - build/*.in - build/*.cmake - build/SetupBWOI.* + - DirectXTex/Shaders/CompileShaders.cmd resources: repositories: diff --git a/build/DirectXTex-GitHub-Test-Dev17.yml b/build/DirectXTex-GitHub-Test-Dev17.yml index e02d00f9..d97cf6b4 100644 --- a/build/DirectXTex-GitHub-Test-Dev17.yml +++ b/build/DirectXTex-GitHub-Test-Dev17.yml @@ -21,6 +21,7 @@ pr: paths: include: - build/DirectXTex-GitHub-Test-Dev17.yml + - DirectXTex/Shaders/CompileShaders.cmd resources: repositories: diff --git a/build/DirectXTex-GitHub-Test.yml b/build/DirectXTex-GitHub-Test.yml index 212322c7..208a7c8b 100644 --- a/build/DirectXTex-GitHub-Test.yml +++ b/build/DirectXTex-GitHub-Test.yml @@ -21,6 +21,7 @@ pr: paths: include: - build/DirectXTex-GitHub-Test.yml + - DirectXTex/Shaders/CompileShaders.cmd resources: repositories: diff --git a/build/DirectXTex-GitHub.yml b/build/DirectXTex-GitHub.yml index 79f4f523..4aa756d6 100644 --- a/build/DirectXTex-GitHub.yml +++ b/build/DirectXTex-GitHub.yml @@ -21,6 +21,7 @@ pr: paths: include: - build/DirectXTex-GitHub.yml + - DirectXTex/Shaders/CompileShaders.cmd resources: repositories: From 608e626d9f2dc98e9c22ae0b7a9e6f86df4af66e Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Fri, 30 Aug 2024 15:12:15 -0700 Subject: [PATCH 03/18] Minor YAML update --- build/DirectXTex-GitHub-Test-Dev17.yml | 1 - build/DirectXTex-GitHub-Test.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/build/DirectXTex-GitHub-Test-Dev17.yml b/build/DirectXTex-GitHub-Test-Dev17.yml index d97cf6b4..e02d00f9 100644 --- a/build/DirectXTex-GitHub-Test-Dev17.yml +++ b/build/DirectXTex-GitHub-Test-Dev17.yml @@ -21,7 +21,6 @@ pr: paths: include: - build/DirectXTex-GitHub-Test-Dev17.yml - - DirectXTex/Shaders/CompileShaders.cmd resources: repositories: diff --git a/build/DirectXTex-GitHub-Test.yml b/build/DirectXTex-GitHub-Test.yml index 208a7c8b..212322c7 100644 --- a/build/DirectXTex-GitHub-Test.yml +++ b/build/DirectXTex-GitHub-Test.yml @@ -21,7 +21,6 @@ pr: paths: include: - build/DirectXTex-GitHub-Test.yml - - DirectXTex/Shaders/CompileShaders.cmd resources: repositories: From 8d81eff0025de4a2d2919c19214ed9204c7edff8 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Fri, 30 Aug 2024 15:18:18 -0700 Subject: [PATCH 04/18] Update CMake to specify FXC.EXE to use --- CMakeLists.txt | 9 ++++++--- DirectXTex/Shaders/CompileShaders.cmd | 11 +++++++++++ build/CompilerAndLinker.cmake | 7 +++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f240c67..76d2a98e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,7 @@ if((DEFINED XBOX_CONSOLE_TARGET) AND (NOT (XBOX_CONSOLE_TARGET STREQUAL "durango endif() include(GNUInstallDirs) +include(build/CompilerAndLinker.cmake) #--- Library set(LIBRARY_HEADERS @@ -197,12 +198,16 @@ if(BUILD_DX11 AND WIN32) list(APPEND LIBRARY_SOURCES ${COMPILED_SHADERS}/BC6HEncode_EncodeBlockCS.inc) if(NOT USE_PREBUILT_SHADERS) + find_program(DIRECTX_FXC_TOOL FXC.EXE + HINTS "C:/Program Files (x86)/Windows Kits/10/bin/${CMAKE_SYSTEM_VERSION}/${DIRECTX_HOST_ARCH}" + "C:/Program Files (x86)/Windows Kits/10/bin/${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}/${DIRECTX_HOST_ARCH}") + message(STATUS "Using LegacyShaderCompiler found in ${DIRECTX_FXC_TOOL}") add_custom_command( OUTPUT "${COMPILED_SHADERS}/BC6HEncode_EncodeBlockCS.inc" MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/DirectXTex/Shaders/CompileShaders.cmd" DEPENDS ${SHADER_SOURCES} COMMENT "Generating HLSL shaders..." - COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_SHADERS}" CompileShaders.cmd > "${COMPILED_SHADERS}/compileshaders.log" + COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_SHADERS}" $<$:LegacyShaderCompiler=${DIRECTX_FXC_TOOL}> CompileShaders.cmd > "${COMPILED_SHADERS}/compileshaders.log" WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/DirectXTex/Shaders" USES_TERMINAL) endif() @@ -520,8 +525,6 @@ if(MSVC) endif() endif() -include(build/CompilerAndLinker.cmake) - foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_definitions(${t} PRIVATE ${COMPILER_DEFINES}) target_compile_options(${t} PRIVATE ${COMPILER_SWITCHES}) diff --git a/DirectXTex/Shaders/CompileShaders.cmd b/DirectXTex/Shaders/CompileShaders.cmd index 14a599bb..43144065 100644 --- a/DirectXTex/Shaders/CompileShaders.cmd +++ b/DirectXTex/Shaders/CompileShaders.cmd @@ -9,6 +9,7 @@ if %PROCESSOR_ARCHITECTURE%.==ARM64. (set FXCARCH=arm64) else (if %PROCESSOR_ARC set FXCOPTS=/nologo /WX /Ges /Zi /Zpc /Qstrip_reflect /Qstrip_debug +if defined LegacyShaderCompiler goto fxcviaenv set PCFXC="%WindowsSdkVerBinPath%%FXCARCH%\fxc.exe" if exist %PCFXC% goto continue set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\%FXCARCH%\fxc.exe" @@ -17,6 +18,12 @@ set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\%FXCARCH%\fxc.exe" if exist %PCFXC% goto continue set PCFXC=fxc.exe +goto continue + +:fxcviaenv +set PCFXC="%LegacyShaderCompiler%" +if not exist %PCFXC% goto needfxc +goto continue :continue if not defined CompileShadersOutput set CompileShadersOutput=Compiled @@ -54,3 +61,7 @@ echo %fxc% echo %fxc4% %fxc4% || set error=1 exit /b + +:needfxc +echo ERROR: CompileShaders requires FXC.EXE +exit /b 1 diff --git a/build/CompilerAndLinker.cmake b/build/CompilerAndLinker.cmake index 1826feb8..6fb54475 100644 --- a/build/CompilerAndLinker.cmake +++ b/build/CompilerAndLinker.cmake @@ -32,6 +32,13 @@ elseif(CMAKE_VS_PLATFORM_NAME_DEFAULT MATCHES "^[Aa][Rr][Mm]64EC$") set(DIRECTX_ARCH arm64ec) endif() +#--- Determines host architecture +if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "[Aa][Rr][Mm]64|aarch64|arm64") + set(DIRECTX_HOST_ARCH arm64) +else() + set(DIRECTX_HOST_ARCH x64) +endif() + #--- Build with Unicode Win32 APIs per "UTF-8 Everywhere" if(WIN32) list(APPEND COMPILER_DEFINES _UNICODE UNICODE) From 8648353a5dc71bcd3ab5d0fbcb7b4fdecbb7376f Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 11:51:11 -0700 Subject: [PATCH 05/18] Minor CMake code review --- CMakeLists.txt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76d2a98e..3b80eb0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,16 +143,17 @@ elseif((BUILD_XBOX_EXTS_XBOXONE OR BUILD_XBOX_EXTS_SCARLETT) AND WIN32) Auxiliary/DirectXTexXboxTile.cpp) endif() -set(SHADER_SOURCES - DirectXTex/Shaders/BC6HEncode.hlsl - DirectXTex/Shaders/BC7Encode.hlsl) -if(BUILD_DX11 AND WIN32) - list(APPEND LIBRARY_SOURCES - DirectXTex/BCDirectCompute.h - DirectXTex/BCDirectCompute.cpp - DirectXTex/DirectXTexCompressGPU.cpp - DirectXTex/DirectXTexD3D11.cpp) +if(BUILD_DX11 AND WIN32 AND (NOT (XBOX_CONSOLE_TARGET STREQUAL "durango"))) + set(SHADER_SOURCES + DirectXTex/Shaders/BC6HEncode.hlsl + DirectXTex/Shaders/BC7Encode.hlsl) + + list(APPEND LIBRARY_SOURCES + DirectXTex/BCDirectCompute.h + DirectXTex/BCDirectCompute.cpp + DirectXTex/DirectXTexCompressGPU.cpp + DirectXTex/DirectXTexD3D11.cpp) endif() if(BUILD_DX12) @@ -184,7 +185,7 @@ if(ENABLE_LIBPNG_SUPPORT) list(APPEND LIBRARY_SOURCES Auxiliary/DirectXTexPNG.cpp) endif() -if(BUILD_DX11 AND WIN32) +if(BUILD_DX11 AND WIN32 AND (NOT (XBOX_CONSOLE_TARGET STREQUAL "durango"))) if(NOT COMPILED_SHADERS) if(USE_PREBUILT_SHADERS) message(FATAL_ERROR "ERROR: Using prebuilt shaders requires the COMPILED_SHADERS variable is set") From 6d0fd3396884698e8fe9e9d5b538413aeb510e01 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 12:23:22 -0700 Subject: [PATCH 06/18] Add coverage of libpng/libjpeg to GH actions --- .github/workflows/test.yml | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 330494e9..93b56895 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -91,9 +91,45 @@ jobs: with: arch: ${{ matrix.arch }} + - name: 'Set triplet' + shell: pwsh + run: | + if ("${{ matrix.arch }}" -eq "amd64") + { + echo "VCPKG_DEFAULT_TRIPLET=x64-windows" >> $env:GITHUB_ENV + } + elseif ("${{ matrix.arch }}" -eq "amd64_x86") + { + echo "VCPKG_DEFAULT_TRIPLET=x86-windows" >> $env:GITHUB_ENV + } + elseif ("${{ matrix.arch }}" -eq "amd64_arm64") + { + if ("${{ matrix.build_type }}" -match "^arm64ec") + { + echo "VCPKG_DEFAULT_TRIPLET=arm64ec-windows" >> $env:GITHUB_ENV + } + else + { + echo "VCPKG_DEFAULT_TRIPLET=arm64-windows" >> $env:GITHUB_ENV + } + } + else + { + echo "::error Unknown architecture/build-type triplet mapping" + } + + - uses: lukka/run-vcpkg@v11 + with: + runVcpkgInstall: true + vcpkgJsonGlob: '**/build/vcpkg.json' + vcpkgGitCommitId: '7516a02de04e8f8ff4e4beb8f5bac0565f9bf9da' + - name: 'Configure CMake' working-directory: ${{ github.workspace }} - run: cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF + run: > + cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF -DENABLE_LIBJPEG_SUPPORT=ON -DENABLE_LIBPNG_SUPPORT=ON + -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" + -DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}" - name: 'Build' working-directory: ${{ github.workspace }} From 6b91ba229311f176356ba60edf2fcf74bae2d7ca Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 17:16:01 -0700 Subject: [PATCH 07/18] Disable jpeg/png with arm64ec --- .github/workflows/test.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93b56895..37fc3615 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,43 +36,56 @@ jobs: os: [windows-2019, windows-2022] build_type: [x64-Debug, x64-Release] arch: [amd64] + build_opts: [jpegpng] include: - os: windows-2019 build_type: x86-Debug arch: amd64_x86 + build_opts: jpegpng - os: windows-2019 build_type: x86-Release arch: amd64_x86 + build_opts: jpegpng - os: windows-2022 build_type: x86-Debug arch: amd64_x86 + build_opts: jpegpng - os: windows-2022 build_type: x86-Release arch: amd64_x86 + build_opts: jpegpng - os: windows-2022 build_type: x64-Debug-Clang arch: amd64 + build_opts: jpegpng - os: windows-2022 build_type: x64-Release-Clang arch: amd64 + build_opts: jpegpng - os: windows-2022 build_type: x86-Debug-Clang arch: amd64_x86 + build_opts: jpegpng - os: windows-2022 build_type: x86-Release-Clang arch: amd64_x86 + build_opts: jpegpng - os: windows-2022 build_type: arm64-Debug arch: amd64_arm64 + build_opts: jpegpng - os: windows-2022 build_type: arm64-Release arch: amd64_arm64 + build_opts: jpegpng - os: windows-2022 build_type: arm64ec-Debug arch: amd64_arm64 + build_opts: none - os: windows-2022 build_type: arm64ec-Release arch: amd64_arm64 + build_opts: none steps: - uses: actions/checkout@v4 @@ -127,9 +140,12 @@ jobs: - name: 'Configure CMake' working-directory: ${{ github.workspace }} run: > - cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF -DENABLE_LIBJPEG_SUPPORT=ON -DENABLE_LIBPNG_SUPPORT=ON + cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF $BUILD_OPTION1 $BUILD_OPTION2 -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" -DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}" + env: + BUILD_OPTION1: ${{ matrix.build_opts == 'jpegpng' && '-DENABLE_LIBJPEG_SUPPORT=ON' || '' }} + BUILD_OPTION2: ${{ matrix.build_opts == 'jpegpng' && '-DENABLE_LIBPNG_SUPPORT=ON' || '' }} - name: 'Build' working-directory: ${{ github.workspace }} From e4fe2dadc9709b24f746758056cec71c3933e556 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 17:35:43 -0700 Subject: [PATCH 08/18] Suppress warnings in VCPKG headers --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b80eb0c..96eb3d8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -325,6 +325,7 @@ if(directx-headers_FOUND) message(STATUS "Using DirectX-Headers package") target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectX-Headers) target_compile_definitions(${PROJECT_NAME} PUBLIC USING_DIRECTX_HEADERS) + target_compile_options(${PROJECT_NAME} PRIVATE $<$:/wd4062> $<$:-Wno-switch-enum>) endif() #--- Package From a33ce257951f0b2746fb764bd26584fcf63c21d9 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 17:39:34 -0700 Subject: [PATCH 09/18] fix for yaml --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37fc3615..94a1eae2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -131,7 +131,8 @@ jobs: echo "::error Unknown architecture/build-type triplet mapping" } - - uses: lukka/run-vcpkg@v11 + - if: ${{ !contains(matrix.arch, 'arm64ec') }} + uses: lukka/run-vcpkg@v11 with: runVcpkgInstall: true vcpkgJsonGlob: '**/build/vcpkg.json' From 765d9261486b813fb8041beb8c6bc2e2307940a3 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 17:45:33 -0700 Subject: [PATCH 10/18] YAML bug --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 94a1eae2..19e2ff47 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -131,7 +131,7 @@ jobs: echo "::error Unknown architecture/build-type triplet mapping" } - - if: ${{ !contains(matrix.arch, 'arm64ec') }} + - if: ${{ !contains(matrix.build_type, 'arm64ec') }} uses: lukka/run-vcpkg@v11 with: runVcpkgInstall: true From 801655ad3a49f41b3560d82f81164f7146df2b4c Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 17:54:52 -0700 Subject: [PATCH 11/18] Syntax fix --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19e2ff47..6bd0d59f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -144,6 +144,7 @@ jobs: cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF $BUILD_OPTION1 $BUILD_OPTION2 -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" -DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}" + env: BUILD_OPTION1: ${{ matrix.build_opts == 'jpegpng' && '-DENABLE_LIBJPEG_SUPPORT=ON' || '' }} BUILD_OPTION2: ${{ matrix.build_opts == 'jpegpng' && '-DENABLE_LIBPNG_SUPPORT=ON' || '' }} From 847ac5874fd7d47d230841168c319921ce5c3e98 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 19:12:54 -0700 Subject: [PATCH 12/18] GH YAML docs are not correct --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6bd0d59f..8e1f405c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -141,7 +141,7 @@ jobs: - name: 'Configure CMake' working-directory: ${{ github.workspace }} run: > - cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF $BUILD_OPTION1 $BUILD_OPTION2 + cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF ${env:BUILD_OPTION1} ${env:BUILD_OPTION2} -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" -DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}" From 0f3d3f19f0ed7e538489cce84718073bd88e9d52 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 20:54:46 -0700 Subject: [PATCH 13/18] Fix blank warning --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8e1f405c..129a15b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -146,8 +146,8 @@ jobs: -DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}" env: - BUILD_OPTION1: ${{ matrix.build_opts == 'jpegpng' && '-DENABLE_LIBJPEG_SUPPORT=ON' || '' }} - BUILD_OPTION2: ${{ matrix.build_opts == 'jpegpng' && '-DENABLE_LIBPNG_SUPPORT=ON' || '' }} + BUILD_OPTION1: ${{ matrix.build_opts == 'jpegpng' && '-DENABLE_LIBJPEG_SUPPORT=ON' || '-DENABLE_LIBJPEG_SUPPORT=OFF' }} + BUILD_OPTION2: ${{ matrix.build_opts == 'jpegpng' && '-DENABLE_LIBPNG_SUPPORT=ON' || '-DENABLE_LIBPNG_SUPPORT=OFF' }} - name: 'Build' working-directory: ${{ github.workspace }} From 59e819c794427eed5500ab53b8c520f80960b6fd Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 21:05:57 -0700 Subject: [PATCH 14/18] Add WSL GitHub action --- .github/workflows/wsl.yml | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/wsl.yml diff --git a/.github/workflows/wsl.yml b/.github/workflows/wsl.yml new file mode 100644 index 00000000..8d7fd39a --- /dev/null +++ b/.github/workflows/wsl.yml @@ -0,0 +1,54 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkId=248926 + +name: 'CMake (WSL)' + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + paths-ignore: + - '*.md' + - LICENSE + - '.nuget/*' + - build/*.cmd + - build/*.json + - build/*.props + - build/*.ps1 + - build/*.targets + - build/*.yml + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + build_type: [x64-Debug-Linux, x64-Release-Linux] + + steps: + - uses: actions/checkout@v4 + + - uses: seanmiddleditch/gha-setup-ninja@v5 + + - uses: lukka/run-vcpkg@v11 + with: + runVcpkgInstall: true + vcpkgJsonGlob: '**/build/vcpkg.json' + vcpkgGitCommitId: '7516a02de04e8f8ff4e4beb8f5bac0565f9bf9da' + + - name: 'Configure CMake' + working-directory: ${{ github.workspace }} + run: > + cmake --preset=${{ matrix.build_type }} -DENABLE_LIBJPEG_SUPPORT=ON -DENABLE_LIBPNG_SUPPORT=ON + -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" + -DVCPKG_TARGET_TRIPLET="x64-linux" + + - name: 'Build' + working-directory: ${{ github.workspace }} + run: cmake --build out\build\${{ matrix.build_type }} From 7c084c35f249bf921165201bf7e7363e6cfbcbcb Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 21:16:20 -0700 Subject: [PATCH 15/18] More changes for YAML --- .github/workflows/test.yml | 3 +-- .github/workflows/wsl.yml | 2 +- build/vcpkg.json | 18 +++++++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 129a15b4..fc301845 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -131,8 +131,7 @@ jobs: echo "::error Unknown architecture/build-type triplet mapping" } - - if: ${{ !contains(matrix.build_type, 'arm64ec') }} - uses: lukka/run-vcpkg@v11 + - uses: lukka/run-vcpkg@v11 with: runVcpkgInstall: true vcpkgJsonGlob: '**/build/vcpkg.json' diff --git a/.github/workflows/wsl.yml b/.github/workflows/wsl.yml index 8d7fd39a..c5e04089 100644 --- a/.github/workflows/wsl.yml +++ b/.github/workflows/wsl.yml @@ -51,4 +51,4 @@ jobs: - name: 'Build' working-directory: ${{ github.workspace }} - run: cmake --build out\build\${{ matrix.build_type }} + run: cmake --build out/build/${{ matrix.build_type }} diff --git a/build/vcpkg.json b/build/vcpkg.json index 552566d4..6b6f99ff 100644 --- a/build/vcpkg.json +++ b/build/vcpkg.json @@ -3,9 +3,17 @@ "dependencies": [ "directxmath", "directx-headers", - "openexr", - "libpng", - "libjpeg-turbo" + { + "name": "openexr", + "platform": "linux | (windows & !arm64ec)" + }, + { + "name": "libpng", + "platform": "linux | (windows & !arm64ec)" + }, + { + "name": "libjpeg-turbo", + "platform": "linux | (windows & !arm64ec)" + } ] - } - \ No newline at end of file +} From 2b3984ac69ff56d3a65096ed9f3364c0131d2986 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 21:26:17 -0700 Subject: [PATCH 16/18] Only OpenEXR fails for ARM64EC --- .github/workflows/test.yml | 19 +------------------ .github/workflows/wsl.yml | 2 +- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc301845..93b56895 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,56 +36,43 @@ jobs: os: [windows-2019, windows-2022] build_type: [x64-Debug, x64-Release] arch: [amd64] - build_opts: [jpegpng] include: - os: windows-2019 build_type: x86-Debug arch: amd64_x86 - build_opts: jpegpng - os: windows-2019 build_type: x86-Release arch: amd64_x86 - build_opts: jpegpng - os: windows-2022 build_type: x86-Debug arch: amd64_x86 - build_opts: jpegpng - os: windows-2022 build_type: x86-Release arch: amd64_x86 - build_opts: jpegpng - os: windows-2022 build_type: x64-Debug-Clang arch: amd64 - build_opts: jpegpng - os: windows-2022 build_type: x64-Release-Clang arch: amd64 - build_opts: jpegpng - os: windows-2022 build_type: x86-Debug-Clang arch: amd64_x86 - build_opts: jpegpng - os: windows-2022 build_type: x86-Release-Clang arch: amd64_x86 - build_opts: jpegpng - os: windows-2022 build_type: arm64-Debug arch: amd64_arm64 - build_opts: jpegpng - os: windows-2022 build_type: arm64-Release arch: amd64_arm64 - build_opts: jpegpng - os: windows-2022 build_type: arm64ec-Debug arch: amd64_arm64 - build_opts: none - os: windows-2022 build_type: arm64ec-Release arch: amd64_arm64 - build_opts: none steps: - uses: actions/checkout@v4 @@ -140,14 +127,10 @@ jobs: - name: 'Configure CMake' working-directory: ${{ github.workspace }} run: > - cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF ${env:BUILD_OPTION1} ${env:BUILD_OPTION2} + cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF -DENABLE_LIBJPEG_SUPPORT=ON -DENABLE_LIBPNG_SUPPORT=ON -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" -DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}" - env: - BUILD_OPTION1: ${{ matrix.build_opts == 'jpegpng' && '-DENABLE_LIBJPEG_SUPPORT=ON' || '-DENABLE_LIBJPEG_SUPPORT=OFF' }} - BUILD_OPTION2: ${{ matrix.build_opts == 'jpegpng' && '-DENABLE_LIBPNG_SUPPORT=ON' || '-DENABLE_LIBPNG_SUPPORT=OFF' }} - - name: 'Build' working-directory: ${{ github.workspace }} run: cmake --build out\build\${{ matrix.build_type }} diff --git a/.github/workflows/wsl.yml b/.github/workflows/wsl.yml index c5e04089..e0107f07 100644 --- a/.github/workflows/wsl.yml +++ b/.github/workflows/wsl.yml @@ -45,7 +45,7 @@ jobs: - name: 'Configure CMake' working-directory: ${{ github.workspace }} run: > - cmake --preset=${{ matrix.build_type }} -DENABLE_LIBJPEG_SUPPORT=ON -DENABLE_LIBPNG_SUPPORT=ON + cmake --preset=${{ matrix.build_type }} -DENABLE_OPENEXR_SUPPORT=ON -DENABLE_LIBJPEG_SUPPORT=ON -DENABLE_LIBPNG_SUPPORT=ON -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" -DVCPKG_TARGET_TRIPLET="x64-linux" From fdd5a8236f3b381f06d34f04064886dc2b925c04 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 21:26:28 -0700 Subject: [PATCH 17/18] Only OpenEXR fails for ARM64EC 2 --- build/vcpkg.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/build/vcpkg.json b/build/vcpkg.json index 6b6f99ff..9892de6a 100644 --- a/build/vcpkg.json +++ b/build/vcpkg.json @@ -7,13 +7,7 @@ "name": "openexr", "platform": "linux | (windows & !arm64ec)" }, - { - "name": "libpng", - "platform": "linux | (windows & !arm64ec)" - }, - { - "name": "libjpeg-turbo", - "platform": "linux | (windows & !arm64ec)" - } + "libpng", + "libjpeg-turbo" ] } From 22f4eb33ae631b7105d8d45385e69c0562fe8d38 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 21:33:09 -0700 Subject: [PATCH 18/18] Fix warning --- Auxiliary/DirectXTexPNG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Auxiliary/DirectXTexPNG.cpp b/Auxiliary/DirectXTexPNG.cpp index 06181b78..dc428b3e 100644 --- a/Auxiliary/DirectXTexPNG.cpp +++ b/Auxiliary/DirectXTexPNG.cpp @@ -86,7 +86,7 @@ namespace void OnPNGRead(png_structp st, png_bytep ptr, size_t len) { FILE* fin = reinterpret_cast(png_get_io_ptr(st)); - fread(ptr, len, 1, fin); + std::ignore = fread(ptr, len, 1, fin); }