From 7aae82706d5ce6cf3c72ecb343676bd85d818d7a Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 4 Sep 2024 17:50:45 -0700 Subject: [PATCH] September 4, 2024 (#505) --- .github/workflows/wsl.yml | 5 + .nuget/directxtex_desktop_2019.nuspec | 2 +- .nuget/directxtex_desktop_win10.nuspec | 2 +- .nuget/directxtex_uwp.nuspec | 2 +- CHANGELOG.md | 14 +++ CMakeLists.txt | 2 +- DirectXTex/DirectXTex.h | 2 +- README.md | 2 +- build/Directory.Build.props | 5 + build/onefuzz-setup.ps1 | 5 + build/preparerelease.ps1 | 126 +++++++++++++++++++++++++ build/versioninfo.ps1 | 5 + 12 files changed, 166 insertions(+), 6 deletions(-) create mode 100644 build/preparerelease.ps1 diff --git a/.github/workflows/wsl.yml b/.github/workflows/wsl.yml index e0107f0..ba63008 100644 --- a/.github/workflows/wsl.yml +++ b/.github/workflows/wsl.yml @@ -30,6 +30,7 @@ jobs: matrix: build_type: [x64-Debug-Linux, x64-Release-Linux] + gcc: [10, 11, 12] steps: - uses: actions/checkout@v4 @@ -49,6 +50,10 @@ jobs: -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" -DVCPKG_TARGET_TRIPLET="x64-linux" + env: + CC: gcc-${{ matrix.gcc }} + CXX: g++-${{ matrix.gcc }} + - name: 'Build' working-directory: ${{ github.workspace }} run: cmake --build out/build/${{ matrix.build_type }} diff --git a/.nuget/directxtex_desktop_2019.nuspec b/.nuget/directxtex_desktop_2019.nuspec index 79f0ce6..23a28cb 100644 --- a/.nuget/directxtex_desktop_2019.nuspec +++ b/.nuget/directxtex_desktop_2019.nuspec @@ -10,7 +10,7 @@ This version is for Windows desktop applications using Visual Studio 2019 (16.11) or Visual Studio 2022 and supports Windows 7 / DirectX 11. DirectXTex, a shared source library for reading and writing .DDS files, and performing various texture content processing operations including resizing, format conversion, mip-map generation, block compression for Direct3D runtime texture resources, and height-map to normal-map conversion. This library makes use of the Windows Image Component (WIC) APIs. It also includes simple .TGA and .HDR readers and writers since these image file format are commonly used for texture content processing pipelines, but are not currently supported by a built-in WIC codec. - Matches the June 4, 2024 release on GitHub. + Matches the September 4, 2024 release on GitHub. http://go.microsoft.com/fwlink/?LinkId=248926 images\icon.jpg diff --git a/.nuget/directxtex_desktop_win10.nuspec b/.nuget/directxtex_desktop_win10.nuspec index b4d426d..b173faa 100644 --- a/.nuget/directxtex_desktop_win10.nuspec +++ b/.nuget/directxtex_desktop_win10.nuspec @@ -10,7 +10,7 @@ This version is for Windows desktop applications using Visual Studio 2019 (16.11) or Visual Studio 2022 and supports Windows 10 / Windows 11 including both DirectX 11 and DirectX 12. DirectXTex, a shared source library for reading and writing .DDS files, and performing various texture content processing operations including resizing, format conversion, mip-map generation, block compression for Direct3D runtime texture resources, and height-map to normal-map conversion. This library makes use of the Windows Image Component (WIC) APIs. It also includes simple .TGA and .HDR readers and writers since these image file format are commonly used for texture content processing pipelines, but are not currently supported by a built-in WIC codec. - Matches the June 4, 2024 release on GitHub. + Matches the September 4, 2024 release on GitHub. http://go.microsoft.com/fwlink/?LinkId=248926 images\icon.jpg diff --git a/.nuget/directxtex_uwp.nuspec b/.nuget/directxtex_uwp.nuspec index 2ad766e..e974ff5 100644 --- a/.nuget/directxtex_uwp.nuspec +++ b/.nuget/directxtex_uwp.nuspec @@ -10,7 +10,7 @@ This version is for Universal Windows Platform apps on Windows 10 / Windows 11 using Visual Studio 2022. DirectXTex, a shared source library for reading and writing .DDS files, and performing various texture content processing operations including resizing, format conversion, mip-map generation, block compression for Direct3D runtime texture resources, and height-map to normal-map conversion. This library makes use of the Windows Image Component (WIC) APIs. It also includes simple .TGA and .HDR readers and writers since these image file format are commonly used for texture content processing pipelines, but are not currently supported by a built-in WIC codec. - Matches the June 4, 2024 release on GitHub. + Matches the September 4, 2024 release on GitHub. http://go.microsoft.com/fwlink/?LinkId=248926 images\icon.jpg diff --git a/CHANGELOG.md b/CHANGELOG.md index c9c532c..e860a7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,20 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXT ## Release History +### September 4, 2024 +* DDS reader now accepts a variant of the "DX10" extended header + * arraySize of 0 is treated as 1 +* DDS reader will now load legacy 'mixed' channel formats as UNORM + * Uses x2bias for the signed channels + * `DDSPF_L6V5U5`, `DDSPF_X8L8V8U8`, `DDSPF_A2W10V10U10` +* texconv: Added `-ignoremips` option to handle some invalid/truncated DDS files +* EXR auxiliary reader returns 6 images for files with 'envmap' metadata +* PNG auxiliary reader/writer fixed for single channel images (`DXGI_FORMAT_R8_UNORM`) +* Xbox auxiliary now has `EncodeDDSHeader` function +* ScreenGrab9 minor DDS header fix when writing A2W10V10U10 legacy mixed formats +* CMake project updates including support for ARM64EC +* Added GitHub Actions YAML files + ### June 4, 2024 * Fix for HDR codec to avoid buffer overread for some malformed files * Updated D3DX12 internal copy with latest changes from DirectX-Headers GitHub diff --git a/CMakeLists.txt b/CMakeLists.txt index 96eb3d8..82091ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required (VERSION 3.20) -set(DIRECTXTEX_VERSION 2.0.4) +set(DIRECTXTEX_VERSION 2.0.5) if(WINDOWS_STORE OR (DEFINED XBOX_CONSOLE_TARGET)) set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY") diff --git a/DirectXTex/DirectXTex.h b/DirectXTex/DirectXTex.h index 8c680da..6eeebc4 100644 --- a/DirectXTex/DirectXTex.h +++ b/DirectXTex/DirectXTex.h @@ -47,7 +47,7 @@ struct IWICImagingFactory; struct IWICMetadataQueryReader; #endif -#define DIRECTX_TEX_VERSION 204 +#define DIRECTX_TEX_VERSION 205 namespace DirectX diff --git a/README.md b/README.md index ac1b07b..7b8800a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ http://go.microsoft.com/fwlink/?LinkId=248926 Copyright (c) Microsoft Corporation. -**June 4, 2024** +**September 4, 2024** This package contains DirectXTex, a shared source library for reading and writing ``.DDS`` files, and performing various texture content processing operations including resizing, format conversion, mip-map generation, block compression for Direct3D runtime texture resources, and height-map to normal-map conversion. This library makes use of the Windows Image Component (WIC) APIs. It also includes ``.TGA`` and ``.HDR`` readers and writers since these image file formats are commonly used for texture content processing pipelines, but are not currently supported by a built-in WIC codec. diff --git a/build/Directory.Build.props b/build/Directory.Build.props index 4526ecc..ab3bb53 100644 --- a/build/Directory.Build.props +++ b/build/Directory.Build.props @@ -1,6 +1,11 @@ + + C:\xtracted\ $(ExtractedFolder)\ diff --git a/build/onefuzz-setup.ps1 b/build/onefuzz-setup.ps1 index 7c1c75a..6e68c53 100644 --- a/build/onefuzz-setup.ps1 +++ b/build/onefuzz-setup.ps1 @@ -1,3 +1,8 @@ +<# +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +#> + function Execute-Setup { # Temporary work-around while OneFuzz does not run script from setup dir Set-Location -Path $PSScriptRoot diff --git a/build/preparerelease.ps1 b/build/preparerelease.ps1 new file mode 100644 index 0000000..fea3a65 --- /dev/null +++ b/build/preparerelease.ps1 @@ -0,0 +1,126 @@ +<# + +.NOTES +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. + +.SYNOPSIS +Prepares a PR for release + +.DESCRIPTION +This script is used to do the edits required for preparing a release PR. + +.PARAMETER BaseBranch +This the branch to use as the base of the release. Defaults to 'main'. + +.PARAMETER TargetBranch +This is the name of the newly created branch for the release PR. Defaults to 'release'. If set to 'none', then no branch is created. + +.PARAMETER UpdateVersion +This is a $true or $false value that indicates if the library version number should be incremented. Defaults to $true. + +.LINK +https://github.com/microsoft/DirectXTex/wiki + +#> + +param( + [string]$BaseBranch = "main", + [string]$TargetBranch = $null, + [bool]$UpdateVersion = $true +) + +$reporoot = Split-Path -Path $PSScriptRoot -Parent +$cmake = $reporoot + "\CMakeLists.txt" +$header = $reporoot + "\DirectXTex\DirectXTex.h" +$readme = $reporoot + "\README.md" +$history = $reporoot + "\CHANGELOG.md" + +if ((-Not (Test-Path $cmake)) -Or (-Not (Test-Path $header)) -Or (-Not (Test-Path $readme)) -Or (-Not (Test-Path $history))) { + Write-Error "ERROR: Unexpected location of script file!" -ErrorAction Stop +} + +$branch = git branch --show-current +if ($branch -ne $BaseBranch) { + Write-Error "ERROR: Must be in the $BaseBranch branch!" -ErrorAction Stop +} + +git pull -q +if ($LastExitCode -ne 0) { + Write-Error "ERROR: Failed to sync branch!" -ErrorAction Stop +} + +$version = Get-Content ($cmake) | Select-String -Pattern "set\(DIRECTXTEX_VERSION" -CaseSensitive +if (-Not ($version -match "([0-9]?\.[0-9]?\.[0-9]?)")) { + Write-Error "ERROR: Failed to current version!" -ErrorAction Stop +} +$version = $Matches.0 +$rawversion = $version.replace('.','') + +$newreleasedate = Get-Date -Format "MMMM d, yyyy" +$newreleasetag = (Get-Date -Format "MMMyyyy").ToLower() + +if($UpdateVersion) { + [string]$newrawversion = ([int]$rawversion + 1) +} +else { + $newrawversion = $rawversion +} + +$newversion = $newrawversion[0] + "." + $newrawversion[1] + "." + $newrawversion[2] + +$rawreleasedate = $(Get-Content $readme) | Select-String -Pattern "\*\*[A-Z][a-z]+\S.\d+,?\S.\d\d\d\d\*\*" +if ([string]::IsNullOrEmpty($rawreleasedate)) { + Write-Error "ERROR: Failed to current release date!" -ErrorAction Stop +} +$releasedate = $rawreleasedate -replace '\*','' + +if($releasedate -eq $newreleasedate) { + Write-Error ("ERROR: Release "+$releasedate+" already exists!") -ErrorAction Stop +} + +if ($TargetBranch -ne 'none') { + if ([string]::IsNullOrEmpty($TargetBranch)) { + $TargetBranch = $newreleasetag + "release" + } + + git checkout -b $TargetBranch + if ($LastExitCode -ne 0) { + Write-Error "ERROR: Failed to create new topic branch!" -ErrorAction Stop + } +} + +Write-Host " Old Version: " $version +Write-Host "Old Release Date: " $releasedate +Write-Host "->" +Write-Host " Release Date: " $newreleasedate +Write-Host " Release Tag: " $newreleasetag +Write-Host " Release Version: " $newversion + +if($UpdateVersion) { + (Get-Content $cmake).Replace("set(DIRECTXTEX_VERSION $version)","set(DIRECTXTEX_VERSION $newversion)") | Set-Content $cmake + (Get-Content $header).Replace("#define DIRECTX_TEX_VERSION $rawversion","#define DIRECTX_TEX_VERSION $newrawversion") | Set-Content $header +} + +(Get-Content $readme).Replace("$rawreleasedate", "**$newreleasedate**") | Set-Content $readme + +Get-ChildItem -Path ($reporoot + "\.nuget") -Filter *.nuspec | Foreach-Object { + (Get-Content -Path $_.Fullname).Replace("$releasedate", "$newreleasedate") | Set-Content -Path $_.Fullname -Encoding utf8 + } + +[System.Collections.ArrayList]$file = Get-Content $history +$inserthere = @() + +for ($i=0; $i -lt $file.count; $i++) { + if ($file[$i] -match "## Release History") { + $inserthere += $i + 1 + } +} + +$file.insert($inserthere[0], "`n### $newreleasedate`n* change history here") +Set-Content -Path $history -Value $file + +code $history $readme +if ($LastExitCode -ne 0) { + Write-Error "ERROR: Failed to launch VS Code!" -ErrorAction Stop +} diff --git a/build/versioninfo.ps1 b/build/versioninfo.ps1 index 545abd7..156ec89 100644 --- a/build/versioninfo.ps1 +++ b/build/versioninfo.ps1 @@ -1,3 +1,8 @@ +<# +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +#> + param( [string]$version )