Compare commits

...

236 Commits

Author SHA1 Message Date
Chuck Walbourn
32b2a8ef35
July 2, 2025 (#622) 2025-07-09 22:49:09 -07:00
dependabot[bot]
352dd3d3e0
Bump github/codeql-action from 3.28.18 to 3.29.2 (#621) 2025-07-02 12:07:42 -07:00
dependabot[bot]
e8c2e30f19
Bump github/codeql-action from 3.28.16 to 3.28.18 (#619) 2025-06-02 20:50:02 -07:00
Chuck Walbourn
cb3be57e9c
Add GitHub Action for super-lint (#618) 2025-06-02 17:49:20 -07:00
Chuck Walbourn
c8959b2911
GitHub Actions windows-2019 runner is being retired (#617)
Some checks failed
CTest (Windows) / build (amd64, x64-Debug, 14) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, 14.29) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, 14) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, 14) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, 14.29) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, 14) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, 14.29) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, 14) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, ON, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, OFF, 14.29) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, ON, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, OFF, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, OFF, 14) (push) Has been cancelled
2025-05-29 19:39:23 -07:00
Chuck Walbourn
169f7cf350
Cleanup of ADO pipeline YAML files (#615)
Some checks failed
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
2025-05-23 13:00:15 -07:00
Chuck Walbourn
652cc82b35
Enable some additional C++20 and C++23 compat warnings with clang (#614)
Some checks failed
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
2025-05-15 22:25:44 -07:00
Chuck Walbourn
e909fa68d0
EncodeDDSHeader for Xbox can't take a nullptr (#613)
Some checks failed
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
2025-05-07 16:01:43 -07:00
Chuck Walbourn
57564efee2
Fixed -Wmissing-include-dirs warnings (#611)
Some checks failed
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
2025-05-06 19:46:35 -07:00
dependabot[bot]
bbe9da11fb
Bump github/codeql-action from 3.28.13 to 3.28.16 (#610)
Some checks failed
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
2025-05-01 09:26:47 -07:00
Chuck Walbourn
82e094cf7c
Fix some ADO build failures (#609)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 14) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 14) (push) Has been cancelled
2025-04-22 11:33:07 -07:00
Chuck Walbourn
8e1cea9d20
Update ADO YAML to use shared variables (#608)
Some checks failed
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 14) (push) Has been cancelled
2025-04-17 16:24:55 -07:00
Chuck Walbourn
318d841cd3
CMake check for mismatch of toolset and arch setting (#605)
Some checks failed
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 14) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 14) (push) Has been cancelled
2025-04-15 13:02:22 -07:00
dependabot[bot]
48ae743942
Bump github/codeql-action from 3.28.10 to 3.28.13 (#603)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 14) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 14) (push) Has been cancelled
2025-04-01 23:06:15 -07:00
Chuck Walbourn
9823b46e7f
ADO pipeline removal (#604) 2025-04-01 17:22:10 -07:00
Chuck Walbourn
ad55a75d05
Migrate ADO pipelines to .azuredevops folder (#602)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 13) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 14) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 14) (push) Has been cancelled
2025-03-31 15:29:45 -07:00
Chuck Walbourn
4e7d99e7ee
Code review feedback for DLL declimport/export (#601)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 14) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 14) (push) Has been cancelled
2025-03-28 17:23:40 -07:00
Chuck Walbourn
92682bfa8a
March 24, 2025 (#599)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022, ON) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022, OFF) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 14) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 13) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 14) (push) Has been cancelled
2025-03-24 17:26:08 -07:00
Chuck Walbourn
7cb96065a4
Update NuGet spec files (#598) 2025-03-24 12:55:39 -07:00
Chuck Walbourn
3ae41b79aa
CMake fix for legacy Durango (#597) 2025-03-20 17:15:54 -07:00
Chuck Walbourn
666e28c955
Add ComputeTileShape utility (#595) 2025-03-18 12:05:46 -07:00
Chuck Walbourn
75105c7e88
IsPlanar option for D3D12 vs D3D11 depth (#594) 2025-03-17 15:23:13 -07:00
Chuck Walbourn
1085e4fef4
CMake update for try-compile with DLLs (#593) 2025-03-07 17:38:04 -08:00
dependabot[bot]
c0606824c9
Bump seanmiddleditch/gha-setup-ninja from 5 to 6 (#590) 2025-03-06 13:40:47 -08:00
Chuck Walbourn
d6fdfee00f
Update ADO coverage for clang v12 (#592) 2025-03-06 13:31:45 -08:00
dependabot[bot]
51f33c3471
Bump github/codeql-action from 3.28.8 to 3.28.10 (#591) 2025-03-03 11:37:32 -08:00
Chuck Walbourn
75b08fb306
Support loading another DX10 DDS variant with permissive (#588) 2025-02-20 11:59:09 -08:00
Chuck Walbourn
71ab939f26
Fix up CMake for Xbox platforms for shared lib (#587) 2025-02-19 19:20:39 -08:00
Chuck Walbourn
8e9fa6059c
Fixed MinGW with shared libs (#583) 2025-02-18 13:36:30 -08:00
Chuck Walbourn
632fcdcb2d
Fixes -Wundef warning introduced with BUILD_SHARED_LIBS (#582) 2025-02-12 17:26:42 -08:00
Chuck Walbourn
3e8137e481
CodeQL recommendations (#580) 2025-02-11 17:04:57 -08:00
Chuck Walbourn
cfd5f27126
Code review for const auto vs auto const (#579) 2025-02-04 12:12:59 -08:00
Chuck Walbourn
87e8b9513f
Add VERSIONINFO to DLL version of library (#578) 2025-02-04 11:44:12 -08:00
Chuck Walbourn
3a7adffc46
Fix some warnings in WSL build due to case (#577) 2025-02-03 13:57:56 -08:00
Bruno S Marques
5855f74bc7
Add option to build as shared lib (#575) 2025-02-03 12:35:49 -08:00
dependabot[bot]
1765e842db
Bump github/codeql-action from 3.27.9 to 3.28.8 (#576) 2025-02-03 10:38:48 -08:00
Chuck Walbourn
6a2a13ee51
Update VCPKG GHAs to use head commit id if variable isn't set (#574) 2025-01-31 14:53:48 -08:00
Chuck Walbourn
9303898a27
CMake update to fix cases where DIRECTX_ARCH is not defined (#571) 2025-01-28 16:39:43 -08:00
Chuck Walbourn
8f79186b15
Improve error reporting for TGAs with invalid palettes (#570) 2025-01-08 14:53:05 -08:00
dependabot[bot]
9b4cf594ef
Bump github/codeql-action from 3.27.6 to 3.27.9 (#569)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-12-16 11:18:17 -08:00
Chuck Walbourn
aec0784730
--ignore-mips does not apply to array textures (#567) 2024-12-16 10:53:49 -08:00
Chuck Walbourn
5864794ee6
Build for a Windows 8.1 minimum (#564)
Some checks failed
CMake (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
MSBuild / build (Debug, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Debug, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x64, 2019) (push) Has been cancelled
MSBuild / build (Debug, x64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x86, 2019) (push) Has been cancelled
MSBuild / build (Debug, x86, 2022) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Release, x64, 2019) (push) Has been cancelled
MSBuild / build (Release, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-12-10 23:06:28 -08:00
dependabot[bot]
42357da377
Bump github/codeql-action from 3.27.5 to 3.27.6 (#565)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-12-09 11:04:34 -08:00
Chuck Walbourn
f6fede394a
CMake updates (#561)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-12-05 17:16:40 -08:00
dependabot[bot]
6cc310ee8a
Bump github/codeql-action from 3.27.4 to 3.27.5 (#559)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-11-25 09:08:57 -08:00
dependabot[bot]
d095bec911
Bump github/codeql-action from 3.27.1 to 3.27.4 (#558)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-11-18 10:57:29 -08:00
Chuck Walbourn
db1edafde6
Add ADO Pipeline to validate MSBuild+VCPKG (#556)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-11-14 11:06:34 -08:00
Chuck Walbourn
2b6f585157
texconv: add --ignore-srgb, --wic-uncompressed and revisit --wic-lossless (#555)
Some checks failed
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Has been cancelled
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-11-12 20:30:49 -08:00
dependabot[bot]
37a18e9021
Bump github/codeql-action from 3.27.0 to 3.27.1 (#554)
Some checks failed
CodeQL / Analyze (C/C++) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Waiting to run
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Waiting to run
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Waiting to run
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Waiting to run
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Waiting to run
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Waiting to run
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Waiting to run
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Waiting to run
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Waiting to run
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Waiting to run
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Waiting to run
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
2024-11-12 13:24:14 -08:00
Chuck Walbourn
2d87c063b6
Add GitHub Actions to validate UWP via CMake (#551)
Some checks are pending
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (UWP) / build (amd64, x64-Debug-UWP) (push) Waiting to run
CMake (UWP) / build (amd64, x64-Debug-UWP-Clang) (push) Waiting to run
CMake (UWP) / build (amd64, x64-Release-UWP) (push) Waiting to run
CMake (UWP) / build (amd64, x64-Release-UWP-Clang) (push) Waiting to run
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP) (push) Waiting to run
CMake (UWP) / build (amd64_arm64, arm64-Debug-UWP-Clang) (push) Waiting to run
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP) (push) Waiting to run
CMake (UWP) / build (amd64_arm64, arm64-Release-UWP-Clang) (push) Waiting to run
CMake (UWP) / build (amd64_x86, x86-Debug-UWP) (push) Waiting to run
CMake (UWP) / build (amd64_x86, x86-Debug-UWP-Clang) (push) Waiting to run
CMake (UWP) / build (amd64_x86, x86-Release-UWP) (push) Waiting to run
CMake (UWP) / build (amd64_x86, x86-Release-UWP-Clang) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-MinGW, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Release-MinGW, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64ec-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
2024-11-11 18:45:57 -08:00
Chuck Walbourn
79c65ffce8
Fix CodeQL warnings in OpenEXR module (#549)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-11-07 14:57:18 -08:00
Chuck Walbourn
d8e9d5b12a
texconv: Portable Half Map uses .phm extension (#550) 2024-11-07 14:56:31 -08:00
Chuck Walbourn
2f37de7165
Minor code review change for PPM/PFM code (#548)
Some checks are pending
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
2024-11-06 18:13:48 -08:00
Chuck Walbourn
4602b8e0f0
Fix for CMake on WSL (#546)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-11-01 13:59:27 -07:00
Chuck Walbourn
77272b1303
Support using C++17 std::byte for FromMemory functions (#545)
Some checks are pending
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
2024-10-31 16:07:34 -07:00
Chuck Walbourn
9260384a37
October 28, 2024 (#544)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-10-28 17:02:08 -07:00
Chuck Walbourn
b81e202ec4
Convert command-line tools to use GNU-style long options (#541) 2024-10-28 13:54:51 -07:00
dependabot[bot]
b717c0f6da
Bump actions/checkout from 4.2.1 to 4.2.2 (#542) 2024-10-28 13:52:20 -07:00
dependabot[bot]
b6e01b0866
Bump github/codeql-action from 3.26.13 to 3.27.0 (#543) 2024-10-28 13:52:03 -07:00
Chuck Walbourn
6e7801e324
Use fixed width integers for underlying enum types (#538)
Some checks failed
CMake (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-10-24 11:44:33 -07:00
Chuck Walbourn
cea630ac4c
VS 2019 Win32 on ARM64 is no longer supported (#536)
Some checks are pending
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
2024-10-23 14:45:17 -07:00
dependabot[bot]
af46e03188
Bump github/codeql-action from 3.26.12 to 3.26.13 (#535)
Some checks are pending
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
2024-10-22 21:24:08 -07:00
Chuck Walbourn
09affb78aa
Fix DX12 Capture transition state handling for MSAA (#532)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-10-14 15:49:44 -07:00
dependabot[bot]
1262c4b293
Bump actions/checkout from 4.2.0 to 4.2.1 (#533)
Some checks are pending
MSBuild / build (Debug, x64, 2022) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
2024-10-14 09:50:09 -07:00
dependabot[bot]
47735026cd
Bump github/codeql-action from 3.26.11 to 3.26.12 (#534) 2024-10-14 09:49:53 -07:00
Chuck Walbourn
cb1dcca12e
Add Code Coverage support using CMake (#531)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-10-08 16:21:35 -07:00
Chuck Walbourn
8a4ff7101f
Add GitHub Action for BVTs with subset of tests (#522)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-10-05 23:15:54 -07:00
dependabot[bot]
cbcabd9c16
Bump github/codeql-action from 3.26.10 to 3.26.11 (#523)
Some checks failed
CMake (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
MSBuild / build (Debug, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Debug, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x64, 2019) (push) Has been cancelled
MSBuild / build (Debug, x64, 2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-10-04 12:29:58 -07:00
dependabot[bot]
e405c5ef32
Bump github/codeql-action from 3.26.9 to 3.26.10 (#521)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-10-02 14:25:45 -07:00
dependabot[bot]
497b90fc1f
Bump actions/checkout from 4.1.7 to 4.2.0 (#519)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-09-27 10:18:01 -07:00
dependabot[bot]
dee8699af6
Bump github/codeql-action from 3.26.8 to 3.26.9 (#518)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-09-25 13:12:07 -07:00
dependabot[bot]
38a1c22312
Bump github/codeql-action from 3.26.7 to 3.26.8 (#517)
Some checks failed
CMake (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-09-19 22:12:32 -07:00
Chuck Walbourn
25ee5b4f91
Adds BytesPerBlock helper (#516)
Some checks are pending
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
2024-09-19 18:08:58 -07:00
Chuck Walbourn
73aa2f3c34
Refactor command-line tools to use shared header (#514)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-09-17 13:45:12 -07:00
dependabot[bot]
1deadd38ed
Bump github/codeql-action from 3.26.6 to 3.26.7 (#512)
Some checks are pending
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
2024-09-16 14:09:00 -07:00
Chuck Walbourn
63960e5fd6
ADO pipeline for SDK builds (#511) 2024-09-16 11:18:23 -07:00
Chuck Walbourn
118ca16e04
Build pipeline updates (#510)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-09-12 12:35:45 -07:00
StepSecurity Bot
061355c9fd
[StepSecurity] Apply security best practices (#508)
Some checks are pending
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
2024-09-11 11:51:39 -07:00
StepSecurity Bot
3dc7ec1e82
[StepSecurity] ci: Harden GitHub Actions (#507)
Some checks are pending
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 10) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 11) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux, 12) (push) Waiting to run
2024-09-10 19:03:12 -07:00
Chuck Walbourn
79b4ef0ef8
Update BWOI support in VC projects (#506)
Some checks failed
CMake (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-09-06 11:32:30 -07:00
Chuck Walbourn
7aae82706d
September 4, 2024 (#505)
Some checks failed
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Debug-Linux, 12) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 10) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 11) (push) Has been cancelled
CMake (WSL) / build (x64-Release-Linux, 12) (push) Has been cancelled
2024-09-04 17:50:45 -07:00
Chuck Walbourn
8193c66888
Update CMake to specify FXC.EXE to use (#502)
Some checks are pending
MSBuild / build (Release, ARM64, 2019) (push) Waiting to run
MSBuild / build (Release, ARM64, 2022) (push) Waiting to run
MSBuild / build (Release, x64, 2019) (push) Waiting to run
MSBuild / build (Release, x64, 2022) (push) Waiting to run
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (WSL) / build (x64-Debug-Linux) (push) Waiting to run
CMake (WSL) / build (x64-Release-Linux) (push) Waiting to run
2024-09-03 23:09:35 -07:00
Chuck Walbourn
55b93efe35
ADO test pipeline updates (#504)
Some checks are pending
MSBuild / build (Debug, x64, 2022) (push) Waiting to run
MSBuild / build (Debug, x86, 2022) (push) Waiting to run
MSBuild / build (Release, ARM64, 2019) (push) Waiting to run
MSBuild / build (Release, ARM64, 2022) (push) Waiting to run
MSBuild / build (Release, x64, 2019) (push) Waiting to run
MSBuild / build (Release, x64, 2022) (push) Waiting to run
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
2024-09-03 11:52:27 -07:00
Bruno Ancona
c401f2fe16
Fix exporting R8 files as PNG using libpng (#503)
Some checks failed
MSBuild / build (Debug, x86, 2019) (push) Waiting to run
MSBuild / build (Debug, x86, 2022) (push) Waiting to run
MSBuild / build (Release, ARM64, 2019) (push) Waiting to run
MSBuild / build (Debug, ARM64, 2019) (push) Waiting to run
MSBuild / build (Debug, ARM64, 2022) (push) Waiting to run
MSBuild / build (Debug, x64, 2019) (push) Waiting to run
MSBuild / build (Debug, x64, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Waiting to run
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Waiting to run
CodeQL / Analyze (C/C++) (push) Has been cancelled
2024-09-02 19:46:13 -07:00
Chuck Walbourn
327c200991
Support loading legacy DDS files using mixed channel formats (#501)
Some checks failed
MSBuild / build (Debug, x86, 2019) (push) Has been cancelled
MSBuild / build (Debug, x86, 2022) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Release, x64, 2019) (push) Has been cancelled
MSBuild / build (Release, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
2024-08-29 14:13:48 -07:00
Chuck Walbourn
e63f915ed8
D3DFMT_A2W10V10U10 fix for ScreenGrab DX9 (#500) 2024-08-29 14:13:31 -07:00
Chuck Walbourn
9850897657
Add VCPKG usage to GitHub Actions (#499)
Some checks failed
CMake (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
MSBuild / build (Debug, x86, 2022) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Release, x64, 2019) (push) Has been cancelled
MSBuild / build (Release, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-Clang-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2019) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64, x64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_arm64, arm64-Debug-VCPKG, windows-2022) (push) Has been cancelled
CMake (Windows using VCPKG) / build (amd64_x86, x86-Debug-VCPKG, windows-2022) (push) Has been cancelled
2024-08-23 10:57:12 -07:00
Chuck Walbourn
1c47191318
Xbox auxiliary EncodeDDSHeader helper exposed as public function (#497)
Some checks failed
MSBuild / build (Debug, x64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x86, 2019) (push) Has been cancelled
MSBuild / build (Debug, x86, 2022) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Release, x64, 2019) (push) Has been cancelled
MSBuild / build (Release, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
2024-08-19 16:27:36 -07:00
Chuck Walbourn
059ce81581
Minor SAL fix (#495)
Some checks failed
MSBuild / build (Debug, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Debug, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x64, 2019) (push) Has been cancelled
MSBuild / build (Debug, x64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x86, 2019) (push) Has been cancelled
MSBuild / build (Debug, x86, 2022) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Release, x64, 2019) (push) Has been cancelled
MSBuild / build (Release, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
2024-08-15 10:13:49 -07:00
Chuck Walbourn
1c78c7d1ec
Additional code review for OpenEXR (#494)
Some checks failed
MSBuild / build (Debug, x64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x86, 2019) (push) Has been cancelled
MSBuild / build (Debug, x86, 2022) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Release, x64, 2019) (push) Has been cancelled
MSBuild / build (Release, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
2024-08-08 13:54:42 -07:00
vkaytsanov
2f84f54508
Add cubemap support for OpenEXR (#483)
Some checks failed
MSBuild / build (Debug, x64, 2019) (push) Has been cancelled
MSBuild / build (Debug, x64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x86, 2019) (push) Has been cancelled
MSBuild / build (Debug, x86, 2022) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Release, x64, 2019) (push) Has been cancelled
MSBuild / build (Release, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
2024-08-05 17:43:03 -07:00
Chuck Walbourn
6e184e26a7
Update CMake to handle ARM64EC with VS Generator (#493)
Some checks failed
CMake (Windows) / build (amd64_x86, x86-Release-Clang, windows-2019) (push) Has been cancelled
CMake (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
MSBuild / build (Debug, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Debug, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x64, 2019) (push) Has been cancelled
MSBuild / build (Debug, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
2024-08-02 13:15:56 -07:00
Chuck Walbourn
d16a2c869d
Fix for CMake presets (#492)
Some checks failed
MSBuild / build (Debug, x64, 2022) (push) Has been cancelled
MSBuild / build (Debug, x86, 2019) (push) Has been cancelled
MSBuild / build (Debug, x86, 2022) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2019) (push) Has been cancelled
MSBuild / build (Release, ARM64, 2022) (push) Has been cancelled
MSBuild / build (Release, x64, 2019) (push) Has been cancelled
MSBuild / build (Release, x64, 2022) (push) Has been cancelled
MSBuild / build (Release, x86, 2019) (push) Has been cancelled
MSBuild / build (Release, x86, 2022) (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2019) (push) Has been cancelled
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Has been cancelled
2024-07-30 17:40:51 -07:00
Chuck Walbourn
78ca9628e2
Added GitHub Actions for build and security analysis (#491)
Some checks are pending
MSBuild / build (Release, ARM64, 2022) (push) Waiting to run
MSBuild / build (Debug, ARM64, 2019) (push) Waiting to run
MSBuild / build (Debug, ARM64, 2022) (push) Waiting to run
MSBuild / build (Debug, x64, 2019) (push) Waiting to run
MSBuild / build (Debug, x64, 2022) (push) Waiting to run
MSBuild / build (Release, x64, 2019) (push) Waiting to run
MSBuild / build (Release, x64, 2022) (push) Waiting to run
MSBuild / build (Release, x86, 2019) (push) Waiting to run
MSBuild / build (Release, x86, 2022) (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64, x64-Release-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_arm64, arm64ec-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Debug-Clang, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release, windows-2022) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2019) (push) Waiting to run
CTest (Windows) / build (amd64_x86, x86-Release-Clang, windows-2022) (push) Waiting to run
2024-07-29 20:13:36 -07:00
Chuck Walbourn
87ec5d5610
Some DDS DX10 writers set arryaSize to 0 instead of 1 (#490) 2024-07-19 16:37:04 -07:00
Chuck Walbourn
2849777702
CMake updated to build ARM64EC (#489) 2024-07-18 15:28:46 -07:00
Chuck Walbourn
e7ab102d5e
Remove v141 support for GDK (#486) 2024-07-11 17:03:27 -07:00
Chuck Walbourn
e102d0bd3e
texconv: -ignoremips options for reading some invalid DDS files (#484) 2024-07-01 18:47:31 -07:00
Chuck Walbourn
6022b864e8
CMake improvements for multi-config generators (#481) 2024-06-13 15:52:54 -07:00
Chuck Walbourn
af1c8b3cb4
Fix build break when building for Xbox using latest Windows SDK (#480) 2024-06-06 11:11:41 -07:00
Chuck Walbourn
451708ff2f
June 4, 2024 (#479) 2024-06-04 17:01:20 -07:00
Chuck Walbourn
bcb687ee65
Fix D3DX12 warnings (#478) 2024-05-30 12:39:25 -07:00
Chuck Walbourn
68e726aefc
ADO pipeline changes for OpenSSF Best Practices (#477) 2024-05-17 16:56:19 -07:00
Chuck Walbourn
5cf134c714
Update Code of Conduct and Security files (#476) 2024-05-15 09:54:43 -07:00
Chuck Walbourn
d052ac6d7e
ADO pipeline update (#474) 2024-05-14 12:18:03 -07:00
Chuck Walbourn
1ce3f865ed
Fix build issues with XboxOne and clang (#473) 2024-05-04 12:47:09 -07:00
Chuck Walbourn
245ac9002c
Update ADO pipeline (#472) 2024-05-02 22:36:34 -07:00
Chuck Walbourn
dd6904b708
Fix for HDR codec to avoid buffer overread for some malformed files (#471) 2024-05-01 10:22:59 -07:00
Chuck Walbourn
976ec533be
Remove noisy useless warning (#470) 2024-04-19 19:24:03 -07:00
J. Peter Mugaas
237525e71c
ifdef Visual Studio pragmas. (#469) 2024-04-09 09:15:56 -05:00
Chuck Walbourn
fa22a4ec53
Update compiler build settings for CMake (#458) 2024-04-05 14:37:53 -07:00
Chuck Walbourn
0a85faddc1
Add code coverage to OneFuzz (#468) 2024-04-04 11:46:52 -07:00
Chuck Walbourn
b0171ab10d
Update ADO pipeline exclusion paths (#467) 2024-04-03 20:48:00 -07:00
Chuck Walbourn
b8f6330f53
Fix pipeline warnings (#466) 2024-03-29 18:31:10 -07:00
Chuck Walbourn
ceade44724
Enable /CETCOMPAT when building with VS 2019 (#465) 2024-03-28 15:24:56 -07:00
Chuck Walbourn
36b5afb232
Retire VS 2019 UWP projects (#464) 2024-03-27 15:15:24 -07:00
Chuck Walbourn
5cfd711dc5
March 6, 2024 (#461) 2024-03-06 11:46:30 -08:00
Chuck Walbourn
e9e293c0c5
Fixed unreferenced formal parameter warning (#460) 2024-02-28 15:16:02 -08:00
Chuck Walbourn
aae41e425b
Xbox auxiliary optimization for tiling (#459) 2024-02-28 11:21:43 -08:00
Chuck Walbourn
b41eda671d
Hotfix for CMake switch order (#457) 2024-02-22 16:47:27 -08:00
Chuck Walbourn
ba50281a06
February 21, 2024 (#456) 2024-02-22 12:26:43 -08:00
Chuck Walbourn
108cbeb2d6
Update YAML pipeline triggers (#455) 2024-02-21 12:55:33 -08:00
Chuck Walbourn
c3fade8160
OpenEXR doesn't build with /ehcont (#454) 2024-02-16 11:18:11 -08:00
Chuck Walbourn
726cd6de90
Fix build breaks (#453) 2024-02-15 11:13:53 -08:00
LandonTownsendKeenSWH
1e7961387a
TexAssemble: Support for 2D Texture with custom mip maps using "from-mips" argument (#368) 2024-02-14 22:25:11 -08:00
Chuck Walbourn
a48c1c1a73
CMake refactor (#452) 2024-02-12 13:06:47 -08:00
Chuck Walbourn
7fbe35ff34
Update CMake to work with Intel compilers (#451) 2024-02-09 11:52:49 -08:00
Chuck Walbourn
416c2364e0
Fix -Wextra-semi-stmt warning' (#450) 2024-02-05 13:35:44 -08:00
Chuck Walbourn
819c5b78f7
Workaround clang/LLVM bug with /fp:fast+SSE+float_control (#449) 2024-02-05 10:08:59 -08:00
Chuck Walbourn
95796ba57e
Update GDK projects and ADO pipelines (#448) 2024-02-01 22:51:44 -08:00
Chuck Walbourn
4efb955122
CMake code review (#445) 2024-01-29 15:08:07 -08:00
J. Peter Mugaas
154bb7c3bb
Mote in BUILD_DX11 option that fxc.exe is required. (#446) 2024-01-29 13:10:33 -08:00
Chuck Walbourn
9aa857e160
Merge Xbox xtexconv tool into mainline via CMake (#441)
* Merge Xbox xtexconv tool into mainline via CMake

* Update CMake for Xbox builds

* Keep using _USE_GXDK

* Code review feedback
2024-01-22 07:58:00 -08:00
Park DongHa
fae11ce578
Add Auxiliary files for JPEG/PNG support on Linux (#407) 2024-01-20 11:02:19 -08:00
Chuck Walbourn
eb172c521a
Don't allow TGA reader to read images larger than 4GB even in 64-bit (#440) 2024-01-17 23:23:39 -08:00
Chuck Walbourn
4790ba43e3
OneFuzz ADO pipeline adjustments (#439) 2024-01-17 12:18:12 -08:00
J. Peter Mugaas
486a297cff
CMake update to install EXEs (#438) 2024-01-11 01:06:56 -08:00
Chuck Walbourn
f4291f5dd1
OneFuzz parameter adjustment (#437) 2024-01-09 14:16:13 -08:00
Chuck Walbourn
d6e1625815
Spelling fix in comments (#436) 2024-01-07 19:26:09 -08:00
Chuck Walbourn
dd6aef1505
Add bound on depth values to fix warnings in MinGW 13.2 (#434) 2024-01-06 17:40:03 -08:00
Chuck Walbourn
8c86e0e424
December 31, 2023 (#431) 2023-12-31 17:55:16 -08:00
J. Peter Mugaas
a3d032b8a6
Fix warnings in tools for MinGW (#428) 2023-12-30 12:45:09 -08:00
Chuck Walbourn
187f6d64a8
Code review to silence some portability warnings (#422) 2023-12-28 23:30:46 -08:00
Chuck Walbourn
eb594ad36c
Missing offset boundary check in TGA reader (#429) 2023-12-28 23:30:25 -08:00
J. Peter Mugaas
dd5517fd06
Remove references to ZLIB and edit comment as appropriate. (#427) 2023-12-26 15:15:12 -08:00
J. Peter Mugaas
3bf25e04b4
Have CMake generate pkg-config file for library (#423) 2023-12-20 23:06:31 -08:00
J. Peter Mugaas
a4e1c046d5
Fix annoying warnings I saw with clang about ignored pragmas by ifdef'ing MSVC specific things. (#424) 2023-12-17 15:39:11 -08:00
Chuck Walbourn
3154a66b41
PPM TGA HDR bounds updates on readers (#421) 2023-12-12 13:17:51 -08:00
Chuck Walbourn
0f8b427bf4
ADO OneFuzz pipeline updated with setup script (#420) 2023-12-06 19:17:02 -08:00
Chuck Walbourn
e8dd6c7559
Merge Xbox extensions into mainline as Auxiliary (#417) 2023-11-29 11:00:59 -08:00
Chuck Walbourn
14f26b27d2
Update ADO build pipelines (#416) 2023-11-15 15:37:00 -08:00
Chuck Walbourn
282812b973
texconv: Fix PFM reader to avoid overread of buffer (#413)
* texconv: Fix PFM reader to avoid overread of buffer

* More code review

* Max memory usage

* YAML fix
2023-11-09 20:10:12 -08:00
Chuck Walbourn
3aebd48c6f
Add SDL build pipeline (#412) 2023-11-08 22:38:02 -08:00
Chuck Walbourn
53ba375fbf
texconv: Fix PPM reader to avoid overread of buffer (#410) 2023-11-08 18:20:40 -08:00
Chuck Walbourn
6eca077e06
Fix some C4063 warnings (#411) 2023-11-08 18:20:23 -08:00
Chuck Walbourn
d0bcc504eb
texconv: Updated PPM/PFM reader with explicit bounds check (#409) 2023-11-07 14:17:32 -08:00
Chuck Walbourn
f58c30705b
Add OneFuzz build pipeline 2023-11-05 23:12:56 -08:00
Chuck Walbourn
5a83705fce
October 28, 2023 (#404) 2023-10-30 22:04:49 -07:00
Chuck Walbourn
d19b882a55
Fixed -flist handling for filenames with spaces (#402) 2023-10-06 14:18:53 -07:00
Nicholas Hayes
cb5279f10e
Read legacy files with a DDS_HEADER size of 24 (#400) 2023-10-04 10:17:15 -07:00
Chuck Walbourn
e8c45a15ab
Update build pipelines for recent changes to windows-2022 ADO images (#398) 2023-09-26 16:57:03 -07:00
Chuck Walbourn
3754a77d87
DDS_FLAGS_PERMISSIVE flag to allow some file variants with header bugs (#394) 2023-09-11 23:13:35 -07:00
Nicholas Hayes
41eb26fb0c
Support reading files with a DDS_PIXELFORMAT size of 24 (#393) 2023-09-11 10:10:16 -07:00
Chuck Walbourn
419e314914
September 1, 2023 (#389) 2023-09-05 12:36:33 -07:00
Chuck Walbourn
b2c76d5634
AArch32 (ARM32) architecture deprecation (#387) 2023-08-31 14:25:30 -07:00
Chuck Walbourn
8122c1d6b4
Suppress some additional clang v16 warnings when upgrading to clangcl (#386) 2023-08-30 10:06:48 -07:00
Chuck Walbourn
0abc33330b
Add NO_WCHAR_T build option to CMake (#384) 2023-08-20 11:01:09 -07:00
Nicholas Hayes
1d1d4d0134
Add CompressEx and ConvertEx methods that report progress (#375) 2023-08-18 14:43:30 -07:00
Chuck Walbourn
7e7b11db04
Remove overvalidation bug for BC7 compressor with SRGB (#381) 2023-08-02 12:00:27 -07:00
Chuck Walbourn
4d9d7a8ceb
Ex versions of DDS load function to return original DDPIXELFORMAT metadata (#373) 2023-07-10 13:23:13 -07:00
Nicholas Hayes
83ea5ee1bc
Add support for reading Unreal Tournament 2004 DDS files (#371) 2023-07-06 13:52:02 -07:00
Chuck Walbourn
70909fd6be
Another D3DX12 update to fix errors when using preview Windows SDKs (#370) 2023-07-03 15:29:35 -07:00
Chuck Walbourn
40dacea267
CMake targets fixes for optional vs. required packages (#369) 2023-06-16 11:35:08 -07:00
Chuck Walbourn
71aa6ba4f5
CMake target file fix (#367) 2023-06-14 13:22:22 -07:00
Chuck Walbourn
dd94a4aa9c
June 2023 release (#365) 2023-06-13 17:28:01 -07:00
Chuck Walbourn
86cf9d542f
tex tools updated with support for long file paths with Windows 10 (#364) 2023-06-13 15:40:45 -07:00
Chuck Walbourn
a2a4ffd33c
texconv: Added support for DXT5nm and RXGB DXT5 format variants (#362) 2023-06-12 14:34:32 -07:00
Chuck Walbourn
2395b804ff
Fix CMake problem with /Zc:templateScope on older Windows SDKs (#363) 2023-06-12 14:32:36 -07:00
Half Dragon
0dd5933058
Add .DDX Support (#336) 2023-06-10 10:27:36 -07:00
Chuck Walbourn
603efced7b
texconv: Added tgazeroalpha switch for some legacy TGA files (#360) 2023-06-09 09:52:45 -07:00
Chuck Walbourn
7a9a9e9e8f
CMake update to use /ZH:SHA_256 for clang v16 or later (#356) 2023-05-18 17:13:12 -07:00
Chuck Walbourn
d0ee1e8a89
Add CodeQL to GitHub pipeline (#354) 2023-05-17 11:39:07 -07:00
Chuck Walbourn
d664193c05
tex tools: remove newlines from FORMAT_MESSAGE_FROM_SYSTEM (#355) 2023-05-17 11:38:08 -07:00
Chuck Walbourn
f5d41447f8
Add TEX_FILTER_RGB_COPY_ALPHA for RGBA to R and RGBA to RG convert control (#349) 2023-05-12 11:27:02 -07:00
Chuck Walbourn
e0a7be5a4b
Add support for new DXGI 16bpp format (#348) 2023-05-11 09:58:28 -07:00
Chuck Walbourn
37a3733912
Update CMake config file to include OpenMP (#345) 2023-05-01 10:37:19 -07:00
Chuck Walbourn
e4c370d494
April 28, 2023 (#343) 2023-04-28 11:38:24 -07:00
Chuck Walbourn
12befe5e16
CMake support for building legacy Xbox One XDK lib (#342) 2023-04-27 17:03:18 -07:00
Chuck Walbourn
9175ac8204
Update CMake to use OpenMP via built-in support (#341) 2023-04-24 13:53:24 -07:00
Chuck Walbourn
0c292b4119
D3DX12 updated to latest version (#340) 2023-04-24 13:52:49 -07:00
Chuck Walbourn
8579d004ff
ARM64 version of tex tools (#337) 2023-04-12 20:50:42 -07:00
Chuck Walbourn
e3f1523de9
March 30, 2023 (#334) 2023-03-30 12:15:00 -07:00
Chuck Walbourn
654ec26168
tex tool updates for some POSIX like support (#333) 2023-03-27 16:02:41 -07:00
Chuck Walbourn
574745f290
Update GPU encoder to use DirectCompute 5 (#108) 2023-03-20 10:49:19 -07:00
Chuck Walbourn
8c47482183
Retire legacy Xbox One XDK support (#329) 2023-03-17 15:47:52 -07:00
Chuck Walbourn
93182cac68
Fix BC6H GPU compressor handling of negative pixel values (#328) 2023-03-11 02:39:33 -08:00
Chuck Walbourn
a4df1415f8
Fixed /analyze warning (#327) 2023-03-10 15:19:49 -08:00
Chuck Walbourn
b4719fa58c
Fix handling of SRGB_IN and SRGB_OUT for GPU BC7 compressor (#326) 2023-03-10 15:19:09 -08:00
Chuck Walbourn
0f77045482
Fix typo in CMake file for Xbox (#322) 2023-02-16 22:21:46 -08:00
Chuck Walbourn
0a4e51a5fd
CMake updated to support building for Xbox (#320) 2023-02-15 22:07:52 -08:00
Chuck Walbourn
1cef43a2bf
Cmake bug fixed if BUILD_DX11=OFF but BUILD_TOOLS=ON (#319) 2023-02-10 19:27:14 -08:00
Chuck Walbourn
5b06df54e4
CMake code review (#318) 2023-02-09 21:58:13 -08:00
Chuck Walbourn
4c277982ed
Update for latest files from the Microsoft GitHub template (#317) 2023-02-09 18:47:03 -08:00
Chuck Walbourn
22457feb8a
Minor updates to CMake for a proof-of-concept project (#316) 2023-02-06 15:27:58 -08:00
Chuck Walbourn
23ac46e962
January 31, 2023 (#310) 2023-01-31 14:15:35 -08:00
Chuck Walbourn
126d15c39a
Clean up GPU-based validation warnings (#309) 2023-01-31 09:57:16 -08:00
Chuck Walbourn
371643fce2
ScratchImage Initialize zero-fills image data (#308) 2023-01-27 11:36:27 -08:00
Chuck Walbourn
278e708f25
ConvertToSinglePlane memory overrwrite bug fix (#307) 2023-01-25 23:25:26 -08:00
Chuck Walbourn
fa9967bc74
DDSView updated with -forcesrgb switch (#305) 2023-01-19 11:18:39 -08:00
Chuck Walbourn
e4f5af944c
Fix build break for Debug on WSL (#299) 2022-12-27 12:03:08 -08:00
Chuck Walbourn
23b7fd1f38
December 15, 2022 (#297) 2022-12-17 20:36:40 -08:00
Chuck Walbourn
9dd139f44a
CMake updated to use /Zc:inline and /Zc:lambda (#296) 2022-12-15 10:29:32 -08:00
Chuck Walbourn
9fd4d9f6b6
Add Spectre-mitigated libraries to the NuGet (#295) 2022-12-13 22:26:09 -08:00
Chuck Walbourn
cdb335306c YAML code review 2022-12-08 01:10:41 -08:00
Chuck Walbourn
a20f79d649 Code review 2022-12-06 23:19:38 -08:00
Chuck Walbourn
0d0f540ec0 Tweak YAML pipeline CI triggers 2022-12-06 15:05:42 -08:00
Chuck Walbourn
27dcde569c CMake build option to enable /Qspectre (#293) 2022-12-06 12:01:26 -08:00
Chuck Walbourn
06d5286870 Add YAML Azure Pipelines 2022-12-04 18:22:15 -08:00
walbourn
d993bbdb6e Minor cmake code review 2022-12-02 22:33:06 -08:00
walbourn
9bc07dc20f Update readme 2022-12-01 20:58:26 -08:00
Chuck Walbourn
42710025c3 D3DX12 update to fix warnings when using preview Windows SDKs 2022-11-30 14:18:40 -08:00
walbourn
a438adc83b Disable E&C 2022-11-28 17:11:21 -08:00
Chuck Walbourn
91df32232f Bias added for ARM version of 16bpp format conversions to match existing output 2022-11-28 00:03:22 -08:00
walbourn
44f9a71ca1 Update CMake test presets for MinGW 2022-11-27 13:10:09 -08:00
walbourn
62f1d7c991 Minor cmake cleanup 2022-11-27 11:58:27 -08:00
walbourn
403be02804 Update CMake to define _DEBUG for MinGW 2022-11-26 18:15:10 -08:00
Chuck Walbourn
781df59540
CMake update for version 3.20 (#292) 2022-11-22 11:37:25 -08:00
Chuck Walbourn
5935c67ebe Fixed minor texconv output issue 2022-11-20 15:22:30 -08:00
Chuck Walbourn
2e6cd01cd4 Fix C4777 warning 2022-11-20 11:47:21 -08:00
matyalatte
166dd269b0
Texassemble updates for cubemap generation from a image (#290)
Adds cube-from- options.
2022-11-20 10:47:30 -08:00
Chuck Walbourn
5837e1b482 Fix build issue with updated D3DX12 2022-11-19 14:22:48 -08:00
Chuck Walbourn
79e898607d Fix -Wold-style-cast warning 2022-11-19 13:49:10 -08:00
Chuck Walbourn
c4e64db644 Update D3DX12 for Agility SDK 1.608 2022-11-19 13:03:20 -08:00
walbourn
8c4ad29001 CMakeLists updated to CMake 3.20 2022-11-15 12:10:33 -08:00
Chuck Walbourn
159d512086
texassemble updates for cubemap image generation (#289)
* Fixed offsets for v-cross
* Added v-cross-fnz to match output by ATI CodeGen and other tools
* Added h-tee
2022-11-04 17:42:27 -07:00
Chuck Walbourn
d3289691b7 Code review update 2022-10-25 13:18:09 -07:00
201 changed files with 25861 additions and 5037 deletions

View File

@ -0,0 +1,370 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library using CMake with VS Generator (GitHub Actions covers Ninja).
schedules:
- cron: "0 5 * * *"
displayName: 'Nightly build'
branches:
include:
- main
trigger:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- '.github/**'
- '.nuget/*'
- build/*.cmd
- build/OneFuzz*.json
- build/*.props
- build/*.ps1
- build/*.targets
pr:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- '.github/**'
- '.nuget/*'
- build/*.cmd
- build/OneFuzz*.json
- build/*.props
- build/*.ps1
- build/*.targets
drafts: false
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: vcpkgRepo
name: Microsoft/vcpkg
type: github
endpoint: microsoft
ref: refs/tags/$(VCPKG_TAG)
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: VCPKG_ROOT
value: '$(Build.SourcesDirectory)/vcpkg'
- name: VCPKG_CMAKE_DIR
value: '$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake'
- name: VCPKG_MANIFEST_DIR
value: '$(Build.SourcesDirectory)/build'
- name: VS_GENERATOR
value: 'Visual Studio 17 2022'
- name: WIN10_SDK
value: '10.0.19041.0'
- name: WIN11_SDK
value: '10.0.22000.0'
pool:
vmImage: windows-2022
jobs:
- job: CMAKE_BUILD
displayName: CMake using VS Generator
steps:
- checkout: self
clean: true
fetchTags: false
- task: CMake@1
displayName: 'CMake (MSVC): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=OFF
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (MSVC): Config x86'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A Win32 -B out2
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=OFF
- task: CMake@1
displayName: 'CMake (MSVC): Build x86 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Build x86 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (MSVC): Config ARM64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A ARM64 -B out3
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=OFF
- task: CMake@1
displayName: 'CMake (MSVC): Build ARM64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out3 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Build ARM64 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out3 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (UWP): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out4
-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=10.0
- task: CMake@1
displayName: 'CMake (UWP): Build x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out4 -v
- task: CMake@1
displayName: 'CMake (ClangCl): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out5
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out5 -v --config Debug
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out5 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (ClangCl): Config ARM64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A ARM64 -T clangcl -B out6
-DCMAKE_SYSTEM_VERSION=$(WIN11_SDK)
- task: CMake@1
displayName: 'CMake (ClangCl): Build ARM64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out6 -v --config Debug
- task: CMake@1
displayName: 'CMake (Win10): Config'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out7
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=ON
- task: CMake@1
displayName: 'CMake (Win10): Build'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out7 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out8
-DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=OFF
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Build x64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out8 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Build x64 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out8 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Config ARM64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A ARM64 -B out9
-DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=OFF
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Build ARM64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out9 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Build ARM64 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out9 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (Win10 Spectre): Config'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out10
-DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=ON
- task: CMake@1
displayName: 'CMake (Win10 Spectre): Build'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out10 -v --config Debug
- task: CMake@1
displayName: 'CMake (NO_WCHAR_T): Config'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out11
-DNO_WCHAR_T=ON
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK)
-DBUILD_DX12=ON
- task: CMake@1
displayName: 'CMake (NO_WCHAR_T): Build'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out11 -v --config Debug
- task: CMake@1
displayName: 'CMake (DLL): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out12
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=ON
-DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out12 -v --config Debug
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out12 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (UWP DLL): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out13
-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=10.0
-DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (UWP DLL): Build x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out13 -v
- job: CMAKE_BUILD_VCPKG
displayName: CMake using VCPKG
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: vcpkgRepo
displayName: Fetch VCPKG
clean: true
fetchTags: false
fetchDepth: 1
path: 's/vcpkg'
- task: CmdLine@2
displayName: VCPKG Bootstrap
inputs:
script: call bootstrap-vcpkg.bat
workingDirectory: $(VCPKG_ROOT)
- task: CmdLine@2
displayName: VCPKG install packages
inputs:
script: call vcpkg install --x-manifest-root=$(VCPKG_MANIFEST_DIR) --triplet=x64-windows
workingDirectory: $(VCPKG_ROOT)
- task: CMake@1
displayName: 'CMake (MSVC): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-windows
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Config x64 w/ OpenEXR'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out2 -DENABLE_OPENEXR_SUPPORT=ON -DBUILD_TESTING=OFF -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-windows
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug w/ OpenEXR'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Config x64 w/ libjpeg'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out3 -DENABLE_LIBJPEG_SUPPORT=ON -DBUILD_TESTING=OFF -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-windows
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug w/ libjpeg'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out3 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Config x64 w/ libpng'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out4 -DENABLE_LIBPNG_SUPPORT=ON -DBUILD_TESTING=OFF -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-windows
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug w/ libpng'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out4 -v --config Debug

View File

@ -0,0 +1,397 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library with Xbox extensions using CMake.
schedules:
- cron: "0 4 * * *"
displayName: 'Nightly build'
branches:
include:
- main
trigger: none
pr:
branches:
include:
- main
paths:
include:
- '.azuredevops/pipelines/DirectXTex-GitHub-CMake-Xbox-Dev17.yml'
- CMake*
- build/*.cmake
- build/*.in
- DirectXTex/Shaders/CompileShaders.cmd
- Auxiliary/*Xbox*
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
trigger: none
- repository: testRepo
name: walbourn/directxtextest
type: github
endpoint: microsoft
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: VS_GENERATOR
value: 'Visual Studio 17 2022'
- name: WIN10_SDK
value: '10.0.19041.0'
- name: EXTRACTED_FOLDER
value: '$(ExtractedFolder)'
- name: URL_FEED
value: $(ADOFeedURL)
- name: VC_PATH
value: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
- name: GameDKLatest
value: '$(ExtractedFolder)\Microsoft.gdk.xbox.$(GDK_EDITION)\native\$(GDK_EDITION)\'
- name: skipNugetSecurityAnalysis
value: true # We explicitly call this task so we don't need it to be auto-injected
pool:
vmImage: windows-2022
jobs:
- job: CMAKE_BUILD
displayName: CMake using VS Generator
steps:
- checkout: self
clean: true
fetchTags: false
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet install PGDK
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet install GDKX
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.Xbox.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CMake@1
displayName: 'CMake (MSVC): Config x64 (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_SCARLETT=ON -DBUILD_SAMPLE=OFF
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: --build out -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Release (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: --build out -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (ClangCl): Config x64 (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out2
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_SCARLETT=ON -DBUILD_SAMPLE=OFF
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Debug (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: --build out2 -v --config Debug
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Release (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: --build out2 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (MSVC): Config x64 (Xbox One)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out3
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_XBOXONE=ON -DBUILD_SAMPLE=OFF
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug (Xbox One)'
inputs:
cwd: ''
cmakeArgs: --build out3 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Release (Xbox One)'
inputs:
cwd: ''
cmakeArgs: --build out3 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (ClangCl): Config x64 (Xbox One)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out4
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_XBOXONE=ON -DBUILD_SAMPLE=OFF
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Debug (Xbox One)'
inputs:
cwd: ''
cmakeArgs: --build out4 -v --config Debug
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Release (Xbox One)'
inputs:
cwd: ''
cmakeArgs: --build out4 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (DLL): Config x64 (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out5
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_SCARLETT=ON -DBUILD_SAMPLE=OFF
-DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Debug (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: --build out5 -v --config Debug
- task: CMake@1
displayName: 'CMake (DLL): Config x64 (Xbox One)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out6
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_XBOXONE=ON -DBUILD_SAMPLE=OFF
-DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Debug (Xbox One)'
inputs:
cwd: ''
cmakeArgs: --build out6 -v --config Debug
- job: BUILD_GDK_CMAKE_XS
displayName: 'Xbox Series X|S Extensions BUILD_TESTING=ON'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet install PGDK
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet install GDKX
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.Xbox.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CmdLine@2
displayName: Setup BWOI for GDK command-line
inputs:
script: |
call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat"
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
echo ##vso[task.prependpath]%VCToolsInstallDir%bin\HostX64\x64
call $(Build.SourcesDirectory)\build\SetupBWOI.cmd $(EXTRACTED_FOLDER) $(GDK_EDITION) Scarlett
echo ##vso[task.setvariable variable=GameDKLatest;]%GameDKLatest%
echo ##vso[task.setvariable variable=GRDKLatest;]%GRDKLatest%
echo ##vso[task.setvariable variable=GXDKLatest;]%GXDKLatest%
echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE%
echo ##vso[task.setvariable variable=LIB;]%LIB%
echo ##vso[task.prependpath]%ADDBIN%
failOnStderr: true
- task: CMake@1
displayName: 'CMake (MSVC): Config Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-GDKX-S
- task: CMake@1
displayName: 'CMake (MSVC): Build Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-GDKX-S
- task: CMake@1
displayName: 'CMake (MSVC): Config Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release-GDKX-S
- task: CMake@1
displayName: 'CMake (MSVC): Build Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Release-GDKX-S
- job: BUILD_GDK_CMAKE_X
displayName: 'Xbox One Extensions BUILD_TESTING=ON'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet install PGDK
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet install GDKX
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.Xbox.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CmdLine@2
displayName: Setup BWOI for GDK command-line
inputs:
script: |
call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat"
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
echo ##vso[task.prependpath]%VCToolsInstallDir%bin\HostX64\x64
call $(Build.SourcesDirectory)\build\SetupBWOI.cmd $(EXTRACTED_FOLDER) $(GDK_EDITION) XboxOne
echo ##vso[task.setvariable variable=GameDKLatest;]%GameDKLatest%
echo ##vso[task.setvariable variable=GRDKLatest;]%GRDKLatest%
echo ##vso[task.setvariable variable=GXDKLatest;]%GXDKLatest%
echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE%
echo ##vso[task.setvariable variable=LIB;]%LIB%
echo ##vso[task.prependpath]%ADDBIN%
failOnStderr: true
- task: CMake@1
displayName: 'CMake (MSVC): Config Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-GDKX
- task: CMake@1
displayName: 'CMake (MSVC): Build Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-GDKX
- task: CMake@1
displayName: 'CMake (MSVC): Config Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release-GDKX
- task: CMake@1
displayName: 'CMake (MSVC): Build Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Release-GDKX

View File

@ -0,0 +1,229 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library with Xbox extensions using CMake.
schedules:
- cron: "0 4 * * *"
displayName: 'Nightly build'
branches:
include:
- main
trigger:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- '.github/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
pr:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- '.github/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
drafts: false
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: VS_GENERATOR
value: 'Visual Studio 16 2019'
- name: WIN10_SDK
value: '10.0.19041.0'
- name: EXTRACTED_FOLDER
value: '$(ExtractedFolder)'
- name: URL_FEED
value: $(ADOFeedURL)
- name: GameDKLatest
value: '$(ExtractedFolder)\Microsoft.gdk.xbox.$(GDK_EDITION)\native\$(GDK_EDITION)\'
- name: skipNugetSecurityAnalysis
value: true # We explicitly call this task so we don't need it to be auto-injected
pool:
vmImage: windows-2019
jobs:
- job: CMAKE_BUILD
displayName: CMake using VS Generator
steps:
- checkout: self
clean: true
fetchTags: false
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet install PGDK
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet install GDKX
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.Xbox.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CMake@1
displayName: 'CMake (MSVC): Config x64 (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_SCARLETT=ON -DBUILD_SAMPLE=OFF
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: --build out -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Release (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: --build out -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (ClangCl): Config x64 (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out2
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_SCARLETT=ON -DBUILD_SAMPLE=OFF
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Debug (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: --build out2 -v --config Debug
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Release (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: --build out2 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (MSVC): Config x64 (Xbox One)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out3
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_XBOXONE=ON -DBUILD_SAMPLE=OFF
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug (Xbox One)'
inputs:
cwd: ''
cmakeArgs: --build out3 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Release (Xbox One)'
inputs:
cwd: ''
cmakeArgs: --build out3 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (ClangCl): Config x64 (Xbox One)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out4
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_XBOXONE=ON -DBUILD_SAMPLE=OFF
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Debug (Xbox One)'
inputs:
cwd: ''
cmakeArgs: --build out4 -v --config Debug
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Release (Xbox One)'
inputs:
cwd: ''
cmakeArgs: --build out4 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (DLL): Config x64 (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out5
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_SCARLETT=ON -DBUILD_SAMPLE=OFF
-DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Debug (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: --build out5 -v --config Debug
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Release (Xbox Series X|S)'
inputs:
cwd: ''
cmakeArgs: --build out5 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (DLL): Config x64 (Xbox One)'
inputs:
cwd: ''
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out6
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_XBOX_EXTS_XBOXONE=ON -DBUILD_SAMPLE=OFF
-DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Debug (Xbox One)'
inputs:
cwd: ''
cmakeArgs: --build out6 -v --config Debug
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Release (Xbox One)'
inputs:
cwd: ''
cmakeArgs: --build out6 -v --config RelWithDebInfo

View File

@ -0,0 +1,321 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library using CMake with VS Generator (GitHub Actions covers Ninja).
schedules:
- cron: "0 5 * * *"
displayName: 'Nightly build'
branches:
include:
- main
trigger:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- '.github/**'
- '.nuget/*'
- build/*.cmd
- build/OneFuzz*.json
- build/*.props
- build/*.ps1
- build/*.targets
pr:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- '.github/**'
- '.nuget/*'
- build/*.cmd
- build/OneFuzz*.json
- build/*.props
- build/*.ps1
- build/*.targets
drafts: false
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: vcpkgRepo
name: Microsoft/vcpkg
type: github
endpoint: microsoft
ref: refs/tags/$(VCPKG_TAG)
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: VCPKG_ROOT
value: '$(Build.SourcesDirectory)/vcpkg'
- name: VCPKG_CMAKE_DIR
value: '$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake'
- name: VCPKG_MANIFEST_DIR
value: '$(Build.SourcesDirectory)/build'
- name: VS_GENERATOR
value: 'Visual Studio 16 2019'
- name: WIN10_SDK
value: '10.0.19041.0'
- name: WIN11_SDK
value: '10.0.22000.0'
pool:
vmImage: windows-2019
jobs:
- job: CMAKE_BUILD
displayName: CMake using VS Generator
steps:
- checkout: self
clean: true
fetchTags: false
- task: CMake@1
displayName: 'CMake (MSVC): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=OFF
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (MSVC): Config x86'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A Win32 -B out2
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=OFF
- task: CMake@1
displayName: 'CMake (MSVC): Build x86 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Build x86 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (UWP): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out3
-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=10.0
- task: CMake@1
displayName: 'CMake (UWP): Build x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out3 -v
- task: CMake@1
displayName: 'CMake (ClangCl): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out4
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out4 -v --config Debug
- task: CMake@1
displayName: 'CMake (ClangCl): Build x64 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out4 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (Win10): Config'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out5
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=ON
- task: CMake@1
displayName: 'CMake (Win10): Build'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out5 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out6
-DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=OFF
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Build x64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out6 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC Spectre): Build x64 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out6 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (Win10 Spectre): Config'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out7
-DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
-DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=ON
- task: CMake@1
displayName: 'CMake (Win10 Spectre): Build'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out7 -v --config Debug
- task: CMake@1
displayName: 'CMake (NO_WCHAR_T): Config'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out8
-DNO_WCHAR_T=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
-DCMAKE_SYSTEM_VERSION=$(WIN11_SDK)
-DBUILD_DX12=ON
- task: CMake@1
displayName: 'CMake (NO_WCHAR_T): Build'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out8 -v --config Debug
- task: CMake@1
displayName: 'CMake (DLL): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out9
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DBUILD_DX12=ON
-DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out9 -v --config Debug
- task: CMake@1
displayName: 'CMake (DLL): Build x64 Release'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out9 -v --config RelWithDebInfo
- task: CMake@1
displayName: 'CMake (UWP DLL): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out10
-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_SYSTEM_VERSION=10.0
-DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (UWP DLL): Build x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out10 -v
- job: CMAKE_BUILD_VCPKG
displayName: CMake using VCPKG
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: vcpkgRepo
displayName: Fetch VCPKG
clean: true
fetchTags: false
fetchDepth: 1
path: 's/vcpkg'
- task: CmdLine@2
displayName: VCPKG Bootstrap
inputs:
script: call bootstrap-vcpkg.bat
workingDirectory: $(VCPKG_ROOT)
- task: CmdLine@2
displayName: VCPKG install packages
inputs:
script: call vcpkg install --x-manifest-root=$(VCPKG_MANIFEST_DIR) --triplet=x64-windows
workingDirectory: $(VCPKG_ROOT)
- task: CMake@1
displayName: 'CMake (MSVC): Config x64'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-windows
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Config x64 w/ OpenEXR'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out2 -DENABLE_OPENEXR_SUPPORT=ON -DBUILD_TESTING=OFF -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-windows
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug w/ OpenEXR'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Config x64 w/ libjpeg'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out3 -DENABLE_LIBJPEG_SUPPORT=ON -DBUILD_TESTING=OFF -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-windows
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug w/ libjpeg'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out3 -v --config Debug
- task: CMake@1
displayName: 'CMake (MSVC): Config x64 w/ libpng'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out4 -DENABLE_LIBPNG_SUPPORT=ON -DBUILD_TESTING=OFF -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-windows
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Debug w/ libpng'
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out4 -v --config Debug

View File

@ -0,0 +1,154 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library for Windows Desktop and UWP.
schedules:
- cron: "0 3 * * *"
displayName: 'Nightly build'
branches:
include:
- main
# GitHub Actions handles MSBuild for CI/PR
trigger: none
pr:
branches:
include:
- main
paths:
include:
- '.azuredevops/pipelines/DirectXTex-GitHub-Dev17.yml'
- DirectXTex/Shaders/CompileShaders.cmd
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
variables:
Codeql.Enabled: false
pool:
vmImage: windows-2022
jobs:
- job: DESKTOP_BUILD
displayName: 'Windows Desktop'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
strategy:
maxParallel: 3
matrix:
Release_arm64:
BuildPlatform: ARM64
BuildConfiguration: Release
SpectreMitigation: false
Debug_arm64:
BuildPlatform: ARM64
BuildConfiguration: Debug
SpectreMitigation: false
Release_x64:
BuildPlatform: x64
BuildConfiguration: Release
SpectreMitigation: false
Debug_x64:
BuildPlatform: x64
BuildConfiguration: Debug
SpectreMitigation: false
Release_x86:
BuildPlatform: x86
BuildConfiguration: Release
SpectreMitigation: false
Debug_x86:
BuildPlatform: x86
BuildConfiguration: Debug
SpectreMitigation: false
Release_arm64_SpectreMitigated:
BuildPlatform: ARM64
BuildConfiguration: Release
SpectreMitigation: 'Spectre'
Debug_arm64_SpectreMitigated:
BuildPlatform: ARM64
BuildConfiguration: Debug
SpectreMitigation: 'Spectre'
Release_x64_SpectreMitigated:
BuildPlatform: x64
BuildConfiguration: Release
SpectreMitigation: 'Spectre'
Debug_x64_SpectreMitigated:
BuildPlatform: x64
BuildConfiguration: Debug
SpectreMitigation: 'Spectre'
Release_x86_SpectreMitigated:
BuildPlatform: x86
BuildConfiguration: Release
SpectreMitigation: 'Spectre'
Debug_x86_SpectreMitigated:
BuildPlatform: x86
BuildConfiguration: Debug
SpectreMitigation: 'Spectre'
steps:
- checkout: self
clean: true
fetchTags: false
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2022.sln
inputs:
solution: DirectXTex_Desktop_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=$(SpectreMitigation)
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArchitecture: x64
condition: ne(variables['BuildPlatform'], 'ARM64')
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2022_Win10.sln
inputs:
solution: DirectXTex_Desktop_2022_Win10.sln
msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=$(SpectreMitigation)
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArchitecture: x64
- job: UWP_BUILD
displayName: 'Universal Windows Platform (UWP)'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
strategy:
maxParallel: 3
matrix:
Release_arm64:
BuildPlatform: ARM64
BuildConfiguration: Release
Debug_arm64:
BuildPlatform: ARM64
BuildConfiguration: Debug
Release_x64:
BuildPlatform: x64
BuildConfiguration: Release
Debug_x64:
BuildPlatform: x64
BuildConfiguration: Debug
Release_x86:
BuildPlatform: x86
BuildConfiguration: Release
Debug_x86:
BuildPlatform: x86
BuildConfiguration: Debug
steps:
- checkout: self
clean: true
fetchTags: false
- task: VSBuild@1
displayName: Build solution DirectXTex_Windows10_2022.sln
inputs:
solution: DirectXTex_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArchitecture: x64

View File

@ -0,0 +1,359 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library using the Microsoft GDK.
schedules:
- cron: "30 3 * * *"
displayName: 'Nightly build'
branches:
include:
- main
trigger: none
pr:
branches:
include:
- main
paths:
include:
- '.azuredevops/pipelines/DirectXTex-GitHub-GDK-Dev17.yml'
- '.azuredevops/templates/DirectXTex-build-gdk.yml'
- CMakeList.txt
- build/*.in
- build/*.cmake
- build/SetupBWOI.*
- DirectXTex/Shaders/CompileShaders.cmd
- Auxiliary/*Xbox*
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
trigger: none
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
pool:
vmImage: windows-2022
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: EXTRACTED_FOLDER
value: '$(ExtractedFolder)'
- name: GDKEnableBWOI
value: true
- name: URL_FEED
value: $(ADOFeedURL)
- name: VC_PATH
value: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
- name: skipNugetSecurityAnalysis
value: true # We explicitly call this task so we don't need it to be auto-injected
jobs:
- job: BUILD_GDK
displayName: 'Microsoft Game Development Kit (GDK)'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet install PGDK
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet install GDKX
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.Xbox.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CopyFiles@2
displayName: Set up Directory.Build.props
inputs:
SourceFolder: build
Contents: 'Directory.Build.props'
TargetFolder: $(Build.SourcesDirectory)
- task: MSBuild@1
displayName: Setup BWOI VCTargets
inputs:
solution: build/SetupBWOI.targets
msbuildVersion: 17.0
msbuildArchitecture: x64
msbuildArguments: /p:GDKEditionNumber=$(GDK_EDITION)
- template: '/.azuredevops/templates/DirectXTex-build-gdk.yml'
parameters:
msVersion: '17.0'
vsYear: 2022
- job: BUILD_GDK_CMAKE_SCAR
displayName: 'Microsoft Game Development Kit (GDK) using CMake (Scarlett)'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet install PGDK
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet install GDKX
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.Xbox.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CmdLine@2
displayName: Setup BWOI for GDK command-line
inputs:
script: |
call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat"
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
echo ##vso[task.prependpath]%VCToolsInstallDir%bin\HostX64\x64
call $(Build.SourcesDirectory)\build\SetupBWOI.cmd $(EXTRACTED_FOLDER) $(GDK_EDITION) Scarlett
echo ##vso[task.setvariable variable=GameDKLatest;]%GameDKLatest%
echo ##vso[task.setvariable variable=GRDKLatest;]%GRDKLatest%
echo ##vso[task.setvariable variable=GXDKLatest;]%GXDKLatest%
echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE%
echo ##vso[task.setvariable variable=LIB;]%LIB%
echo ##vso[task.prependpath]%ADDBIN%
failOnStderr: true
- task: CMake@1
displayName: 'CMake (MSVC): Config Scarlett Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-Scarlett
- task: CMake@1
displayName: 'CMake (MSVC): Build Scarlett Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-Scarlett
- task: CMake@1
displayName: 'CMake (MSVC): Config Scarlett Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release-Scarlett
- task: CMake@1
displayName: 'CMake (MSVC): Build Scarlett Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Release-Scarlett
- task: CMake@1
displayName: 'CMake (Clang): Config Scarlett Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-Scarlett-Clang
- task: CMake@1
displayName: 'CMake (Clang): Build Scarlett Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-Scarlett-Clang
- task: CMake@1
displayName: 'CMake (Clang): Config Scarlett Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release-Scarlett-Clang
- task: CMake@1
displayName: 'CMake (Clang): Build Scarlett Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Release-Scarlett-Clang
- task: DeleteFiles@1
inputs:
Contents: 'out/build'
- task: CMake@1
displayName: 'CMake (DLL): Config Scarlett Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-Scarlett -DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (DLL): Build Scarlett Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-Scarlett
- job: BUILD_GDK_CMAKE_XBONE
displayName: 'Microsoft Game Development Kit (GDK) using CMake (XboxOne)'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet install PGDK
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet install GDKX
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.Xbox.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CmdLine@2
displayName: Setup BWOI for GDK command-line
inputs:
script: |
call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat"
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
echo ##vso[task.prependpath]%VCToolsInstallDir%bin\HostX64\x64
call $(Build.SourcesDirectory)\build\SetupBWOI.cmd $(EXTRACTED_FOLDER) $(GDK_EDITION) XboxOne
echo ##vso[task.setvariable variable=GameDKLatest;]%GameDKLatest%
echo ##vso[task.setvariable variable=GRDKLatest;]%GRDKLatest%
echo ##vso[task.setvariable variable=GXDKLatest;]%GXDKLatest%
echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE%
echo ##vso[task.setvariable variable=LIB;]%LIB%
echo ##vso[task.prependpath]%ADDBIN%
failOnStderr: true
- task: CMake@1
displayName: 'CMake (MSVC): Config XboxOne Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-XboxOne
- task: CMake@1
displayName: 'CMake (MSVC): Build XboxOne Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-XboxOne
- task: CMake@1
displayName: 'CMake (MSVC): Config XboxOne Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release-XboxOne
- task: CMake@1
displayName: 'CMake (MSVC): Build XboxOne Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Release-XboxOne
- task: CMake@1
displayName: 'CMake (Clang): Config XboxOne Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-XboxOne-Clang
- task: CMake@1
displayName: 'CMake (Clang): Build XboxOne Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-XboxOne-Clang
- task: CMake@1
displayName: 'CMake (Clang): Config XboxOne Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release-XboxOne-Clang
- task: CMake@1
displayName: 'CMake (Clang): Build XboxOne Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Release-XboxOne-Clang
- task: DeleteFiles@1
inputs:
Contents: 'out/build'
- task: CMake@1
displayName: 'CMake (DLL): Config XboxOne Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-XboxOne -DBUILD_SHARED_LIBS=ON
- task: CMake@1
displayName: 'CMake (DLL): Build XboxOne Debug'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out\build\x64-Debug-XboxOne

View File

@ -0,0 +1,138 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library using the Microsoft GDK.
# NOTE: We use x64 MSBuild for the GDK as the NuGets don't include 32-bit support to avoid cross-arch dependencies.
schedules:
- cron: "30 3 * * *"
displayName: 'Nightly build'
branches:
include:
- main
trigger:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- CMake*
- '.github/**'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
- build/*.in
- build/*.json
- build/*.ps1
pr:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- CMake*
- '.github/**'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
- build/*.in
- build/*.json
- build/*.ps1
drafts: false
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
pool:
vmImage: windows-2019
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: EXTRACTED_FOLDER
value: '$(ExtractedFolder)'
- name: GDKEnableBWOI
value: true
- name: URL_FEED
value: $(ADOFeedURL)
- name: skipNugetSecurityAnalysis
value: true # We explicitly call this task so we don't need it to be auto-injected
jobs:
- job: BUILD_GDK
displayName: 'Microsoft Game Development Kit (GDK)'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet install PGDK
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet install GDKX
inputs:
command: custom
arguments: install -prerelease Microsoft.GDK.Xbox.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CopyFiles@2
displayName: Set up Directory.Build.props
inputs:
SourceFolder: build
Contents: 'Directory.Build.props'
TargetFolder: $(Build.SourcesDirectory)
- task: MSBuild@1
displayName: Setup BWOI VCTargets
inputs:
solution: build/SetupBWOI.targets
msbuildVersion: 16.0
msbuildArchitecture: x64
msbuildArguments: /p:GDKEditionNumber=$(GDK_EDITION)
- template: '/.azuredevops/templates/DirectXTex-build-gdk.yml'
parameters:
msVersion: '16.0'
vsYear: 2019

View File

@ -0,0 +1,354 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library and test suite using the MinGW compiler.
schedules:
- cron: "0 5 * * *"
displayName: 'Nightly build'
branches:
include:
- main
trigger:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- '.github/**'
- '.nuget/*'
- build/*.cmd
- build/OneFuzz*.json
- build/*.props
- build/*.ps1
- build/*.targets
pr:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- '.github/**'
- '.nuget/*'
- build/*.cmd
- build/OneFuzz*.json
- build/*.props
- build/*.ps1
- build/*.targets
drafts: false
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: vcpkgRepo
name: Microsoft/vcpkg
type: github
endpoint: microsoft
ref: refs/tags/$(VCPKG_TAG)
- repository: testRepo
name: walbourn/directxtextest
type: github
endpoint: microsoft
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
pool:
vmImage: windows-2022
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: VCPKG_ROOT
value: '$(Build.SourcesDirectory)/vcpkg'
- name: VCPKG_CMAKE_DIR
value: '$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake'
- name: VCPKG_MANIFEST_DIR
value: '$(Build.SourcesDirectory)/build'
- name: WIN11_SDK
value: '10.0.22000.0'
- name: BASE_URL
value: https://github.com/brechtsanders/winlibs_mingw/releases/download
- name: URL_MINGW32
value: $(BASE_URL)/12.2.0-14.0.6-10.0.0-ucrt-r2/winlibs-i686-posix-dwarf-gcc-12.2.0-llvm-14.0.6-mingw-w64ucrt-10.0.0-r2.zip
- name: HASH_MINGW32
value: 'fcd1e11b896190da01c83d5b5fb0d37b7c61585e53446c2dab0009debc3915e757213882c35e35396329338de6f0222ba012e23a5af86932db45186a225d1272'
- name: CompileShadersOutput
value: '$(Build.BinariesDirectory)\Shaders'
jobs:
- job: MINGW32_BUILD
displayName: 'Minimalist GNU for Windows (MinGW32)'
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: vcpkgRepo
displayName: Fetch VCPKG
clean: true
fetchTags: false
fetchDepth: 1
path: 's/vcpkg'
- task: CmdLine@2
displayName: VCPKG Bootstrap
inputs:
script: |
call bootstrap-vcpkg.bat
echo ##vso[task.setvariable variable=VCPKG_DEFAULT_TRIPLET;]x86-mingw-static
echo ##vso[task.setvariable variable=VCPKG_DEFAULT_HOST_TRIPLET;]x86-mingw-static
workingDirectory: $(Build.SourcesDirectory)\vcpkg
- task: PowerShell@2
displayName: Install MinGW32 and setup for Windows 11 SDK
inputs:
targetType: inline
script: |
$ProgressPreference = 'SilentlyContinue'
Write-Host "Downloading winlibs..."
Invoke-WebRequest -Uri "$(URL_MINGW32)" -OutFile "gw32.zip"
Write-Host "Downloaded."
$fileHash = Get-FileHash -Algorithm SHA512 gw32.zip | ForEach { $_.Hash} | Out-String
$filehash = $fileHash.Trim()
Write-Host "##[debug]SHA512: " $fileHash
if ($fileHash -ne '$(HASH_MINGW32)') {
Write-Error -Message "##[error]Computed hash does not match!" -ErrorAction Stop
}
Write-Host "Extracting winlibs..."
Expand-Archive -LiteralPath 'gw32.zip'
Write-Host "Extracted."
Write-Host "Added to path: $env:BUILD_SOURCESDIRECTORY\gw32\mingw32\bin"
Write-Host "##vso[task.prependpath]$env:BUILD_SOURCESDIRECTORY\gw32\mingw32\bin"
$sdkroot = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots' | Select-Object -ExpandProperty KitsRoot10
$wsdkbin = "{0}bin\" -f $sdkroot
$wsdkverbin = "{0}bin\$(WIN11_SDK)\" -f $sdkroot
$wsdkarchbin = "{0}bin\$(WIN11_SDK)\x86" -f $sdkroot
if (Test-Path "$wsdkarchbin") {
Write-Host "##vso[task.setvariable variable=WindowsSdkBinPath;]$wsdkbin"
Write-Host "##vso[task.setvariable variable=WindowsSdkVerBinPath;]$wsdkverbin"
Write-Host "##vso[task.prependpath]$wsdkarchbin"
}
else {
Write-Error -Message "##[error]Can't find Windows SDK ($(WIN11_SDK))" -ErrorAction Stop
}
workingDirectory: $(Build.SourcesDirectory)
- task: CmdLine@2
displayName: GCC version
inputs:
script: g++ --version
- task: BatchScript@1
displayName: CompileShaders
inputs:
filename: DirectXTex/Shaders/CompileShaders.cmd
workingFolder: $(Build.SourcesDirectory)\DirectXTex\Shaders
- task: BatchScript@1
displayName: HLSL
inputs:
filename: DDSView/hlsl.cmd
workingFolder: $(Build.SourcesDirectory)\DDSView
- task: CmdLine@2
displayName: VCPKG install packages
inputs:
script: call vcpkg install --x-manifest-root=$(VCPKG_MANIFEST_DIR) --triplet=x86-mingw-static
workingDirectory: $(VCPKG_ROOT)
- task: CMake@1
displayName: CMake (MinGW32)
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x86
-DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles"
-DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(CompileShadersOutput)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x86-mingw-static
- task: CMake@1
displayName: CMake (MinGW32) Build
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out
- task: CMake@1
displayName: CMake (MinGW32) w/ OpenEXR
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out2 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_OPENEXR_SUPPORT=ON -DDIRECTX_ARCH=x86
-DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles"
-DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(CompileShadersOutput)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x86-mingw-static
- task: CMake@1
displayName: CMake (MinGW32) Build w/ OpenEXR
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2
- task: CMake@1
displayName: CMake (MinGW32) w/ libjpeg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out3 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBJPEG_SUPPORT=ON -DDIRECTX_ARCH=x86
-DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles"
-DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(CompileShadersOutput)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x86-mingw-static
- task: CMake@1
displayName: CMake (MinGW32) Build w/ libjpeg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out3
- task: CMake@1
displayName: CMake (MinGW32) w/ libpng
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out4 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBPNG_SUPPORT=ON -DDIRECTX_ARCH=x86
-DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles"
-DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(CompileShadersOutput)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x86-mingw-static
- task: CMake@1
displayName: CMake (MinGW32) Build w/ libpng
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out4
- job: MINGW64_BUILD
displayName: 'Minimalist GNU for Windows (MinGW-W64) BUILD_TESTING=ON'
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: vcpkgRepo
displayName: Fetch VCPKG
clean: true
fetchTags: false
fetchDepth: 1
path: 's/vcpkg'
- checkout: testRepo
displayName: Fetch Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: CmdLine@2
displayName: VCPKG Bootstrap
inputs:
script: |
call bootstrap-vcpkg.bat
echo ##vso[task.setvariable variable=VCPKG_DEFAULT_TRIPLET;]x64-mingw-static
echo ##vso[task.setvariable variable=VCPKG_DEFAULT_HOST_TRIPLET;]x64-mingw-static
workingDirectory: $(Build.SourcesDirectory)\vcpkg
- task: PowerShell@2
displayName: Setup for Shader Compilation
inputs:
targetType: inline
script: |
$ProgressPreference = 'SilentlyContinue'
$sdkroot = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots' | Select-Object -ExpandProperty KitsRoot10
$wsdkbin = "{0}bin\" -f $sdkroot
$wsdkverbin = "{0}bin\$(WIN11_SDK)\" -f $sdkroot
$wsdkarchbin = "{0}bin\$(WIN11_SDK)\x64" -f $sdkroot
if (Test-Path "$wsdkarchbin") {
Write-Host "##vso[task.setvariable variable=WindowsSdkBinPath;]$wsdkbin"
Write-Host "##vso[task.setvariable variable=WindowsSdkVerBinPath;]$wsdkverbin"
Write-Host "##vso[task.prependpath]$wsdkarchbin"
}
else {
Write-Error -Message "##[error]Can't find Windows SDK ($(WIN11_SDK))" -ErrorAction Stop
}
- task: CmdLine@2
displayName: GCC version
inputs:
script: g++ --version
- task: BatchScript@1
displayName: CompileShaders.cmd
inputs:
filename: DirectXTex/Shaders/CompileShaders.cmd
workingFolder: $(Build.SourcesDirectory)\DirectXTex\Shaders
- task: BatchScript@1
displayName: HLSL
inputs:
filename: DDSView/hlsl.cmd
workingFolder: $(Build.SourcesDirectory)\DDSView
- task: CmdLine@2
displayName: VCPKG install packages
inputs:
script: call vcpkg install --x-manifest-root=$(VCPKG_MANIFEST_DIR) --triplet=x64-mingw-static
workingDirectory: $(VCPKG_ROOT)
- task: CMake@1
displayName: CMake (MinGW-W64)
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x64
-DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles"
-DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(CompileShadersOutput)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-mingw-static
- task: CMake@1
displayName: CMake (MinGW-W64) Build
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out
- task: CMake@1
displayName: CMake (MinGW-W64) w/ OpenEXR
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out2 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_OPENEXR_SUPPORT=ON -DDIRECTX_ARCH=x64 -DBUILD_TESTING=OFF
-DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles"
-DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(CompileShadersOutput)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-mingw-static
- task: CMake@1
displayName: CMake (MinGW-W64) Build w/ OpenEXR
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2
- task: CMake@1
displayName: CMake (MinGW-W64) w/ libjpeg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out3 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBJPEG_SUPPORT=ON -DDIRECTX_ARCH=x64 -DBUILD_TESTING=OFF
-DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles"
-DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(CompileShadersOutput)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-mingw-static
- task: CMake@1
displayName: CMake (MinGW-W64) Build w/ libjpeg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out3
- task: CMake@1
displayName: CMake (MinGW-W64) w/ libpng
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out4 -DCMAKE_BUILD_TYPE="Debug" -DENABLE_LIBPNG_SUPPORT=ON -DDIRECTX_ARCH=x64 -DBUILD_TESTING=OFF
-DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles"
-DUSE_PREBUILT_SHADERS=ON -DCOMPILED_SHADERS=$(CompileShadersOutput)
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-mingw-static
- task: CMake@1
displayName: CMake (MinGW-W64) Build w/ libpng
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out4

View File

@ -0,0 +1,157 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library using the latest prerelease of the Windows SDK from nuget.org.
schedules:
- cron: "0 3 * * 6"
displayName: 'Saturday night build'
branches:
include:
- main
always: true
trigger: none
pr: none
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: EXTRACTED_FOLDER
value: $(ExtractedFolder)
- name: WSDKEnableBWOI
value: true
- name: URL_FEED
value: $(ADOFeedURL)
- name: skipNugetSecurityAnalysis
value: true # We explicitly call this task so we don't need it to be auto-injected
pool:
vmImage: windows-2022
jobs:
- job: DESKTOP_BUILD
displayName: 'Windows Desktop'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet Install WSDK x64
inputs:
command: custom
arguments: install -prerelease Microsoft.Windows.SDK.CPP.x64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet Install WSDK x86
inputs:
command: custom
arguments: install -prerelease Microsoft.Windows.SDK.CPP.x86 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet Install WSDK arm64
inputs:
command: custom
arguments: install -prerelease Microsoft.Windows.SDK.CPP.arm64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CopyFiles@2
displayName: Set up Directory.Build.props
inputs:
SourceFolder: build
Contents: 'Directory.Build.props'
TargetFolder: $(Build.SourcesDirectory)
- template: '/.azuredevops/templates/DirectXTex-build-win32.yml'
- job: UWP_BUILD
displayName: 'Universal Windows Platform (UWP)'
timeoutInMinutes: 240
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
displayName: NuGet set package source to ADO feed
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet Install WSDK x64
inputs:
command: custom
arguments: install -prerelease Microsoft.Windows.SDK.CPP.x64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet Install WSDK x86
inputs:
command: custom
arguments: install -prerelease Microsoft.Windows.SDK.CPP.x86 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet Install WSDK arm64
inputs:
command: custom
arguments: install -prerelease Microsoft.Windows.SDK.CPP.arm64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CopyFiles@2
displayName: Set up Directory.Build.props
inputs:
SourceFolder: build
Contents: 'Directory.Build.props'
TargetFolder: $(Build.SourcesDirectory)
- template: '/.azuredevops/templates/DirectXTex-build-uwp.yml'

View File

@ -0,0 +1,157 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library using the latest release of the Windows SDK from nuget.org.
schedules:
- cron: "0 3 * * 0"
displayName: 'Sunday night build'
branches:
include:
- main
always: true
trigger: none
pr: none
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: EXTRACTED_FOLDER
value: $(ExtractedFolder)
- name: WSDKEnableBWOI
value: true
- name: URL_FEED
value: $(ADOFeedURL)
- name: skipNugetSecurityAnalysis
value: true # We explicitly call this task so we don't need it to be auto-injected
pool:
vmImage: windows-2022
jobs:
- job: DESKTOP_BUILD
displayName: 'Windows Desktop'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
# We have to use a nuget.config to provide the feed for the 'nuget install' option.
displayName: 'NuGet set package source to ADO feed'
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet Install WSDK x64
inputs:
command: custom
arguments: install Microsoft.Windows.SDK.CPP.x64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet Install WSDK x86
inputs:
command: custom
arguments: install Microsoft.Windows.SDK.CPP.x86 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet Install WSDK arm64
inputs:
command: custom
arguments: install Microsoft.Windows.SDK.CPP.arm64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CopyFiles@2
displayName: Set up Directory.Build.props
inputs:
SourceFolder: build
Contents: 'Directory.Build.props'
TargetFolder: $(Build.SourcesDirectory)
- template: '/.azuredevops/templates/DirectXTex-build-win32.yml'
- job: UWP_BUILD
displayName: 'Universal Windows Platform (UWP)'
timeoutInMinutes: 240
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: PowerShell@2
displayName: 'Create nuget.config with single source'
inputs:
targetType: inline
script: |
$xml = @'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>
'@
$xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config"
- task: NuGetCommand@2
displayName: NuGet set package source to ADO feed
inputs:
command: custom
arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config
- task: nuget-security-analysis@0
displayName: 'Secure Supply Chain Analysis'
- task: NuGetAuthenticate@1
displayName: 'NuGet Auth'
- task: NuGetCommand@2
displayName: NuGet Install WSDK x64
inputs:
command: custom
arguments: install Microsoft.Windows.SDK.CPP.x64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet Install WSDK x86
inputs:
command: custom
arguments: install Microsoft.Windows.SDK.CPP.x86 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: NuGetCommand@2
displayName: NuGet Install WSDK arm64
inputs:
command: custom
arguments: install Microsoft.Windows.SDK.CPP.arm64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER)
- task: CopyFiles@2
displayName: Set up Directory.Build.props
inputs:
SourceFolder: build
Contents: 'Directory.Build.props'
TargetFolder: $(Build.SourcesDirectory)
- template: '/.azuredevops/templates/DirectXTex-build-uwp.yml'

View File

@ -0,0 +1,300 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library and test suite.
schedules:
- cron: "30 3 * * *"
displayName: 'Nightly build'
branches:
include:
- main
# GitHub Actions handles test suite for CI/PR
trigger: none
pr:
branches:
include:
- main
paths:
include:
- '.azuredevops/pipelines/DirectXTex-GitHub-Test-Dev17.yml'
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: testRepo
name: walbourn/directxtextest
type: github
endpoint: microsoft
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
pool:
vmImage: windows-2022
variables:
Codeql.Enabled: false
VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
GUID_FEED: $(ADOFeedGUID)
jobs:
- job: DESKTOP_BUILD
displayName: 'Windows Desktop'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
strategy:
maxParallel: 3
matrix:
Release_arm64:
BuildPlatform: ARM64
BuildConfiguration: Release
Debug_arm64:
BuildPlatform: ARM64
BuildConfiguration: Debug
Release_x64:
BuildPlatform: x64
BuildConfiguration: Release
Debug_x64:
BuildPlatform: x64
BuildConfiguration: Debug
Release_x86:
BuildPlatform: x86
BuildConfiguration: Release
Debug_x86:
BuildPlatform: x86
BuildConfiguration: Debug
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: NuGetCommand@2
displayName: NuGet restore tests
inputs:
solution: Tests/DirectXTex_Tests_Desktop_2022.sln
feedRestore: $(GUID_FEED)
includeNuGetOrg: false
- task: VSBuild@1
displayName: Build solution DirectXTex_Tests_Desktop_2022.sln
inputs:
solution: Tests/DirectXTex_Tests_Desktop_2022.sln
vsVersion: 17.0
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArchitecture: x64
condition: ne(variables['BuildPlatform'], 'ARM64')
- task: VSBuild@1
displayName: Build solution DirectXTex_Tests_Desktop_2022_Win10.sln
inputs:
solution: Tests/DirectXTex_Tests_Desktop_2022_Win10.sln
vsVersion: 17.0
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArchitecture: x64
- job: CMAKE_BUILD_X64
displayName: 'CMake for X64 BUILD_TESTING=ON'
timeoutInMinutes: 120
workspace:
clean: all
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: CmdLine@2
displayName: Setup environment for CMake to use VS
inputs:
script: |
call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat"
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
echo ##vso[task.prependpath]%VCToolsInstallDir%bin\Hostx64\x64
echo ##vso[task.setvariable variable=EXTERNAL_INCLUDE;]%EXTERNAL_INCLUDE%
echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE%
echo ##vso[task.setvariable variable=LIB;]%LIB%
- task: CMake@1
displayName: CMake (MSVC; x64-Debug) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug
- task: CMake@1
displayName: CMake (MSVC; x64-Debug) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Debug -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (MSVC; x64-Release) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release
- task: CMake@1
displayName: CMake (MSVC; x64-Release) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Release -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Debug) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-Clang
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Debug) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Debug-Clang -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Release) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release-Clang
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Release) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Release-Clang -v
- job: CMAKE_BUILD_ARM64
displayName: 'CMake for ARM64 BUILD_TESTING=ON'
timeoutInMinutes: 120
workspace:
clean: all
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: CmdLine@2
displayName: Setup environment for CMake to use VS
inputs:
script: |
call "$(VC_PATH)\Auxiliary\Build\vcvarsamd64_arm64.bat"
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
echo ##vso[task.prependpath]%VCToolsInstallDir%bin\Hostx64\arm64
echo ##vso[task.setvariable variable=EXTERNAL_INCLUDE;]%EXTERNAL_INCLUDE%
echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE%
echo ##vso[task.setvariable variable=LIB;]%LIB%
- task: CMake@1
displayName: CMake (MSVC; arm64-Debug) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=arm64-Debug
- task: CMake@1
displayName: CMake (MSVC; arm64-Debug) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64-Debug -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (MSVC; arm64-Release) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=arm64-Release
- task: CMake@1
displayName: CMake (MSVC; arm64-Release) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64-Release -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; arm64-Debug) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=arm64-Debug-Clang
- task: CMake@1
displayName: CMake (clang/LLVM; arm64-Debug) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64-Debug-Clang -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; arm64-Release) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=arm64-Release-Clang
- task: CMake@1
displayName: CMake (clang/LLVM; arm64-Release) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64-Release-Clang -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (MSVC; arm64ec-Debug) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=arm64ec-Debug
- task: CMake@1
displayName: CMake (MSVC; arm64ec-Debug) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64ec-Debug -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (MSVC; arm64ec-Release) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=arm64ec-Release
- task: CMake@1
displayName: CMake (MSVC; arm64ec-Release) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64ec-Release -v

View File

@ -0,0 +1,187 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library and test suite.
schedules:
- cron: "30 3 * * *"
displayName: 'Nightly build'
branches:
include:
- main
# GitHub Actions handles test suite for CI/PR
trigger: none
pr:
branches:
include:
- main
paths:
include:
- '.azuredevops/pipelines/DirectXTex-GitHub-Test.yml'
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: testRepo
name: walbourn/directxtextest
type: github
endpoint: microsoft
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
pool:
vmImage: windows-2019
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: VC_PATH
value: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC'
- name: GUID_FEED
value: $(ADOFeedGUID)
jobs:
- job: DESKTOP_BUILD
displayName: 'Windows Desktop'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
strategy:
maxParallel: 2
matrix:
Release_x64:
BuildPlatform: x64
BuildConfiguration: Release
Debug_x64:
BuildPlatform: x64
BuildConfiguration: Debug
Release_x86:
BuildPlatform: x86
BuildConfiguration: Release
Debug_x86:
BuildPlatform: x86
BuildConfiguration: Debug
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: NuGetCommand@2
displayName: NuGet restore tests
inputs:
solution: Tests/DirectXTex_Tests_Desktop_2019.sln
feedRestore: $(GUID_FEED)
includeNuGetOrg: false
- task: VSBuild@1
displayName: Build solution DirectXTex_Tests_Desktop_2019.sln
inputs:
solution: Tests/DirectXTex_Tests_Desktop_2019.sln
vsVersion: 16.0
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: VSBuild@1
displayName: Build solution DirectXTex_Tests_Desktop_2019_Win10.sln
inputs:
solution: Tests/DirectXTex_Tests_Desktop_2019_Win10.sln
vsVersion: 16.0
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- job: CMAKE_BUILD_X64
displayName: 'CMake for X64 BUILD_TESTING=ON'
timeoutInMinutes: 120
workspace:
clean: all
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: CmdLine@2
displayName: Setup environment for CMake to use VS
inputs:
script: |
call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat"
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
echo ##vso[task.prependpath]%VCToolsInstallDir%bin\Hostx64\x64
echo ##vso[task.setvariable variable=EXTERNAL_INCLUDE;]%EXTERNAL_INCLUDE%
echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE%
echo ##vso[task.setvariable variable=LIB;]%LIB%
- task: CMake@1
displayName: CMake (MSVC; x64-Debug) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug
- task: CMake@1
displayName: CMake (MSVC; x64-Debug) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Debug -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (MSVC; x64-Release) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release
- task: CMake@1
displayName: CMake (MSVC; x64-Release) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Release -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Debug) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug-Clang
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Debug) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Debug-Clang -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Release) Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Release-Clang
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Release) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Release-Clang -v

View File

@ -0,0 +1,171 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library and test suite using MSBuild+VCPKO
schedules:
- cron: "0 5 * * *"
displayName: 'Nightly build'
branches:
include:
- main
trigger:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- '.github/**'
- '.nuget/*'
- build/*.cmd
- build/OneFuzz*.json
- build/*.props
- build/*.ps1
- build/*.targets
pr:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- '.github/**'
- '.nuget/*'
- build/*.cmd
- build/OneFuzz*.json
- build/*.props
- build/*.ps1
- build/*.targets
drafts: false
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: vcpkgRepo
name: Microsoft/vcpkg
type: github
endpoint: microsoft
ref: refs/tags/$(VCPKG_TAG)
- repository: testRepo
name: walbourn/directxtextest
type: github
endpoint: microsoft
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
pool:
vmImage: windows-2022
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: VCPKG_ROOT
value: '$(Build.SourcesDirectory)/vcpkg'
- name: VCPKG_CMAKE_DIR
value: '$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake'
- name: VCPKG_MANIFEST_DIR
value: '$(Build.SourcesDirectory)/build'
jobs:
- job: VCPKG_BUILD
displayName: 'Build with MSBuild+VCPKG'
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: vcpkgRepo
displayName: Fetch VCPKG
clean: true
fetchTags: false
fetchDepth: 1
path: 's/vcpkg'
- task: CmdLine@2
displayName: VCPKG Bootstrap
inputs:
script: |
call bootstrap-vcpkg.bat
echo ##vso[task.setvariable variable=VCPKG_DEFAULT_TRIPLET;]x64-windows
echo ##vso[task.setvariable variable=VCPKG_DEFAULT_HOST_TRIPLET;]x64-windows
workingDirectory: $(Build.SourcesDirectory)\vcpkg
- task: CmdLine@2
displayName: VCPKG install packages
inputs:
script: |
call vcpkg install --x-manifest-root=$(VCPKG_MANIFEST_DIR) --triplet=x64-windows
call vcpkg install --x-manifest-root=$(VCPKG_MANIFEST_DIR) --triplet=x86-windows
call vcpkg install --x-manifest-root=$(VCPKG_MANIFEST_DIR) --triplet=arm64-windows
workingDirectory: $(VCPKG_ROOT)
- task: PowerShell@2
displayName: Setup VCPKG Directory.Build.props and .target files
inputs:
targetType: inline
script: |
$props = "<Project>`n <Import Project=`"`$(MSBuildThisFileDirectory)vcpkg\scripts\buildsystems\msbuild\vcpkg.props`" />`n</Project>`n"
$targets = "<Project>`n <Import Project=`"`$(MSBuildThisFileDirectory)vcpkg\scripts\buildsystems\msbuild\vcpkg.targets`" />`n</Project>`n"
Set-Content -Path "Directory.Build.props" -Value $props
Set-Content -Path "Directory.Build.targets" -Value $targets
workingDirectory: $(Build.SourcesDirectory)
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2022_Win10.sln 32dbg
inputs:
solution: DirectXTex_Desktop_2022_Win10.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x86
configuration: Debug
msbuildArchitecture: x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2022_Win10.sln 32rel
inputs:
solution: DirectXTex_Desktop_2022_Win10.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x86
configuration: Release
msbuildArchitecture: x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2022_Win10.sln 64dbg
inputs:
solution: DirectXTex_Desktop_2022_Win10.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x64
configuration: Debug
msbuildArchitecture: x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2022_Win10.sln 64rel
inputs:
solution: DirectXTex_Desktop_2022_Win10.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x64
configuration: Release
msbuildArchitecture: x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2022_Win10.sln arm64dbg
inputs:
solution: DirectXTex_Desktop_2022_Win10.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: ARM64
configuration: Debug
msbuildArchitecture: x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2022_Win10.sln arm64rel
inputs:
solution: DirectXTex_Desktop_2022_Win10.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: ARM64
configuration: Release
msbuildArchitecture: x64

View File

@ -0,0 +1,267 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library for Windows Subsystem for Linux (WSL)
schedules:
- cron: "0 3 * * *"
displayName: 'Nightly build'
branches:
include:
- main
trigger: none
pr:
branches:
include:
- main
paths:
include:
- '.azuredevops/pipelines/DirectXTex-GitHub-WSL-11.yml'
- CMake*
- build/*.cmake
- build/*.in
- Auxiliary/*EXR*
- Auxiliary/*JPEG*
- Auxiliary/*PNG*
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
trigger: none
- repository: dxHeadersRepo
name: Microsoft/DirectX-Headers
type: github
endpoint: microsoft
ref: refs/heads/main
- repository: dxMathRepo
name: Microsoft/DirectXMath
type: github
endpoint: microsoft
ref: refs/heads/main
- repository: vcpkgRepo
name: Microsoft/vcpkg
type: github
endpoint: microsoft
ref: refs/tags/$(VCPKG_TAG)
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
pool:
vmImage: ubuntu-22.04
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: VCPKG_ROOT
value: '$(Build.SourcesDirectory)/vcpkg'
- name: VCPKG_CMAKE_DIR
value: '$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake'
- name: VCPKG_MANIFEST_DIR
value: '$(Build.SourcesDirectory)/build'
- name: LOCAL_PKG_DIR
value: '$(Agent.BuildDirectory)/install/'
- name: SAL_URL
value: https://raw.githubusercontent.com/dotnet/runtime/v8.0.1/src/coreclr/pal/inc/rt/sal.h
- name: SAL_HASH
value: 0f5a80b97564217db2ba3e4624cc9eb308e19cc9911dae21d983c4ab37003f4756473297ba81b386c498514cedc1ef5a3553d7002edc09aeb6a1335df973095f
jobs:
- job: BUILD_WSL
displayName: 'Windows Subsystem for Linux (WSL)'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: dxHeadersRepo
displayName: Fetch DirectX-Headers
clean: true
fetchTags: false
fetchDepth: 1
path: 's/DirectX-Headers'
- checkout: dxMathRepo
displayName: Fetch DirectX-Math
clean: true
fetchTags: false
fetchDepth: 1
path: 's/DirectXMath'
- task: CMake@1
displayName: CMake DirectX-Headers
inputs:
cwd: DirectX-Headers
cmakeArgs: >
. -DDXHEADERS_BUILD_TEST=OFF -DDXHEADERS_BUILD_GOOGLE_TEST=OFF
-DCMAKE_INSTALL_PREFIX=$(LOCAL_PKG_DIR)
- task: CMake@1
displayName: CMake DirectX-Headers (Build)
inputs:
cwd: DirectX-Headers
cmakeArgs: --build . -v
- task: CMake@1
displayName: CMake DirectX-Headers (Install)
inputs:
cwd: DirectX-Headers
cmakeArgs: --install .
- task: CMake@1
displayName: CMake DirectXMath
inputs:
cwd: DirectXMath
cmakeArgs: . -DCMAKE_INSTALL_PREFIX=$(LOCAL_PKG_DIR)
- task: CMake@1
displayName: CMake DirectXMath (Build)
inputs:
cwd: DirectXMath
cmakeArgs: --build . -v
- task: CMake@1
displayName: CMake DirectXMath (Install)
inputs:
cwd: DirectXMath
cmakeArgs: --install .
- task: PowerShell@2
displayName: Fetch SAL.H
inputs:
targetType: inline
script: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "$(SAL_URL)" -OutFile $(LOCAL_PKG_DIR)/include/sal.h
$fileHash = Get-FileHash -Algorithm SHA512 $(LOCAL_PKG_DIR)/include/sal.h | ForEach { $_.Hash} | Out-String
$filehash = $fileHash.Trim()
Write-Host "##[debug]SHA512: " $filehash
if ($fileHash -ne "$(SAL_HASH)") {
Write-Error -Message "##[error]Computed hash does not match!" -ErrorAction Stop
}
- task: CMake@1
displayName: CMake DirectXTex (Config) dbg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake
- task: CMake@1
displayName: CMake DirectXTex (Build) dbg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out -v
- task: CMake@1
displayName: CMake DirectXTex (Config) rel
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out2 -DCMAKE_BUILD_TYPE=Release
-DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake
- task: CMake@1
displayName: CMake DirectXTex (Build) rel
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2 -v
- job: BUILD_WSL_VCPKG
displayName: 'Windows Subsystem for Linux (WSL) using VCPKG'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: vcpkgRepo
displayName: Fetch VCPKG
clean: true
fetchTags: false
fetchDepth: 1
path: 's/vcpkg'
- task: Bash@3
displayName: VCPKG Bootstrap
inputs:
targetType: filePath
filePath: $(Build.SourcesDirectory)/vcpkg/bootstrap-vcpkg.sh
workingDirectory: $(Build.SourcesDirectory)/vcpkg
- task: CmdLine@2
displayName: GCC and CMake version
inputs:
script: |
g++ --version
cmake --version
- task: CmdLine@2
displayName: VCPKG install packages
inputs:
script: vcpkg install --x-manifest-root=$(VCPKG_MANIFEST_DIR) --triplet=x64-linux
workingDirectory: $(VCPKG_ROOT)
- task: CMake@1
displayName: CMake DirectXTex (Config) dbg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out -DCMAKE_BUILD_TYPE=Debug -DDIRECTX_ARCH=x64
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-linux
- task: CMake@1
displayName: CMake DirectXTex (Build) dbg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out -v
- task: CMake@1
displayName: CMake DirectXTex (Config) rel
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out2 -DCMAKE_BUILD_TYPE=Release -DDIRECTX_ARCH=x64
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-linux
- task: CMake@1
displayName: CMake DirectXTex (Build) rel
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2 -v
- task: CMake@1
displayName: CMake DirectXTex (Config) w/ OpenEXR
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out3 -DCMAKE_BUILD_TYPE=Debug -DENABLE_OPENEXR_SUPPORT=ON -DDIRECTX_ARCH=x64
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-linux
- task: CMake@1
displayName: CMake DirectXTex (Build) w/ OpenEXR
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out3 -v
- task: CMake@1
displayName: CMake DirectXTex (Config) w/ libjpeg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out4 -DCMAKE_BUILD_TYPE=Debug -DENABLE_LIBJPEG_SUPPORT=ON -DDIRECTX_ARCH=x64
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-linux
- task: CMake@1
displayName: CMake DirectXTex (Build) w/ libjpeg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out4 -v
- task: CMake@1
displayName: CMake DirectXTex (Config) w/ libpng
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out5 -DCMAKE_BUILD_TYPE=Debug -DENABLE_LIBPNG_SUPPORT=ON -DDIRECTX_ARCH=x64
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-linux
- task: CMake@1
displayName: CMake DirectXTex (Build) w/ libpng
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out5 -v

View File

@ -0,0 +1,267 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library for Windows Subsystem for Linux (WSL)
schedules:
- cron: "0 3 * * *"
displayName: 'Nightly build'
branches:
include:
- main
trigger: none
pr:
branches:
include:
- main
paths:
include:
- '.azuredevops/pipelines/DirectXTex-GitHub-WSL-13.yml'
- CMake*
- build/*.cmake
- build/*.in
- Auxiliary/*EXR*
- Auxiliary/*JPEG*
- Auxiliary/*PNG*
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
trigger: none
- repository: dxHeadersRepo
name: Microsoft/DirectX-Headers
type: github
endpoint: microsoft
ref: refs/heads/main
- repository: dxMathRepo
name: Microsoft/DirectXMath
type: github
endpoint: microsoft
ref: refs/heads/main
- repository: vcpkgRepo
name: Microsoft/vcpkg
type: github
endpoint: microsoft
ref: refs/tags/$(VCPKG_TAG)
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
pool:
vmImage: ubuntu-24.04
variables:
- group: dxtex-shared-variables
- name: Codeql.Enabled
value: false
- name: VCPKG_ROOT
value: '$(Build.SourcesDirectory)/vcpkg'
- name: VCPKG_CMAKE_DIR
value: '$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake'
- name: VCPKG_MANIFEST_DIR
value: '$(Build.SourcesDirectory)/build'
- name: LOCAL_PKG_DIR
value: '$(Agent.BuildDirectory)/install/'
- name: SAL_URL
value: https://raw.githubusercontent.com/dotnet/runtime/v8.0.1/src/coreclr/pal/inc/rt/sal.h
- name: SAL_HASH
value: 0f5a80b97564217db2ba3e4624cc9eb308e19cc9911dae21d983c4ab37003f4756473297ba81b386c498514cedc1ef5a3553d7002edc09aeb6a1335df973095f
jobs:
- job: BUILD_WSL
displayName: 'Windows Subsystem for Linux (WSL)'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: dxHeadersRepo
displayName: Fetch DirectX-Headers
clean: true
fetchTags: false
fetchDepth: 1
path: 's/DirectX-Headers'
- checkout: dxMathRepo
displayName: Fetch DirectX-Math
clean: true
fetchTags: false
fetchDepth: 1
path: 's/DirectXMath'
- task: CMake@1
displayName: CMake DirectX-Headers
inputs:
cwd: DirectX-Headers
cmakeArgs: >
. -DDXHEADERS_BUILD_TEST=OFF -DDXHEADERS_BUILD_GOOGLE_TEST=OFF
-DCMAKE_INSTALL_PREFIX=$(LOCAL_PKG_DIR)
- task: CMake@1
displayName: CMake DirectX-Headers (Build)
inputs:
cwd: DirectX-Headers
cmakeArgs: --build . -v
- task: CMake@1
displayName: CMake DirectX-Headers (Install)
inputs:
cwd: DirectX-Headers
cmakeArgs: --install .
- task: CMake@1
displayName: CMake DirectXMath
inputs:
cwd: DirectXMath
cmakeArgs: . -DCMAKE_INSTALL_PREFIX=$(LOCAL_PKG_DIR)
- task: CMake@1
displayName: CMake DirectXMath (Build)
inputs:
cwd: DirectXMath
cmakeArgs: --build . -v
- task: CMake@1
displayName: CMake DirectXMath (Install)
inputs:
cwd: DirectXMath
cmakeArgs: --install .
- task: PowerShell@2
displayName: Fetch SAL.H
inputs:
targetType: inline
script: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "$(SAL_URL)" -OutFile $(LOCAL_PKG_DIR)/include/sal.h
$fileHash = Get-FileHash -Algorithm SHA512 $(LOCAL_PKG_DIR)/include/sal.h | ForEach { $_.Hash} | Out-String
$filehash = $fileHash.Trim()
Write-Host "##[debug]SHA512: " $filehash
if ($fileHash -ne "$(SAL_HASH)") {
Write-Error -Message "##[error]Computed hash does not match!" -ErrorAction Stop
}
- task: CMake@1
displayName: CMake DirectXTex (Config) dbg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake
- task: CMake@1
displayName: CMake DirectXTex (Build) dbg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out -v
- task: CMake@1
displayName: CMake DirectXTex (Config) rel
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out2 -DCMAKE_BUILD_TYPE=Release
-DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake
- task: CMake@1
displayName: CMake DirectXTex (Build) rel
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2 -v
- job: BUILD_WSL_VCPKG
displayName: 'Windows Subsystem for Linux (WSL) using VCPKG'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: vcpkgRepo
displayName: Fetch VCPKG
clean: true
fetchTags: false
fetchDepth: 1
path: 's/vcpkg'
- task: Bash@3
displayName: VCPKG Bootstrap
inputs:
targetType: filePath
filePath: $(Build.SourcesDirectory)/vcpkg/bootstrap-vcpkg.sh
workingDirectory: $(Build.SourcesDirectory)/vcpkg
- task: CmdLine@2
displayName: GCC and CMake version
inputs:
script: |
g++ --version
cmake --version
- task: CmdLine@2
displayName: VCPKG install packages
inputs:
script: vcpkg install --x-manifest-root=$(VCPKG_MANIFEST_DIR) --triplet=x64-linux
workingDirectory: $(VCPKG_ROOT)
- task: CMake@1
displayName: CMake DirectXTex (Config) dbg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out -DCMAKE_BUILD_TYPE=Debug -DDIRECTX_ARCH=x64
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-linux
- task: CMake@1
displayName: CMake DirectXTex (Build) dbg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out -v
- task: CMake@1
displayName: CMake DirectXTex (Config) rel
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out2 -DCMAKE_BUILD_TYPE=Release -DDIRECTX_ARCH=x64
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-linux
- task: CMake@1
displayName: CMake DirectXTex (Build) rel
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2 -v
- task: CMake@1
displayName: CMake DirectXTex (Config) w/ OpenEXR
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out3 -DCMAKE_BUILD_TYPE=Debug -DENABLE_OPENEXR_SUPPORT=ON -DDIRECTX_ARCH=x64
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-linux
- task: CMake@1
displayName: CMake DirectXTex (Build) w/ OpenEXR
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out3 -v
- task: CMake@1
displayName: CMake DirectXTex (Config) w/ libjpeg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out4 -DCMAKE_BUILD_TYPE=Debug -DENABLE_LIBJPEG_SUPPORT=ON -DDIRECTX_ARCH=x64
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-linux
- task: CMake@1
displayName: CMake DirectXTex (Build) w/ libjpeg
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out4 -v
- task: CMake@1
displayName: CMake DirectXTex (Config) w/ libpng
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out5 -DCMAKE_BUILD_TYPE=Debug -DENABLE_LIBPNG_SUPPORT=ON -DDIRECTX_ARCH=x64
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"
-DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-linux
- task: CMake@1
displayName: CMake DirectXTex (Build) w/ libpng
inputs:
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out5 -v

View File

@ -0,0 +1,97 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library for Windows Desktop.
schedules:
- cron: "5 3 * * *"
displayName: 'Nightly build'
branches:
include:
- main
# GitHub Actions handles MSBuild for CI/PR
trigger: none
pr:
branches:
include:
- main
paths:
include:
- '.azuredevops/pipelines/DirectXTex-GitHub.yml'
- DirectXTex/Shaders/CompileShaders.cmd
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
variables:
Codeql.Enabled: false
pool:
vmImage: windows-2019
jobs:
- job: DESKTOP_BUILD
displayName: 'Windows Desktop'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
strategy:
maxParallel: 2
matrix:
Release_x64:
BuildPlatform: x64
BuildConfiguration: Release
SpectreMitigation: false
Debug_x64:
BuildPlatform: x64
BuildConfiguration: Debug
SpectreMitigation: false
Release_x86:
BuildPlatform: x86
BuildConfiguration: Release
SpectreMitigation: false
Debug_x86:
BuildPlatform: x86
BuildConfiguration: Debug
SpectreMitigation: false
Release_x64_SpectreMitigated:
BuildPlatform: x64
BuildConfiguration: Release
SpectreMitigation: 'Spectre'
Debug_x64_SpectreMitigated:
BuildPlatform: x64
BuildConfiguration: Debug
SpectreMitigation: 'Spectre'
Release_x86_SpectreMitigated:
BuildPlatform: x86
BuildConfiguration: Release
SpectreMitigation: 'Spectre'
Debug_x86_SpectreMitigated:
BuildPlatform: x86
BuildConfiguration: Debug
SpectreMitigation: 'Spectre'
steps:
- checkout: self
clean: true
fetchTags: false
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2019.sln
inputs:
solution: DirectXTex_Desktop_2019.sln
msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=$(SpectreMitigation)
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2019_Win10.sln
inputs:
solution: DirectXTex_Desktop_2019_Win10.sln
msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=$(SpectreMitigation)
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'

View File

@ -0,0 +1,92 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
# OneFuzz code coverage pipeline
pr: none
trigger: none
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: testRepo
name: walbourn/directxtextest
type: github
endpoint: microsoft
ref: refs/heads/main
pool:
vmImage: windows-latest
parameters:
- name: sasUrl
type: string
displayName: SAS URL
- name: branch
type: string
displayName: Branch
- name: jobID
type: string
displayName: OneFuzz Job ID
- name: buildDate
type: string
displayName: Build Date
- name: commitID
type: string
displayName: Commit ID
variables:
- name: coverage-file
value: cobertura-coverage.xml
- name: job-ID
value: ${{ parameters.jobID }}
- name: build-date
value: ${{ parameters.buildDate }}
- name: branch
value: ${{ parameters.branch }}
- name: sas-url
value: ${{ parameters.sasUrl }}
- name: commit-ID
value: ${{ parameters.commitID }}
jobs:
- job: prod
displayName: Prod Task
workspace:
clean: all
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- powershell: |
Write-Host "Job ID: $(job-ID), Build Date: $(build-date), Branch: $(branch)"
$SASUrl = [System.Uri]::new("$(sas-url)")
azcopy cp $SASUrl.AbsoluteUri ./ --recursive
$ContainerName = $SASURL.LocalPath.Split("/")[1]
Write-Host "##vso[task.setvariable variable=container-name;]$ContainerName"
cd $ContainerName
$size = ((Get-Item .\$(coverage-file)).length)
if ($size -eq 0) {
Write-Host "Cobertura coverage XML is empty."
exit 1
}
displayName: 'Get code coverage from OneFuzz'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: ./$(container-name)\$(coverage-file)
pathToSources: $(Build.SourcesDirectory)
displayName: 'Generate coverage report'

View File

@ -0,0 +1,152 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
# Builds the library using CMake and submit for file fuzzing
schedules:
- cron: "0 12 1 * *"
displayName: 'Submit for File Fuzzing (Monthly)'
branches:
include:
- main
always: true
trigger: none
pr: none
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: testRepo
name: walbourn/directxtextest
type: github
endpoint: microsoft
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
variables:
Codeql.Enabled: false
VS_GENERATOR: 'Visual Studio 17 2022'
WIN11_SDK: '10.0.22000.0'
pool:
vmImage: windows-2022
jobs:
- job: FUZZ_BUILD
displayName: 'Build for file fuzzing'
steps:
- checkout: self
clean: true
fetchTags: false
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: CMake@1
displayName: 'CMake (MSVC): Config with ASan'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out
-DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF
-DBUILD_FUZZING=ON -DBUILD_TESTING=OFF
- task: CMake@1
displayName: 'CMake (MSVC): Build with ASan'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out -v --config RelWithDebInfo
- task: CopyFiles@2
displayName: Copy fuzzer
inputs:
Contents: |
build\OneFuzzConfig.json
out\bin\RelWithDebInfo\fuzzloaders.exe
TargetFolder: .drop
OverWrite: true
flattenFolders: true
- task: CopyFiles@2
displayName: Copy symbols
inputs:
Contents: |
out\bin\RelWithDebInfo\fuzzloaders.pdb
TargetFolder: .drop\symbols
OverWrite: true
flattenFolders: true
- task: PowerShell@2
displayName: Download seed files
inputs:
targetType: inline
script: |
$seedfiles = "AlphaEdge.dds",
"cubea8r8g8b8.dds",
"default_texture_nm.dds",
"dx5_logo.dds",
"hdrtest.dds",
"normalmap.dds",
"grad4d.hdr",
"grad4dunc.hdr",
"BigTree.hdr",
"CBW8.TGA",
"ccm8.tga",
"CTC16.TGA",
"CTC24.TGA",
"CTC32.TGA",
"UTC16.TGA",
"UTC24.TGA",
"UTC32.TGA",
"UBW8.TGA",
"ucm8.tga",
"testimg.ppm",
"grad4d.pfm",
"grad4d.phm",
"grad4d_mono.pfm",
"grad4d_mono.phm";
New-Item -ItemType Directory -Force -Path .drop\seeds\
foreach($filename in $seedfiles)
{
Write-Host "Fetching: $filename"
$url = "https://raw.githubusercontent.com/walbourn/directxtexmedia/main/" + $filename
$target = [System.IO.Path]::Combine(".drop\seeds\", $filename)
Invoke-WebRequest -Uri $url -OutFile $target
}
- task: PowerShell@2
displayName: Copy OneFuzz setup script
inputs:
targetType: 'inline'
script: |
Copy-Item -Path .\build\onefuzz-setup.ps1 -Destination .drop/setup.ps1
- task: MSBuild@1
displayName: 'Copy ASan binaries'
inputs:
solution: build/CopyASAN.targets
msbuildArguments: /p:TargetFolder=$(Build.SourcesDirectory)\.drop
msbuildVersion: 17.0
msbuildArchitecture: x64
- task: PowerShell@2
displayName: List drop files
inputs:
targetType: inline
script: |
Get-ChildItem ".drop" -Recurse | select FullName
- task: onefuzz-task@0
displayName: 'Submit to OneFuzz'
inputs:
onefuzzOSes: 'Windows'
env:
onefuzzDropDirectory: $(Build.SourcesDirectory)\.drop
SYSTEM_ACCESSTOKEN: $(System.AccessToken)

View File

@ -0,0 +1,201 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Runs various SDL recommended tools on the code.
schedules:
- cron: "0 3 * * 0,3,5"
displayName: 'Three times a week'
branches:
include:
- main
always: true
# GitHub Actions handles CodeQL and PREFAST for CI/PR
trigger: none
pr:
branches:
include:
- main
paths:
include:
- '.azuredevops/pipelines/DirectXTex-SDL.yml'
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
variables:
Codeql.Enabled: true
Codeql.Language: cpp
VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
VS_GENERATOR: 'Visual Studio 17 2022'
pool:
vmImage: windows-2022
jobs:
- job: SDL_BUILD
displayName: 'Build using required SDL tools'
workspace:
clean: all
steps:
- checkout: self
clean: true
fetchTags: false
- task: NodeTool@0
displayName: 'NPM install'
inputs:
versionSpec: 14.x
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3
displayName: 'Run Credential Scanner'
inputs:
debugMode: false
folderSuppression: false
- task: PoliCheck@2
displayName: 'Run PoliCheck'
inputs:
result: PoliCheck.xml
- task: Armory@2
displayName: Run ARMory
- task: CMake@1
displayName: 'CMake (MSVC): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out -DENABLE_SPECTRE_MITIGATION=ON
- task: CodeQL3000Init@0
inputs:
Enabled: true
- task: VSBuild@1
displayName: 'Build C++ with CodeQL'
inputs:
solution: '$(Build.SourcesDirectory)/out/DirectXTex.sln'
vsVersion: 17.0
platform: x64
configuration: Release
msbuildArchitecture: x64
- task: CodeQL3000Finalize@0
condition: always()
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out -v --config RelWithDebInfo
- task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@4
displayName: 'Run AntiMalware'
inputs:
InputType: 'Basic'
ScanType: 'CustomScan'
FileDirPath: $(Agent.BuildDirectory)
EnableSERVICEs: true
SupportLogOnError: false
TreatSignatureUpdateFailureAs: 'Warning'
SignatureFreshness: 'OneDay'
TreatStaleSignatureAs: 'Error'
condition: always()
- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@4
displayName: 'Run BinSkim'
inputs:
AnalyzeTargetBinskim: ''
AnalyzeTargetGlob: +:file|out\bin\**\RelWithDebInfo\*.exe
AnalyzeVerbose: true
- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@2
displayName: 'Post Analysis'
inputs:
GdnBreakAllTools: true
GdnBreakPolicy: 'Microsoft'
GdnBreakPolicyMinSev: 'Error'
- task: ComponentGovernanceComponentDetection@0
displayName: Component Detection
- job: SDL_BUILD_DLL
displayName: 'Build using required SDL tools for DLLs'
workspace:
clean: all
steps:
- checkout: self
clean: true
fetchTags: false
- task: NodeTool@0
displayName: 'NPM install'
inputs:
versionSpec: 14.x
- task: CMake@1
displayName: 'CMake (MSVC): Config x64'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: >
-G "$(VS_GENERATOR)" -A x64 -B out
-DENABLE_SPECTRE_MITIGATION=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TOOLS=OFF
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Release'
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out -v --config RelWithDebInfo
- task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@4
displayName: 'Run AntiMalware'
inputs:
InputType: 'Basic'
ScanType: 'CustomScan'
FileDirPath: $(Agent.BuildDirectory)
EnableSERVICEs: true
SupportLogOnError: false
TreatSignatureUpdateFailureAs: 'Warning'
SignatureFreshness: 'OneDay'
TreatStaleSignatureAs: 'Error'
condition: always()
- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@4
displayName: 'Run BinSkim'
inputs:
AnalyzeTargetBinskim: ''
AnalyzeTargetGlob: +:file|out\bin\**\RelWithDebInfo\*.dll
AnalyzeVerbose: true
- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@2
displayName: 'Post Analysis'
inputs:
GdnBreakAllTools: true
GdnBreakPolicy: 'Microsoft'
GdnBreakPolicyMinSev: 'Error'
- task: ComponentGovernanceComponentDetection@0
displayName: Component Detection
- job: VC_PREFAST
displayName: 'Build using /analyze (PREFAST)'
workspace:
clean: all
steps:
- checkout: self
clean: true
fetchTags: false
- task: CmdLine@2
displayName: Setup environment for CMake to use VS
inputs:
script: |
call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat"
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
echo ##vso[task.prependpath]%VCToolsInstallDir%bin\Hostx64\x64
echo ##vso[task.setvariable variable=EXTERNAL_INCLUDE;]%EXTERNAL_INCLUDE%
echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE%
echo ##vso[task.setvariable variable=LIB;]%LIB%
- task: CMake@1
displayName: CMake Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug -DENABLE_CODE_ANALYSIS=ON
- task: CMake@1
displayName: CMake Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Debug

View File

@ -0,0 +1,20 @@
name: approver_count
description: Approver count policy for mscodehub/DirectXTex/DirectXTex repository
resource: repository
where:
configuration:
approverCountPolicySettings:
isBlocking: true
requireMinimumApproverCount: 1
creatorVoteCounts: false
allowDownvotes: false
sourcePushOptions:
resetOnSourcePush: false
requireVoteOnLastIteration: true
requireVoteOnEachIteration: false
resetRejectionsOnSourcePush: false
blockLastPusherVote: true
branchNames:
- refs/heads/release
- refs/heads/main
displayName: mscodehub/DirectXTex/DirectXTex Approver Count Policy

View File

@ -0,0 +1,120 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Template used by GitHub-GDK-* pipelines
parameters:
- name: msVersion
type: string
values:
- '16.0'
- '17.0'
- name: vsYear
type: number
values:
- 2019
- 2022
steps:
- task: VSBuild@1
displayName: Build solution DirectXTex_GDK_${{ parameters.vsYear }} pcdbg
continueOnError: true
inputs:
solution: DirectXTex_GDK_${{ parameters.vsYear }}.sln
vsVersion: ${{ parameters.msVersion }}
platform: Gaming.Desktop.x64
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION)
- task: VSBuild@1
displayName: Build solution DirectXTex_GDK_${{ parameters.vsYear }} pcrel
continueOnError: true
inputs:
solution: DirectXTex_GDK_${{ parameters.vsYear }}.sln
vsVersion: ${{ parameters.msVersion }}
platform: Gaming.Desktop.x64
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION)
- task: VSBuild@1
displayName: Build solution DirectXTex_GDK_${{ parameters.vsYear }} xbdbg
continueOnError: true
inputs:
solution: DirectXTex_GDK_${{ parameters.vsYear }}.sln
vsVersion: ${{ parameters.msVersion }}
platform: Gaming.Xbox.XboxOne.x64
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION)
- task: VSBuild@1
displayName: Build solution DirectXTex_GDK_${{ parameters.vsYear }} xbrel
continueOnError: true
inputs:
solution: DirectXTex_GDK_${{ parameters.vsYear }}.sln
vsVersion: ${{ parameters.msVersion }}
platform: Gaming.Xbox.XboxOne.x64
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION)
- task: VSBuild@1
displayName: Build solution DirectXTex_GDK_${{ parameters.vsYear }} scardbg
continueOnError: true
inputs:
solution: DirectXTex_GDK_${{ parameters.vsYear }}.sln
vsVersion: ${{ parameters.msVersion }}
platform: Gaming.Xbox.Scarlett.x64
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION)
- task: VSBuild@1
displayName: Build solution DirectXTex_GDK_${{ parameters.vsYear }} scarrel
continueOnError: true
inputs:
solution: DirectXTex_GDK_${{ parameters.vsYear }}.sln
vsVersion: ${{ parameters.msVersion }}
platform: Gaming.Xbox.Scarlett.x64
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION)
- task: VSBuild@1
displayName: Build solution DirectXTex_GDK_PC_${{ parameters.vsYear }} dbg
continueOnError: true
inputs:
solution: DirectXTex_GXDK_PC_${{ parameters.vsYear }}.sln
vsVersion: ${{ parameters.msVersion }}
platform: x64
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64 /p:GDKEditionNumber=$(GDK_EDITION)
- task: VSBuild@1
displayName: Build solution DirectXTex_GDK_PC_${{ parameters.vsYear }} rel
continueOnError: true
inputs:
solution: DirectXTex_GXDK_PC_${{ parameters.vsYear }}.sln
vsVersion: ${{ parameters.msVersion }}
platform: x64
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64 /p:GDKEditionNumber=$(GDK_EDITION)
- task: VSBuild@1
displayName: Build solution DirectXTex_GDK_PC_${{ parameters.vsYear }} scardbg
continueOnError: true
inputs:
solution: DirectXTex_GXDK_PC_${{ parameters.vsYear }}.sln
vsVersion: ${{ parameters.msVersion }}
platform: x64
configuration: Debug_Scarlett
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64 /p:GDKEditionNumber=$(GDK_EDITION)
- task: VSBuild@1
displayName: Build solution DirectXTex_GDK_PC_${{ parameters.vsYear }} scarrel
continueOnError: true
inputs:
solution: DirectXTex_GXDK_PC_${{ parameters.vsYear }}.sln
vsVersion: ${{ parameters.msVersion }}
platform: x64
configuration: Release_Scarlett
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64 /p:GDKEditionNumber=$(GDK_EDITION)

View File

@ -0,0 +1,57 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Template used by SDK-release and SDK-prerelease pipelines
steps:
- task: VSBuild@1
displayName: Build solution DirectXTex_Windows10_2022.sln 32dbg
inputs:
solution: DirectXTex_Windows10_2022.sln
platform: x86
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Windows10_2022.sln 32rel
inputs:
solution: DirectXTex_Windows10_2022.sln
platform: x86
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Windows10_2022.sln 64dbg
inputs:
solution: DirectXTex_Windows10_2022.sln
platform: x64
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Windows10_2022.sln 64rel
inputs:
solution: DirectXTex_Windows10_2022.sln
platform: x64
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
# Windows on ARM 32-bit is deprecated. https://learn.microsoft.com/windows/arm/arm32-to-arm64
- task: VSBuild@1
displayName: Build solution DirectXTex_Windows10_2022.sln arm64dbg
inputs:
solution: DirectXTex_Windows10_2022.sln
platform: ARM64
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Windows10_2022.sln arm64rel
inputs:
solution: DirectXTex_Windows10_2022.sln
platform: ARM64
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64

View File

@ -0,0 +1,89 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
# Template used by SDK-release and SDK-prerelease pipelines
steps:
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2019.sln 32dbg
inputs:
solution: DirectXTex_Desktop_2019.sln
platform: x86
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2019.sln 32rel
inputs:
solution: DirectXTex_Desktop_2019.sln
platform: x86
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2019.sln 64dbg
inputs:
solution: DirectXTex_Desktop_2019.sln
platform: x64
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2019.sln 64rel
inputs:
solution: DirectXTex_Desktop_2019.sln
platform: x64
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2019_Win10.sln 32dbg
inputs:
solution: DirectXTex_Desktop_2019_Win10.sln
platform: x86
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2019_Win10.sln 32rel
inputs:
solution: DirectXTex_Desktop_2019_Win10.sln
platform: x86
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2019_Win10.sln 64dbg
inputs:
solution: DirectXTex_Desktop_2019_Win10.sln
platform: x64
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2019_Win10.sln 64rel
inputs:
solution: DirectXTex_Desktop_2019_Win10.sln
platform: x64
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
# VS 2019 for Win32 on ARM64 is out of support.
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2022_Win10.sln arm64dbg
inputs:
solution: DirectXTex_Desktop_2022_Win10.sln
platform: ARM64
configuration: Debug
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64
- task: VSBuild@1
displayName: Build solution DirectXTex_Desktop_2022_Win10.sln arm64rel
inputs:
solution: DirectXTex_Desktop_2022_Win10.sln
platform: ARM64
configuration: Release
msbuildArchitecture: x64
msbuildArgs: /p:PreferredToolArchitecture=x64

View File

@ -1,5 +1,13 @@
root = true
[*.{yml}]
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = crlf
charset = latin1
[*.{fx,fxh,hlsl,hlsli}]
indent_size = 4
indent_style = space

1
.gitattributes vendored
View File

@ -14,6 +14,7 @@
*.vcxproj eol=crlf
*.filters eol=crlf
*.sln eol=crlf
*.yml eol=crlf
# Explicitly declare resource files as binary
*.pdb binary

6
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly

View File

@ -0,0 +1,9 @@
{
"Format": "github-actions",
"exclude": [
".git",
"LICENSE",
"Tests",
"Common/d3dx12.h"
]
}

20
.github/linters/.markdown-lint.yml vendored Normal file
View File

@ -0,0 +1,20 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# line-length
MD013: false
# blanks-around-headings
MD022: false
# blanks-around-lists
MD032: false
# no-inline-html
MD033: false
# no-bare-urls
MD034: false
# first-line-heading
MD041: false

View File

@ -0,0 +1,5 @@
# PSScriptAnalyzerSettings.psd1
@{
Severity=@('Error','Warning')
ExcludeRules=@('PSAvoidUsingWriteHost')
}

17
.github/linters/.yaml-lint.yml vendored Normal file
View File

@ -0,0 +1,17 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
ignore-from-file: .gitignore
extends: default
rules:
truthy:
check-keys: false
document-start: disable
line-length:
max: 160
comments:
min-spaces-from-content: 1
new-lines:
type: dos

133
.github/workflows/bvt.yml vendored Normal file
View File

@ -0,0 +1,133 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
name: 'CTest (BVTs)'
on:
push:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
pull_request:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
permissions:
contents: read
jobs:
build:
runs-on: windows-2022
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
toolver: ['14.29', '14']
build_type: [x64-Release]
arch: [amd64]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Clone test repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: walbourn/directxtextest
path: Tests
ref: main
- name: 'Install Ninja'
run: choco install ninja
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: ${{ matrix.arch }}
toolset: ${{ matrix.toolver }}
- 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"
}
- name: Get vcpkg commit hash
shell: pwsh
run: |
if ($Env:vcpkgRelease) {
echo "Using vcpkg commit from repo variable..."
$VCPKG_COMMIT_ID = $Env:vcpkgRelease
}
else {
echo "Fetching latest vcpkg commit hash..."
$commit = (git ls-remote https://github.com/microsoft/vcpkg.git HEAD | Select-String -Pattern '([a-f0-9]{40})').Matches.Value
$VCPKG_COMMIT_ID = $commit
}
Write-Host "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID"
echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $env:GITHUB_ENV
env:
vcpkgRelease: '${{ vars.VCPKG_COMMIT_ID }}'
- uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11
with:
runVcpkgInstall: true
vcpkgJsonGlob: '**/build/vcpkg.json'
vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
- name: 'Configure CMake'
working-directory: ${{ github.workspace }}
run: >
cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF -DBUILD_BVT=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 }}
run: cmake --build out\build\${{ matrix.build_type }}
- name: 'Run BVTs'
working-directory: ${{ github.workspace }}
run: ctest --preset=${{ matrix.build_type }} --output-on-failure

78
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,78 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
name: "CodeQL"
on:
push:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
pull_request:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
schedule:
- cron: '43 3 * * 3'
permissions:
contents: read
jobs:
analyze:
name: Analyze (C/C++)
runs-on: windows-latest
timeout-minutes: 360
permissions:
actions: read # for github/codeql-action/init to get workflow details
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/autobuild to send a status report
packages: read
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Install Ninja'
run: choco install ninja
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
- name: Initialize CodeQL
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
languages: c-cpp
build-mode: manual
- name: 'Configure CMake'
working-directory: ${{ github.workspace }}
run: cmake --preset=x64-Debug
- name: 'Build'
working-directory: ${{ github.workspace }}
run: cmake --build out\build\x64-Debug
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
category: "/language:c-cpp"

46
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,46 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
name: Lint
on:
pull_request:
branches: "main"
paths-ignore:
- LICENSE
- build/*.in
permissions: {}
jobs:
analyze:
permissions:
contents: read
packages: read
statuses: write
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Lint Code Base
uses: super-linter/super-linter@12150456a73e248bdc94d0794898f94e23127c88 # v7.4.0
env:
DEFAULT_BRANCH: origin/main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORE_GITIGNORED_FILES: true
VALIDATE_ALL_CODEBASE: true
VALIDATE_CHECKOV: true
VALIDATE_EDITORCONFIG: true
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_JSON: true
VALIDATE_MARKDOWN: true
VALIDATE_POWERSHELL: true
VALIDATE_GITLEAKS: true
VALIDATE_YAML: true

144
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,144 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
name: 'CMake (Windows)'
on:
push:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
pull_request:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
permissions:
contents: read
jobs:
build:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
toolver: ['14.29', '14']
build_type: [x64-Debug, x64-Release]
arch: [amd64]
include:
- toolver: '14.29'
build_type: x86-Debug
arch: amd64_x86
- toolver: '14.29'
build_type: x86-Release
arch: amd64_x86
- toolver: '14'
build_type: x86-Debug
arch: amd64_x86
- toolver: '14'
build_type: x86-Release
arch: amd64_x86
- toolver: '14'
build_type: arm64-Debug
arch: amd64_arm64
- toolver: '14'
build_type: arm64-Release
arch: amd64_arm64
- toolver: '14'
build_type: arm64ec-Debug
arch: amd64_arm64
- toolver: '14'
build_type: arm64ec-Release
arch: amd64_arm64
- toolver: '14'
build_type: x64-Debug-Win8
arch: amd64
- toolver: '14'
build_type: x64-Release-Win8
arch: amd64
- toolver: '14'
build_type: x64-Debug-Clang
arch: amd64
- toolver: '14'
build_type: x64-Release-Clang
arch: amd64
- toolver: '14'
build_type: x86-Debug-Clang
arch: amd64_x86
- toolver: '14'
build_type: x86-Release-Clang
arch: amd64_x86
- toolver: '14'
build_type: arm64-Debug-Clang
arch: amd64_arm64
- toolver: '14'
build_type: arm64-Release-Clang
arch: amd64_arm64
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Install Ninja'
run: choco install ninja
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: ${{ matrix.arch }}
toolset: ${{ matrix.toolver }}
- name: 'Configure CMake'
working-directory: ${{ github.workspace }}
run: cmake --preset=${{ matrix.build_type }}
- name: 'Build'
working-directory: ${{ github.workspace }}
run: cmake --build out\build\${{ matrix.build_type }}
- name: 'Clean up'
working-directory: ${{ github.workspace }}
run: Remove-Item -Path out -Recurse -Force
- if: matrix.arch != 'amd64_arm64'
name: 'Configure CMake (Spectre)'
working-directory: ${{ github.workspace }}
run: cmake --preset=${{ matrix.build_type }} -DENABLE_SPECTRE_MITIGATION=ON
- if: matrix.arch != 'amd64_arm64'
name: 'Build (Spectre)'
working-directory: ${{ github.workspace }}
run: cmake --build out\build\${{ matrix.build_type }}
- if: matrix.arch != 'amd64_arm64'
name: 'Clean up'
working-directory: ${{ github.workspace }}
run: Remove-Item -Path out -Recurse -Force
- name: 'Configure CMake (DLL)'
working-directory: ${{ github.workspace }}
run: cmake --preset=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=ON
- name: 'Build (DLL)'
working-directory: ${{ github.workspace }}
run: cmake --build out\build\${{ matrix.build_type }}

84
.github/workflows/msbuild.yml vendored Normal file
View File

@ -0,0 +1,84 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
name: MSBuild
on:
push:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*
pull_request:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*
permissions:
contents: read
jobs:
build:
runs-on: windows-2022 # has v142 tools but not v142 spectre libs
strategy:
fail-fast: false
matrix:
vs: [2019, 2022]
build_type: [Debug, Release]
platform: [x86, x64, ARM64]
exclude:
- vs: 2019
platform: ARM64
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0
- if: matrix.platform != 'ARM64'
name: Build
working-directory: ${{ github.workspace }}
run: >
msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }}
DirectXTex_Desktop_${{ matrix.vs }}.sln
- name: 'Build (Windows 10)'
working-directory: ${{ github.workspace }}
run: >
msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }}
DirectXTex_Desktop_${{ matrix.vs }}_Win10.sln
- if: matrix.vs == '2022'
name: 'Build (UWP)'
working-directory: ${{ github.workspace }}
run: >
msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }}
DirectXTex_Windows10_2022.sln
- if: matrix.platform != 'ARM64' && matrix.vs != '2019'
name: 'Build (Spectre)'
working-directory: ${{ github.workspace }}
run: >
msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }}
/p:SpectreMitigation=Spectre
DirectXTex_Desktop_${{ matrix.vs }}.sln
- if: matrix.platform != 'ARM64' && matrix.vs != '2019'
name: 'Build (Spectre Windows 10)'
working-directory: ${{ github.workspace }}
run: >
msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }}
/p:SpectreMitigation=Spectre
DirectXTex_Desktop_${{ matrix.vs }}_Win10.sln

88
.github/workflows/msvc.yml vendored Normal file
View File

@ -0,0 +1,88 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
name: Microsoft C++ Code Analysis
on:
push:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
pull_request:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
schedule:
- cron: '41 16 * * 1'
permissions:
contents: read
jobs:
analyze:
permissions:
contents: read
security-events: write
actions: read
name: Analyze
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: amd64
- name: Configure CMake
working-directory: ${{ github.workspace }}
run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
- name: 'Build Shaders (BC)'
shell: cmd
working-directory: ./DirectXTex/Shaders
run: CompileShaders.cmd
env:
CompileShadersOutput: ${{ github.workspace }}/out/Shaders/Compiled
- name: 'Build Shaders (DDSVIEW)'
shell: cmd
working-directory: ./DDSView
run: hlsl.cmd
env:
CompileShadersOutput: ${{ github.workspace }}/out/Shaders/Compiled
- name: Initialize MSVC Code Analysis
uses: microsoft/msvc-code-analysis-action@24c285ab36952c9e9182f4b78dfafbac38a7e5ee # v0.1.1
id: run-analysis
with:
cmakeBuildDirectory: ./out
buildConfiguration: Debug
ruleset: NativeRecommendedRules.ruleset
# Upload SARIF file to GitHub Code Scanning Alerts
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}

188
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,188 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
name: 'CTest (Windows)'
on:
push:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
pull_request:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
env:
DIRECTXTEX_MEDIA_PATH: ${{ github.workspace }}/Media
permissions:
contents: read
jobs:
build:
runs-on: windows-2022
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
toolver: ['14.29', '14']
build_type: [x64-Debug, x64-Release]
arch: [amd64]
include:
- toolver: '14.29'
build_type: x86-Debug
arch: amd64_x86
- toolver: '14.29'
build_type: x86-Release
arch: amd64_x86
- toolver: '14'
build_type: x86-Debug
arch: amd64_x86
- toolver: '14'
build_type: x86-Release
arch: amd64_x86
- toolver: '14'
build_type: x64-Debug-Clang
arch: amd64
- toolver: '14'
build_type: x64-Release-Clang
arch: amd64
- toolver: '14'
build_type: x86-Debug-Clang
arch: amd64_x86
- toolver: '14'
build_type: x86-Release-Clang
arch: amd64_x86
- toolver: '14'
build_type: arm64-Debug
arch: amd64_arm64
- toolver: '14'
build_type: arm64-Release
arch: amd64_arm64
- toolver: '14'
build_type: arm64ec-Debug
arch: amd64_arm64
- toolver: '14'
build_type: arm64ec-Release
arch: amd64_arm64
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Clone test repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: walbourn/directxtextest
path: Tests
ref: main
- name: 'Install Ninja'
run: choco install ninja
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: ${{ matrix.arch }}
toolset: ${{ matrix.toolver }}
- 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"
}
- name: Get vcpkg commit hash
shell: pwsh
run: |
if ($Env:vcpkgRelease) {
echo "Using vcpkg commit from repo variable..."
$VCPKG_COMMIT_ID = $Env:vcpkgRelease
}
else {
echo "Fetching latest vcpkg commit hash..."
$commit = (git ls-remote https://github.com/microsoft/vcpkg.git HEAD | Select-String -Pattern '([a-f0-9]{40})').Matches.Value
$VCPKG_COMMIT_ID = $commit
}
Write-Host "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID"
echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $env:GITHUB_ENV
env:
vcpkgRelease: '${{ vars.VCPKG_COMMIT_ID }}'
- uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11
with:
runVcpkgInstall: true
vcpkgJsonGlob: '**/build/vcpkg.json'
vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
- 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
-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 }}
run: cmake --build out\build\${{ matrix.build_type }}
- name: 'Clean up'
working-directory: ${{ github.workspace }}
run: Remove-Item -Path out -Recurse -Force
- name: 'Configure CMake (DLL)'
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
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build"
-DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}" -DBUILD_SHARED_LIBS=ON
- name: 'Build (DLL)'
working-directory: ${{ github.workspace }}
run: cmake --build out\build\${{ matrix.build_type }}

96
.github/workflows/uwp.yml vendored Normal file
View File

@ -0,0 +1,96 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926
name: 'CMake (UWP)'
on:
push:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
pull_request:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
permissions:
contents: read
jobs:
build:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
build_type: [x64-Debug-UWP, x64-Release-UWP, x64-Debug-UWP-Clang, x64-Release-UWP-Clang]
arch: [amd64]
include:
- build_type: x86-Debug-UWP
arch: amd64_x86
- build_type: x86-Release-UWP
arch: amd64_x86
- build_type: x86-Debug-UWP-Clang
arch: amd64_x86
- build_type: x86-Release-UWP-Clang
arch: amd64_x86
- build_type: arm64-Debug-UWP
arch: amd64_arm64
- build_type: arm64-Release-UWP
arch: amd64_arm64
- build_type: arm64-Debug-UWP-Clang
arch: amd64_arm64
- build_type: arm64-Release-UWP-Clang
arch: amd64_arm64
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Install Ninja'
run: choco install ninja
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: ${{ matrix.arch }}
uwp: true
- name: 'Configure CMake'
working-directory: ${{ github.workspace }}
run: cmake --preset=${{ matrix.build_type }}
- name: 'Build'
working-directory: ${{ github.workspace }}
run: cmake --build out\build\${{ matrix.build_type }}
- name: 'Clean up'
working-directory: ${{ github.workspace }}
run: Remove-Item -Path out -Recurse -Force
- name: 'Configure CMake (DLL)'
working-directory: ${{ github.workspace }}
run: cmake --preset=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=ON
- name: 'Build (DLL)'
working-directory: ${{ github.workspace }}
run: cmake --build out\build\${{ matrix.build_type }}

161
.github/workflows/vcpkg.yml vendored Normal file
View File

@ -0,0 +1,161 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
name: 'CMake (Windows using VCPKG)'
on:
push:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- build/*.cmd
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
pull_request:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- build/*.cmd
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
permissions:
contents: read
jobs:
build:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
toolver: ['14.29', '14']
build_type: [x64-Debug-VCPKG]
arch: [amd64]
shared: ['OFF']
include:
- toolver: '14'
build_type: x64-Debug-Clang-VCPKG
arch: amd64
shared: 'OFF'
- toolver: '14'
build_type: x86-Debug-VCPKG
arch: amd64_x86
shared: 'OFF'
- toolver: '14'
build_type: arm64-Debug-VCPKG
arch: amd64_arm64
shared: 'OFF'
- toolver: '14'
build_type: arm64ec-Debug-VCPKG
arch: amd64_arm64
shared: 'OFF'
- toolver: '14'
build_type: x64-Debug-MinGW
arch: amd64
shared: 'OFF'
- toolver: '14'
build_type: x64-Release-MinGW
arch: amd64
shared: 'OFF'
- toolver: '14'
build_type: x64-Debug-MinGW
arch: amd64
shared: 'ON'
- toolver: '14'
build_type: x64-Release-MinGW
arch: amd64
shared: 'ON'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Install Ninja'
run: choco install ninja
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: ${{ matrix.arch }}
toolset: ${{ matrix.toolver }}
- name: 'Set triplet'
shell: pwsh
run: |
if ("${{ matrix.arch }}" -eq "amd64")
{
if ("${{ matrix.build_type }}" -match "MinGW")
{
echo "VCPKG_DEFAULT_TRIPLET=x64-mingw-static" >> $env:GITHUB_ENV
}
else
{
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"
}
- name: Get vcpkg commit hash
shell: pwsh
run: |
if ($Env:vcpkgRelease) {
echo "Using vcpkg commit from repo variable..."
$VCPKG_COMMIT_ID = $Env:vcpkgRelease
}
else {
echo "Fetching latest vcpkg commit hash..."
$commit = (git ls-remote https://github.com/microsoft/vcpkg.git HEAD | Select-String -Pattern '([a-f0-9]{40})').Matches.Value
$VCPKG_COMMIT_ID = $commit
}
Write-Host "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID"
echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $env:GITHUB_ENV
env:
vcpkgRelease: '${{ vars.VCPKG_COMMIT_ID }}'
- uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11
with:
runVcpkgInstall: true
vcpkgJsonGlob: '**/build/vcpkg.json'
vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
- name: 'Configure CMake'
working-directory: ${{ github.workspace }}
run: >
cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=OFF
-DENABLE_OPENEXR_SUPPORT=ON -DENABLE_LIBJPEG_SUPPORT=ON -DENABLE_LIBPNG_SUPPORT=ON
-DBUILD_SHARED_LIBS=${{ matrix.shared }}
-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 }}
run: cmake --build out\build\${{ matrix.build_type }}

110
.github/workflows/wsl.yml vendored Normal file
View File

@ -0,0 +1,110 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# https://go.microsoft.com/fwlink/?LinkId=248926
name: 'CMake (WSL)'
on:
push:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
pull_request:
branches: "main"
paths-ignore:
- '*.md'
- LICENSE
- '.azuredevops/**'
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_type: [x64-Debug-Linux, x64-Release-Linux]
gcc: [12, 13, 14]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
- name: Get vcpkg commit hash
shell: pwsh
run: |
if ($Env:vcpkgRelease) {
echo "Using vcpkg commit from repo variable..."
$VCPKG_COMMIT_ID = $Env:vcpkgRelease
}
else {
echo "Fetching latest vcpkg commit hash..."
$commit = (git ls-remote https://github.com/microsoft/vcpkg.git HEAD | Select-String -Pattern '([a-f0-9]{40})').Matches.Value
$VCPKG_COMMIT_ID = $commit
}
Write-Host "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID"
echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $env:GITHUB_ENV
env:
vcpkgRelease: '${{ vars.VCPKG_COMMIT_ID }}'
- uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11
with:
runVcpkgInstall: true
vcpkgJsonGlob: '**/build/vcpkg.json'
vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
- name: 'Configure CMake'
working-directory: ${{ github.workspace }}
run: >
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"
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
- name: 'Build'
working-directory: ${{ github.workspace }}
run: cmake --build out/build/${{ matrix.build_type }}
- name: 'Clean up'
working-directory: ${{ github.workspace }}
run: rm -rf out
- name: 'Configure CMake (-shared)'
working-directory: ${{ github.workspace }}
run: >
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" -DBUILD_SHARED_LIBS=ON
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
- name: 'Build (-shared)'
working-directory: ${{ github.workspace }}
run: cmake --build out/build/${{ matrix.build_type }}

2
.gitignore vendored
View File

@ -34,6 +34,8 @@ Profile
Release
x64
/Tests
/Testing
/wiki
/out
/CMakeUserPresets.json
/build/vcpkg_installed

View File

@ -1,16 +0,0 @@
@PACKAGE_INIT@
include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake)
include(CMakeFindDependencyMacro)
set(ENABLE_OPENEXR_SUPPORT @ENABLE_OPENEXR_SUPPORT@)
if(ENABLE_OPENEXR_SUPPORT)
find_dependency(OpenEXR)
endif()
if(MINGW OR (NOT WIN32) OR VCPKG_TOOLCHAIN)
find_dependency(directx-headers CONFIG)
find_dependency(directxmath CONFIG)
endif()
check_required_components("@PROJECT_NAME@")

View File

@ -7,10 +7,10 @@
<authors>Microsoft</authors>
<owners>microsoft,directxtk</owners>
<summary>DirectXTex texture processing library</summary>
<description>This version is for Windows desktop applications using Visual Studio 2019 or Visual Studio 2022 and supports Windows 7 / DirectX 11.
<description>This version is for Windows desktop applications using Visual Studio 2019 (16.11) or Visual Studio 2022 on Windows 8.1 or later.
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.</description>
<releaseNotes>Matches the October 17, 2022 release on GitHub.</releaseNotes>
<releaseNotes>Matches the July 9, 2025 release on GitHub.</releaseNotes>
<projectUrl>http://go.microsoft.com/fwlink/?LinkId=248926</projectUrl>
<repository type="git" url="https://github.com/microsoft/DirectXTex.git" />
<icon>images\icon.jpg</icon>
@ -31,15 +31,27 @@ DirectXTex, a shared source library for reading and writing .DDS files, and perf
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2019\Win32\Debug\*.lib" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2019\Win32\Debug\*.pdb" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2019\Win32\DebugSpectre\*.lib" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2019\Win32\DebugSpectre\*.pdb" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Desktop_2019\Win32\Release\*.lib" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Desktop_2019\Win32\Release\*.pdb" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Desktop_2019\Win32\ReleaseSpectre\*.lib" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Desktop_2019\Win32\ReleaseSpectre\*.pdb" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Desktop_2019\x64\Debug\*.lib" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Desktop_2019\x64\Debug\*.pdb" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Desktop_2019\x64\DebugSpectre\*.lib" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Desktop_2019\x64\DebugSpectre\*.pdb" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2019\x64\Release\*.lib" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2019\x64\Release\*.pdb" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2019\x64\ReleaseSpectre\*.lib" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2019\x64\ReleaseSpectre\*.pdb" />
<file src=".nuget/directxtex_desktop_2019.targets" target="build\native" />
<file src=".nuget/icon.jpg" target="images\" />

View File

@ -16,12 +16,14 @@
<PropertyGroup>
<directxtex-LibPath>$(MSBuildThisFileDirectory)..\..\native\lib\$(PlatformTarget)\$(NuGetConfiguration)</directxtex-LibPath>
<directxtex-LibName Condition="'$(SpectreMitigation)'!='' AND '$(SpectreMitigation)'!='false'">DirectXTex_Spectre</directxtex-LibName>
<directxtex-LibName Condition="'$(directxtex-LibName)'==''">DirectXTex</directxtex-LibName>
</PropertyGroup>
<ItemDefinitionGroup>
<Link>
<AdditionalLibraryDirectories>$(directxtex-LibPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>DirectXTex.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(directxtex-LibName).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>

View File

@ -3,14 +3,14 @@
<metadata minClientVersion="2.8.6">
<id>directxtex_desktop_win10</id>
<version>0.0.0-SpecifyVersionOnCommandline</version>
<title>DirectXTex Library (VS 2019/2022 Win32 for Windows 10/11)</title>
<title>DirectXTex Library (VS 2022 Win32 for Windows 10/11)</title>
<authors>Microsoft</authors>
<owners>microsoft,directxtk</owners>
<summary>DirectXTex texture processing library</summary>
<description>This version is for Windows desktop applications using Visual Studio 2019 or Visual Studio 2022 and supports Windows 10 / Windows 11 including both DirectX 11 and DirectX 12.
<description>This version is for Windows desktop applications using Visual Studio 2022 on 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.</description>
<releaseNotes>Matches the October 17, 2022 release on GitHub.</releaseNotes>
<releaseNotes>Matches the July 9, 2025 release on GitHub.</releaseNotes>
<projectUrl>http://go.microsoft.com/fwlink/?LinkId=248926</projectUrl>
<repository type="git" url="https://github.com/microsoft/DirectXTex.git" />
<icon>images\icon.jpg</icon>
@ -18,7 +18,7 @@ DirectXTex, a shared source library for reading and writing .DDS files, and perf
<license type="expression">MIT</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<tags>DirectX DirectXTex native nativepackage</tags>
<tags>DirectX DirectXTex native nativepackage ARM64</tags>
</metadata>
<files>
@ -28,23 +28,41 @@ DirectXTex, a shared source library for reading and writing .DDS files, and perf
<file target="include" src="DirectXTex\DirectXTex.h" />
<file target="include" src="DirectXTex\DirectXTex.inl" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2019_Win10\Win32\Debug\*.lib" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2019_Win10\Win32\Debug\*.pdb" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\Win32\Debug\*.lib" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\Win32\Debug\*.pdb" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Desktop_2019_Win10\Win32\Release\*.lib" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Desktop_2019_Win10\Win32\Release\*.pdb" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\Win32\DebugSpectre\*.lib" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\Win32\DebugSpectre\*.pdb" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Desktop_2019_Win10\x64\Debug\*.lib" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Desktop_2019_Win10\x64\Debug\*.pdb" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Desktop_2022_Win10\Win32\Release\*.lib" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Desktop_2022_Win10\Win32\Release\*.pdb" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2019_Win10\x64\Release\*.lib" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2019_Win10\x64\Release\*.pdb" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Desktop_2022_Win10\Win32\ReleaseSpectre\*.lib" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Desktop_2022_Win10\Win32\ReleaseSpectre\*.pdb" />
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Desktop_2019_Win10\ARM64\Debug\*.lib" />
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Desktop_2019_Win10\ARM64\Debug\*.pdb" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\x64\Debug\*.lib" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\x64\Debug\*.pdb" />
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Desktop_2019_Win10\ARM64\Release\*.lib" />
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Desktop_2019_Win10\ARM64\Release\*.pdb" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\x64\DebugSpectre\*.lib" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\x64\DebugSpectre\*.pdb" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2022_Win10\x64\Release\*.lib" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2022_Win10\x64\Release\*.pdb" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2022_Win10\x64\ReleaseSpectre\*.lib" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2022_Win10\x64\ReleaseSpectre\*.pdb" />
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\ARM64\Debug\*.lib" />
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\ARM64\Debug\*.pdb" />
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\ARM64\DebugSpectre\*.lib" />
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\ARM64\DebugSpectre\*.pdb" />
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Desktop_2022_Win10\ARM64\Release\*.lib" />
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Desktop_2022_Win10\ARM64\Release\*.pdb" />
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Desktop_2022_Win10\ARM64\ReleaseSpectre\*.lib" />
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Desktop_2022_Win10\ARM64\ReleaseSpectre\*.pdb" />
<file src=".nuget/directxtex_desktop_win10.targets" target="build\native" />

View File

@ -14,6 +14,12 @@
<NuGetConfiguration>Release</NuGetConfiguration>
</PropertyGroup>
<PropertyGroup>
<directxtex-LibPath>$(MSBuildThisFileDirectory)..\..\native\lib\$(PlatformTarget)\$(NuGetConfiguration)</directxtex-LibPath>
<directxtex-LibName Condition="'$(SpectreMitigation)'!='' AND '$(SpectreMitigation)'!='false'">DirectXTex_Spectre</directxtex-LibName>
<directxtex-LibName Condition="'$(directxtex-LibName)'==''">DirectXTex</directxtex-LibName>
</PropertyGroup>
<PropertyGroup>
<directxtex-LibPath>$(MSBuildThisFileDirectory)..\..\native\lib\$(PlatformTarget)\$(NuGetConfiguration)</directxtex-LibPath>
</PropertyGroup>
@ -21,7 +27,7 @@
<ItemDefinitionGroup>
<Link>
<AdditionalLibraryDirectories>$(directxtex-LibPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>DirectXTex.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(directxtex-LibName).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>

View File

@ -7,10 +7,10 @@
<authors>Microsoft</authors>
<owners>microsoft,directxtk</owners>
<summary>DirectXTex texture processing library</summary>
<description>This version is for Universal Windows Platform apps on Windows 10 / Windows 11 using Visual Studio 2019 or Visual Studio 2022.
<description>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.</description>
<releaseNotes>Matches the October 17, 2022 release on GitHub.</releaseNotes>
<releaseNotes>Matches the July 9, 2025 release on GitHub.</releaseNotes>
<projectUrl>http://go.microsoft.com/fwlink/?LinkId=248926</projectUrl>
<repository type="git" url="https://github.com/microsoft/DirectXTex.git" />
<icon>images\icon.jpg</icon>
@ -18,7 +18,7 @@ DirectXTex, a shared source library for reading and writing .DDS files, and perf
<license type="expression">MIT</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<tags>DirectX DirectXTex native nativepackage</tags>
<tags>DirectX DirectXTex native nativepackage ARM64</tags>
</metadata>
<files>
@ -28,29 +28,23 @@ DirectXTex, a shared source library for reading and writing .DDS files, and perf
<file target="include" src="DirectXTex\DirectXTex.h" />
<file target="include" src="DirectXTex\DirectXTex.inl" />
<file target="native\lib\ARM\Debug" src="DirectXTex\Bin\Windows10_2019\ARM\Debug\*.lib" />
<file target="native\lib\ARM\Debug" src="DirectXTex\Bin\Windows10_2019\ARM\Debug\*.pdb" />
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Windows10_2022\ARM64\Debug\*.lib" />
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Windows10_2022\ARM64\Debug\*.pdb" />
<file target="native\lib\ARM\Release" src="DirectXTex\Bin\Windows10_2019\ARM\Release\*.lib" />
<file target="native\lib\ARM\Release" src="DirectXTex\Bin\Windows10_2019\ARM\Release\*.pdb" />
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Windows10_2022\ARM64\Release\*.lib" />
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Windows10_2022\ARM64\Release\*.pdb" />
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Windows10_2019\ARM64\Debug\*.lib" />
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Windows10_2019\ARM64\Debug\*.pdb" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Windows10_2022\Win32\Debug\*.lib" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Windows10_2022\Win32\Debug\*.pdb" />
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Windows10_2019\ARM64\Release\*.lib" />
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Windows10_2019\ARM64\Release\*.pdb" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Windows10_2022\Win32\Release\*.lib" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Windows10_2022\Win32\Release\*.pdb" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Windows10_2019\Win32\Debug\*.lib" />
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Windows10_2019\Win32\Debug\*.pdb" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Windows10_2022\x64\Debug\*.lib" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Windows10_2022\x64\Debug\*.pdb" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Windows10_2019\Win32\Release\*.lib" />
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Windows10_2019\Win32\Release\*.pdb" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Windows10_2019\x64\Debug\*.lib" />
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Windows10_2019\x64\Debug\*.pdb" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Windows10_2019\x64\Release\*.lib" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Windows10_2019\x64\Release\*.pdb" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Windows10_2022\x64\Release\*.lib" />
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Windows10_2022\x64\Release\*.pdb" />
<file src=".nuget/directxtex_uwp.targets" target="build\native" />

0
.onefuzz Normal file
View File

View File

@ -1,7 +1,7 @@
//--------------------------------------------------------------------------------------
// File: DirectXTexEXR.cpp
//
// DirectXTex Auxillary functions for using the OpenEXR library
// DirectXTex Auxilary functions for using the OpenEXR library
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
@ -22,7 +22,7 @@
#include <tuple>
//
// Requires the OpenEXR library <http://www.openexr.com/> and ZLIB <http://www.zlib.net>
// Requires the OpenEXR library <http://www.openexr.com/> and its dependencies.
//
#ifdef __clang__
@ -45,8 +45,13 @@
#pragma warning(disable : 4244 4996)
#include <ImfRgbaFile.h>
#include <ImfIO.h>
// https://openexr.com/en/latest/PortingGuide.html
#include <OpenEXRConfig.h>
#pragma warning(pop)
#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + (100*OPENEXR_VERSION_MINOR) + OPENEXR_VERSION_PATCH)
#ifdef __clang__
#pragma clang diagnostic pop
#endif
@ -148,6 +153,13 @@ namespace
SetLastError(0);
}
#if COMBINED_OPENEXR_VERSION >= 30300
int64_t read(void *buf, uint64_t sz, uint64_t offset) override
{
return Imf::IStream::read(buf, sz, offset);
}
#endif
private:
HANDLE m_hFile;
LONGLONG m_EOF;
@ -157,7 +169,8 @@ namespace
{
public:
OutputStream(HANDLE hFile, const char fileName[]) :
OStream(fileName), m_hFile(hFile) {}
OStream(fileName), m_hFile(hFile)
{}
OutputStream(const OutputStream&) = delete;
OutputStream& operator = (const OutputStream&) = delete;
@ -216,32 +229,28 @@ HRESULT DirectX::GetMetadataFromEXRFile(const wchar_t* szFile, TexMetadata& meta
return E_INVALIDARG;
#ifdef _WIN32
char fileName[MAX_PATH] = {};
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName, MAX_PATH, nullptr, nullptr);
if (result <= 0)
std::string fileName;
const int nameLength = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, nullptr, 0, nullptr, nullptr);
if (nameLength > 0)
{
*fileName = 0;
fileName.resize(static_cast<size_t>(nameLength));
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName.data(), nameLength, nullptr, nullptr);
if (result <= 0)
{
fileName.clear();
}
}
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(
szFile,
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
#else
ScopedHandle hFile(safe_handle(CreateFileW(
szFile,
GENERIC_READ, FILE_SHARE_READ,
nullptr,
OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN,
nullptr)));
#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
}
InputStream stream(hFile.get(), fileName);
InputStream stream(hFile.get(), fileName.c_str());
#else
std::wstring wFileName(szFile);
std::string fileName(wFileName.cbegin(), wFileName.cend());
@ -251,32 +260,43 @@ HRESULT DirectX::GetMetadataFromEXRFile(const wchar_t* szFile, TexMetadata& meta
try
{
#ifdef _WIN32
#ifdef _WIN32
Imf::RgbaInputFile file(stream);
#else
#else
Imf::RgbaInputFile file(fileName.c_str());
#endif
#endif
const auto dw = file.dataWindow();
const int width = dw.max.x - dw.min.x + 1;
const int height = dw.max.y - dw.min.y + 1;
int height = dw.max.y - dw.min.y + 1;
size_t arraySize = 1;
if (width < 1 || height < 1)
return E_FAIL;
if (file.header().find("envmap") != file.header().end())
{
if (width == height / 6)
{
height = width;
arraySize = 6;
}
}
metadata.width = static_cast<size_t>(width);
metadata.height = static_cast<size_t>(height);
metadata.depth = metadata.arraySize = metadata.mipLevels = 1;
metadata.depth = metadata.mipLevels = 1;
metadata.arraySize = arraySize;
metadata.format = DXGI_FORMAT_R16G16B16A16_FLOAT;
metadata.dimension = TEX_DIMENSION_TEXTURE2D;
}
#ifdef _WIN32
catch (const com_exception& exc)
{
#ifdef _DEBUG
#ifdef _DEBUG
OutputDebugStringA(exc.what());
#endif
#endif
hr = exc.get_result();
}
#endif
@ -318,32 +338,28 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
}
#ifdef _WIN32
char fileName[MAX_PATH] = {};
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName, MAX_PATH, nullptr, nullptr);
if (result <= 0)
std::string fileName;
const int nameLength = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, nullptr, 0, nullptr, nullptr);
if (nameLength > 0)
{
*fileName = 0;
fileName.resize(static_cast<size_t>(nameLength));
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName.data(), nameLength, nullptr, nullptr);
if (result <= 0)
{
fileName.clear();
}
}
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(
szFile,
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
#else
ScopedHandle hFile(safe_handle(CreateFileW(
szFile,
GENERIC_READ, FILE_SHARE_READ,
nullptr,
OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN,
nullptr)));
#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
}
InputStream stream(hFile.get(), fileName);
InputStream stream(hFile.get(), fileName.c_str());
#else
std::wstring wFileName(szFile);
std::string fileName(wFileName.cbegin(), wFileName.cend());
@ -353,31 +369,43 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
try
{
#ifdef _WIN32
#ifdef _WIN32
Imf::RgbaInputFile file(stream);
#else
#else
Imf::RgbaInputFile file(fileName.c_str());
#endif
#endif
auto const dw = file.dataWindow();
const auto dw = file.dataWindow();
const int width = dw.max.x - dw.min.x + 1;
const int height = dw.max.y - dw.min.y + 1;
int height = dw.max.y - dw.min.y + 1;
size_t arraySize = 1;
if (width < 1 || height < 1)
return E_FAIL;
if (file.header().find("envmap") != file.header().end())
{
if (width == height / 6)
{
height = width;
arraySize = 6;
}
}
if (metadata)
{
metadata->width = static_cast<size_t>(width);
metadata->height = static_cast<size_t>(height);
metadata->depth = metadata->arraySize = metadata->mipLevels = 1;
metadata->depth = metadata->mipLevels = 1;
metadata->arraySize = arraySize;
metadata->format = DXGI_FORMAT_R16G16B16A16_FLOAT;
metadata->dimension = TEX_DIMENSION_TEXTURE2D;
}
hr = image.Initialize2D(DXGI_FORMAT_R16G16B16A16_FLOAT,
static_cast<size_t>(width), static_cast<size_t>(height), 1u, 1u);
static_cast<size_t>(width), static_cast<size_t>(height), arraySize, 1u);
if (FAILED(hr))
return hr;
@ -387,9 +415,9 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
#ifdef _WIN32
catch (const com_exception& exc)
{
#ifdef _DEBUG
#ifdef _DEBUG
OutputDebugStringA(exc.what());
#endif
#endif
hr = exc.get_result();
}
#endif
@ -450,26 +478,23 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
}
#ifdef _WIN32
char fileName[MAX_PATH] = {};
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName, MAX_PATH, nullptr, nullptr);
if (result <= 0)
std::string fileName;
const int nameLength = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, nullptr, 0, nullptr, nullptr);
if (nameLength > 0)
{
*fileName = 0;
fileName.resize(static_cast<size_t>(nameLength));
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName.data(), nameLength, nullptr, nullptr);
if (result <= 0)
{
fileName.clear();
}
}
// Create file and write header
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(
szFile,
GENERIC_WRITE, 0, CREATE_ALWAYS,
nullptr)));
#else
ScopedHandle hFile(safe_handle(CreateFileW(
szFile,
GENERIC_WRITE, 0,
nullptr,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,
nullptr)));
#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@ -477,7 +502,7 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
auto_delete_file delonfail(hFile.get());
OutputStream stream(hFile.get(), fileName);
OutputStream stream(hFile.get(), fileName.c_str());
#else
std::wstring wFileName(szFile);
std::string fileName(wFileName.cbegin(), wFileName.cend());
@ -487,14 +512,14 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
try
{
const int width = static_cast<int>(image.width);
const int height = static_cast<int>(image.height);
const auto width = static_cast<int>(image.width);
const auto height = static_cast<int>(image.height);
#ifdef _WIN32
#ifdef _WIN32
Imf::RgbaOutputFile file(stream, Imf::Header(width, height), Imf::WRITE_RGBA);
#else
#else
Imf::RgbaOutputFile file(fileName.c_str(), Imf::Header(width, height), Imf::WRITE_RGBA);
#endif
#endif
if (image.format == DXGI_FORMAT_R16G16B16A16_FLOAT)
{
@ -503,9 +528,9 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
}
else
{
const uint64_t bytes = image.width * image.height;
const auto bytes = static_cast<uint64_t>(image.width) * static_cast<uint64_t>(image.height);
if (bytes > UINT32_MAX)
if (bytes > static_cast<uint64_t>(UINT32_MAX))
{
return /* HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW) */ static_cast<HRESULT>(0x80070216L);
}
@ -562,9 +587,9 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
#ifdef _WIN32
catch (const com_exception& exc)
{
#ifdef _DEBUG
#ifdef _DEBUG
OutputDebugStringA(exc.what());
#endif
#endif
hr = exc.get_result();
}
#endif

View File

@ -1,7 +1,7 @@
//--------------------------------------------------------------------------------------
// File: DirectXTexEXR.h
//
// DirectXTex Auxillary functions for using the OpenEXR library
// DirectXTex Auxilary functions for using the OpenEXR library
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
@ -14,13 +14,15 @@
namespace DirectX
{
HRESULT __cdecl GetMetadataFromEXRFile(
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromEXRFile(
_In_z_ const wchar_t* szFile,
_Out_ TexMetadata& metadata);
HRESULT __cdecl LoadFromEXRFile(
DIRECTX_TEX_API HRESULT __cdecl LoadFromEXRFile(
_In_z_ const wchar_t* szFile,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image);
HRESULT __cdecl SaveToEXRFile(_In_ const Image& image, _In_z_ const wchar_t* szFile);
DIRECTX_TEX_API HRESULT __cdecl SaveToEXRFile(
_In_ const Image& image,
_In_z_ const wchar_t* szFile);
}

View File

@ -0,0 +1,425 @@
//--------------------------------------------------------------------------------------
// File: DirectXTexJPEG.cpp
//
// DirectXTex Auxilary functions for using the JPEG(https://www.ijg.org) library
//
// For the Windows platform, the strong recommendation is to make use of the WIC
// functions rather than using the open source library. This module exists to support
// Windows Subsystem on Linux.
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//--------------------------------------------------------------------------------------
#include "DirectXTexP.h"
#include "DirectXTexJPEG.h"
#if __cplusplus < 201703L
#error Requires C++17 (and /Zc:__cplusplus with MSVC)
#endif
#ifndef _BASETSD_H_
#define _BASETSD_H_
#endif
#include <cstdio>
#include <cstdlib>
#include <exception>
#include <filesystem>
#include <stdexcept>
#include <string>
#include <system_error>
#include <vector>
#include <jpeglib.h>
#include <jerror.h>
using namespace DirectX;
using std::filesystem::path;
using ScopedFILE = std::unique_ptr<FILE, int(*)(FILE*)>;
namespace
{
#ifdef _WIN32
ScopedFILE OpenFILE(const path& p) noexcept(false)
{
const std::wstring fpath = p.generic_wstring();
FILE* fp = nullptr;
if (auto ec = _wfopen_s(&fp, fpath.c_str(), L"rb"); ec)
throw std::system_error{ static_cast<int>(_doserrno), std::system_category(), "_wfopen_s" };
return { fp, &fclose };
}
ScopedFILE CreateFILE(const path& p) noexcept(false)
{
const std::wstring fpath = p.generic_wstring();
FILE* fp = nullptr;
if (auto ec = _wfopen_s(&fp, fpath.c_str(), L"w+b"); ec)
throw std::system_error{ static_cast<int>(_doserrno), std::system_category(), "_wfopen_s" };
return { fp, &fclose };
}
#else
ScopedFILE OpenFILE(const path& p) noexcept(false)
{
const std::string fpath = p.generic_string();
FILE* fp = fopen(fpath.c_str(), "rb");
if (!fp)
throw std::system_error{ errno, std::system_category(), "fopen" };
return { fp, &fclose };
}
ScopedFILE CreateFILE(const path& p) noexcept(false)
{
const std::string fpath = p.generic_string();
FILE* fp = fopen(fpath.c_str(), "w+b");
if (!fp)
throw std::system_error{ errno, std::system_category(), "fopen" };
return { fp, &fclose };
}
#endif
[[noreturn]] void OnJPEGError(j_common_ptr ptr)
{
char msg[JMSG_LENGTH_MAX]{};
// "0x89 0x50": PNG
// "0x52 0x49": WEBP
(*ptr->err->format_message)(ptr, msg);
jpeg_destroy(ptr);
throw std::runtime_error{ msg };
}
class JPEGDecompress final
{
jpeg_error_mgr err;
jpeg_decompress_struct dec;
public:
JPEGDecompress() : err{}, dec{}
{
jpeg_std_error(&err);
err.error_exit = &OnJPEGError;
dec.err = &err;
jpeg_create_decompress(&dec);
}
~JPEGDecompress() noexcept
{
jpeg_destroy_decompress(&dec);
}
void UseInput(FILE* fin) noexcept
{
jpeg_stdio_src(&dec, fin);
}
static DXGI_FORMAT TranslateColor(J_COLOR_SPACE colorspace) noexcept
{
switch (colorspace)
{
case JCS_GRAYSCALE: // 1 component
return DXGI_FORMAT_R8_UNORM;
case JCS_RGB: // 3 component, Standard RGB
return DXGI_FORMAT_R8G8B8A8_UNORM;
case JCS_CMYK: // 4 component. WIC retuns this for CMYK
return DXGI_FORMAT_R8G8B8A8_UNORM;
#ifdef LIBJPEG_TURBO_VERSION
case JCS_EXT_RGBX: // 4 component
case JCS_EXT_RGBA:
return DXGI_FORMAT_R8G8B8A8_UNORM;
case JCS_RGB565:
return DXGI_FORMAT_B5G6R5_UNORM;
#endif
case JCS_YCbCr: // 3 component, YCbCr
default:
return DXGI_FORMAT_UNKNOWN;
}
}
void GetMetadata(TexMetadata& metadata) noexcept(false)
{
metadata.width = dec.image_width;
metadata.height = dec.image_height;
metadata.depth = 1;
metadata.arraySize = 1;
metadata.mipLevels = 1;
metadata.dimension = TEX_DIMENSION_TEXTURE2D;
metadata.format = TranslateColor(dec.out_color_space);
if (metadata.format == DXGI_FORMAT_UNKNOWN)
{
throw std::runtime_error{ "unexpected out_color_space in jpeg_decompress_struct" };
}
if (metadata.format == DXGI_FORMAT_R8G8B8A8_UNORM)
{
metadata.miscFlags2 |= TEX_ALPHA_MODE_OPAQUE;
}
}
HRESULT GetHeader(TexMetadata& metadata) noexcept(false)
{
metadata = {};
switch (jpeg_read_header(&dec, false))
{
case JPEG_HEADER_TABLES_ONLY:
[[fallthrough]];
case JPEG_HEADER_OK:
break;
case JPEG_SUSPENDED:
return E_FAIL;
}
GetMetadata(metadata);
return S_OK;
}
#if !defined(LIBJPEG_TURBO_VERSION)
// shift pixels with padding in reverse order (to make it work in-memory)
void ShiftPixels(ScratchImage& image) noexcept
{
size_t num_pixels = dec.output_width * dec.output_height;
uint8_t* dst = image.GetPixels();
const uint8_t* src = dst;
for (size_t i = num_pixels - 1; i > 0; i -= 1)
{
dst[4*i + 0] = src[3*i + 0];
dst[4*i + 1] = src[3*i + 1];
dst[4*i + 2] = src[3*i + 2];
dst[4*i + 3] = 0;
}
}
#endif
HRESULT GetImage(TexMetadata& metadata, ScratchImage& image) noexcept(false)
{
metadata = {};
switch (jpeg_read_header(&dec, true))
{
case JPEG_HEADER_TABLES_ONLY:
GetMetadata(metadata);
[[fallthrough]];
case JPEG_SUSPENDED:
return E_FAIL;
case JPEG_HEADER_OK:
break;
}
GetMetadata(metadata);
// if the JPEG library doesn't have color space conversion, it should be ERROR_NOT_SUPPORTED
if (dec.jpeg_color_space == JCS_YCCK)
{
// CMYK is the known case
if (dec.out_color_space == JCS_CMYK)
return HRESULT_E_NOT_SUPPORTED;
}
if (auto hr = image.Initialize2D(metadata.format, metadata.width, metadata.height, metadata.arraySize, metadata.mipLevels); FAILED(hr))
return hr;
#ifdef LIBJPEG_TURBO_VERSION
// grayscale is the only color space which uses 1 component
if (dec.out_color_space != JCS_GRAYSCALE)
// if there is no proper conversion to 4 component, E_FAIL...
dec.out_color_space = JCS_EXT_RGBX;
#endif
if (jpeg_start_decompress(&dec) == false)
return E_FAIL;
uint8_t* dest = image.GetPixels();
const size_t stride = dec.output_width * static_cast<size_t>(dec.output_components);
std::vector<JSAMPROW> rows(dec.output_height);
for (size_t i = 0u; i < dec.output_height; ++i)
rows[i] = dest + (stride * i);
JDIMENSION leftover = dec.output_height;
while (leftover > 0)
{
JDIMENSION consumed = jpeg_read_scanlines(&dec, &rows[dec.output_scanline], leftover);
leftover -= consumed;
}
if (jpeg_finish_decompress(&dec) == false)
return E_FAIL;
#if !defined(LIBJPEG_TURBO_VERSION)
// if NOT TurboJPEG, we need to make 3 component images to 4 component image
if (dec.out_color_space != JCS_GRAYSCALE)
ShiftPixels(image);
#endif
return S_OK;
}
HRESULT GetImage(ScratchImage& image) noexcept(false)
{
TexMetadata metadata{};
return GetImage(metadata, image);
}
};
class JPEGCompress final
{
jpeg_error_mgr err{};
jpeg_compress_struct enc{};
public:
JPEGCompress() : err{}, enc{}
{
jpeg_std_error(&err);
err.error_exit = &OnJPEGError;
enc.err = &err;
jpeg_create_compress(&enc);
}
~JPEGCompress() noexcept
{
jpeg_destroy_compress(&enc);
}
void UseOutput(FILE* fout)
{
jpeg_stdio_dest(&enc, fout);
}
/// @todo More correct DXGI_FORMAT mapping
HRESULT WriteImage(const Image& image) noexcept(false)
{
switch (image.format)
{
case DXGI_FORMAT_R8_UNORM:
enc.input_components = 1;
enc.in_color_space = JCS_GRAYSCALE;
break;
#ifdef LIBJPEG_TURBO_VERSION
case DXGI_FORMAT_R8G8B8A8_UNORM:
enc.input_components = 4;
enc.in_color_space = JCS_EXT_RGBA;
break;
case DXGI_FORMAT_B8G8R8A8_UNORM:
enc.input_components = 4;
enc.in_color_space = JCS_EXT_BGRA;
break;
#else
case DXGI_FORMAT_R8G8B8A8_UNORM:
enc.input_components = 3;
enc.in_color_space = JCS_RGB;
#endif
default:
return HRESULT_E_NOT_SUPPORTED;
}
enc.image_width = static_cast<JDIMENSION>(image.width);
enc.image_height = static_cast<JDIMENSION>(image.height);
jpeg_set_defaults(&enc);
jpeg_set_quality(&enc, 100, true);
// we will write a row each time ...
jpeg_start_compress(&enc, true);
const size_t stride = enc.image_width * static_cast<size_t>(enc.input_components);
while (enc.next_scanline < enc.image_height)
{
JSAMPROW rows[1]{ image.pixels + stride * enc.next_scanline };
jpeg_write_scanlines(&enc, rows, 1);
}
jpeg_finish_compress(&enc);
return S_OK;
}
};
}
_Use_decl_annotations_
HRESULT DirectX::GetMetadataFromJPEGFile(
const wchar_t* file,
TexMetadata& metadata)
{
if (!file)
return E_INVALIDARG;
try
{
auto fin = OpenFILE(file);
JPEGDecompress decoder{};
decoder.UseInput(fin.get());
return decoder.GetHeader(metadata);
}
catch (const std::bad_alloc&)
{
return E_OUTOFMEMORY;
}
catch (const std::system_error& ec)
{
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
}
catch (const std::exception&)
{
return E_FAIL;
}
}
_Use_decl_annotations_
HRESULT DirectX::LoadFromJPEGFile(
const wchar_t* file,
TexMetadata* metadata,
ScratchImage&image)
{
if (!file)
return E_INVALIDARG;
image.Release();
try
{
auto fin = OpenFILE(file);
JPEGDecompress decoder{};
decoder.UseInput(fin.get());
if (!metadata)
return decoder.GetImage(image);
return decoder.GetImage(*metadata, image);
}
catch (const std::bad_alloc&)
{
image.Release();
return E_OUTOFMEMORY;
}
catch (const std::system_error& ec)
{
image.Release();
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
}
catch (const std::exception&)
{
image.Release();
return E_FAIL;
}
}
_Use_decl_annotations_
HRESULT DirectX::SaveToJPEGFile(
const Image& image,
const wchar_t* file)
{
if (!file)
return E_INVALIDARG;
try
{
auto fout = CreateFILE(file);
JPEGCompress encoder{};
encoder.UseOutput(fout.get());
return encoder.WriteImage(image);
}
catch (const std::bad_alloc&)
{
return E_OUTOFMEMORY;
}
catch (const std::system_error& ec)
{
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
}
catch (const std::exception&)
{
return E_FAIL;
}
}

View File

@ -0,0 +1,33 @@
//--------------------------------------------------------------------------------------
// File: DirectXTexJPEG.h
//
// DirectXTex Auxilary functions for using the JPEG(https://www.ijg.org) library
//
// For the Windows platform, the strong recommendation is to make use of the WIC
// functions rather than using the open source library. This module exists to support
// Windows Subsystem on Linux.
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//--------------------------------------------------------------------------------------
#pragma once
#include "DirectXTex.h"
namespace DirectX
{
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromJPEGFile(
_In_z_ const wchar_t* szFile,
_Out_ TexMetadata& metadata);
DIRECTX_TEX_API HRESULT __cdecl LoadFromJPEGFile(
_In_z_ const wchar_t* szFile,
_Out_opt_ TexMetadata* metadata,
_Out_ ScratchImage& image);
DIRECTX_TEX_API HRESULT __cdecl SaveToJPEGFile(
_In_ const Image& image,
_In_z_ const wchar_t* szFile);
}

430
Auxiliary/DirectXTexPNG.cpp Normal file
View File

@ -0,0 +1,430 @@
//--------------------------------------------------------------------------------------
// File: DirectXTexPNG.cpp
//
// DirectXTex Auxilary functions for using the PNG(http://www.libpng.org/pub/png/libpng.html) library
//
// For the Windows platform, the strong recommendation is to make use of the WIC
// functions rather than using the open source library. This module exists to support
// Windows Subsystem on Linux.
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//--------------------------------------------------------------------------------------
#include "DirectXTexP.h"
#include "DirectXTexPNG.h"
#if __cplusplus < 201703L
#error Requires C++17 (and /Zc:__cplusplus with MSVC)
#endif
#include <cstdio>
#include <cstdlib>
#include <exception>
#include <filesystem>
#include <stdexcept>
#include <string>
#include <system_error>
#include <vector>
#include <png.h>
using namespace DirectX;
using std::filesystem::path;
using ScopedFILE = std::unique_ptr<FILE, int(*)(FILE*)>;
namespace
{
#ifdef _WIN32
ScopedFILE OpenFILE(const path& p) noexcept(false)
{
const std::wstring fpath = p.generic_wstring();
FILE* fp = nullptr;
if (auto ec = _wfopen_s(&fp, fpath.c_str(), L"rb"); ec)
throw std::system_error{ static_cast<int>(_doserrno), std::system_category(), "_wfopen_s" };
return { fp, &fclose };
}
ScopedFILE CreateFILE(const path& p) noexcept(false)
{
const std::wstring fpath = p.generic_wstring();
FILE* fp = nullptr;
if (auto ec = _wfopen_s(&fp, fpath.c_str(), L"w+b"); ec)
throw std::system_error{ static_cast<int>(_doserrno), std::system_category(), "_wfopen_s" };
return { fp, &fclose };
}
#else
ScopedFILE OpenFILE(const path& p) noexcept(false)
{
const std::string fpath = p.generic_string();
FILE* fp = fopen(fpath.c_str(), "rb");
if (!fp)
throw std::system_error{ errno, std::system_category(), "fopen" };
return { fp, &fclose };
}
ScopedFILE CreateFILE(const path& p) noexcept(false)
{
const std::string fpath = p.generic_string();
FILE* fp = fopen(fpath.c_str(), "w+b");
if (!fp)
throw std::system_error{ errno, std::system_category(), "fopen" };
return { fp, &fclose };
}
#endif
[[noreturn]] void OnPNGError(png_structp, png_const_charp msg)
{
throw std::runtime_error{ msg };
}
void OnPNGWarning(png_structp, png_const_charp)
{
// drain warning messages ...
}
/// @note If the PNG contains some extra chunks like EXIF, this will be used
void OnPNGRead(png_structp st, png_bytep ptr, size_t len)
{
FILE* fin = reinterpret_cast<FILE*>(png_get_io_ptr(st));
std::ignore = fread(ptr, len, 1, fin);
}
/// @see http://www.libpng.org/pub/png/libpng.html
/// @see http://www.libpng.org/pub/png/libpng-manual.txt
class PNGDecompress final
{
png_structp st;
png_infop info;
public:
PNGDecompress() noexcept(false) : st{ nullptr }, info{ nullptr }
{
st = png_create_read_struct(PNG_LIBPNG_VER_STRING, this, &OnPNGError, &OnPNGWarning);
if (!st)
throw std::runtime_error{ "png_create_read_struct" };
info = png_create_info_struct(st);
if (!info)
{
png_destroy_read_struct(&st, nullptr, nullptr);
throw std::runtime_error{ "png_create_info_struct" };
}
}
~PNGDecompress() noexcept
{
png_destroy_read_struct(&st, &info, nullptr);
}
void UseInput(FILE* fin) noexcept
{
// we assume the signature is unread. if so, we have to use `png_set_sig_bytes`
png_init_io(st, fin);
png_set_read_fn(st, fin, &OnPNGRead);
}
void Update() noexcept(false)
{
png_read_info(st, info);
// check for unsupported cases
png_byte interlacing = png_get_interlace_type(st, info);
if (interlacing != PNG_INTERLACE_NONE)
{
throw std::invalid_argument{ "interlacing not supported" };
}
// color handling
png_byte color_type = png_get_color_type(st, info);
if (color_type == PNG_COLOR_TYPE_GRAY)
{
// bit_depth will be 8 or 16
if (png_get_bit_depth(st, info) < 8)
png_set_expand_gray_1_2_4_to_8(st);
}
else if (color_type == PNG_COLOR_TYPE_PALETTE)
{
// request RGB color
png_set_palette_to_rgb(st);
if (png_get_valid(st, info, PNG_INFO_tRNS))
png_set_tRNS_to_alpha(st);
}
// Here we don't know if the pixel data is in BGR/RGB order
// png_set_bgr(st);
png_set_alpha_mode(st, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB);
// make 4 component
// using `png_set_add_alpha` here may confuse `TEX_ALPHA_MODE_OPAQUE` estimation
if (png_get_channels(st, info) == 3)
png_set_filler(st, 0, PNG_FILLER_AFTER);
// prefer DXGI_FORMAT_R8G8B8A8_UNORM. strip in decode
//if (png_get_bit_depth(st, info) > 8)
// png_set_strip_16(st);
png_read_update_info(st, info);
}
/// @note must call `Update` before this
/// @todo Proper detection of DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB
DXGI_FORMAT GuessFormat() const noexcept(false)
{
// 1 or 4. 1 is for gray
auto c = png_get_channels(st, info);
if (c == 1)
{
if (png_get_bit_depth(st, info) == 16)
return DXGI_FORMAT_R16_UNORM;
// with `png_set_expand_gray_1_2_4_to_8`, libpng will change to R8_UNORM
return DXGI_FORMAT_R8_UNORM;
}
// 8 or 16. expanded if 1, 2, 4
auto d = png_get_bit_depth(st, info);
if (d == 16)
return DXGI_FORMAT_R16G16B16A16_UNORM;
if (d != 8)
throw std::runtime_error{ "unexpected info from libpng" };
int intent = 0;
if (png_get_sRGB(st, info, &intent) == PNG_INFO_sRGB)
return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
return DXGI_FORMAT_R8G8B8A8_UNORM;
}
/// @todo More correct DXGI_FORMAT mapping
void GetHeader(TexMetadata& metadata) noexcept(false)
{
metadata = {};
metadata.width = png_get_image_width(st, info);
metadata.height = png_get_image_height(st, info);
metadata.arraySize = 1;
metadata.mipLevels = 1;
metadata.depth = 1;
metadata.dimension = TEX_DIMENSION_TEXTURE2D;
metadata.format = GuessFormat();
png_byte color_type = png_get_color_type(st, info);
bool have_alpha = (color_type & PNG_COLOR_MASK_ALPHA);
if (have_alpha == false && (metadata.format != DXGI_FORMAT_R8_UNORM))
metadata.miscFlags2 |= TEX_ALPHA_MODE_OPAQUE;
}
/// @todo More correct DXGI_FORMAT mapping
HRESULT GetImage(TexMetadata& metadata, ScratchImage& image) noexcept(false)
{
metadata = {};
GetHeader(metadata);
if (auto hr = image.Initialize2D(metadata.format, metadata.width, metadata.height, metadata.arraySize, metadata.mipLevels); FAILED(hr))
return hr;
auto* dest = image.GetPixels();
const auto stride = metadata.width * png_get_channels(st, info);
std::vector<png_byte*> rows(metadata.height);
for (auto i = 0u; i < metadata.height; ++i)
rows[i] = dest + (stride * i);
png_read_rows(st, rows.data(), nullptr, static_cast<uint32_t>(rows.size()));
png_read_end(st, info);
return S_OK;
}
HRESULT GetImage(ScratchImage& image) noexcept(false)
{
TexMetadata metadata{};
return GetImage(metadata, image);
}
};
/// @see http://www.libpng.org/pub/png/libpng.html
/// @see http://www.libpng.org/pub/png/libpng-manual.txt
class PNGCompress final
{
png_structp st;
png_infop info;
public:
PNGCompress() noexcept(false) : st{ nullptr }, info{ nullptr }
{
st = png_create_write_struct(PNG_LIBPNG_VER_STRING, this, &OnPNGError, &OnPNGWarning);
if (!st)
throw std::runtime_error{ "png_create_write_struct" };
info = png_create_info_struct(st);
if (!info)
{
png_destroy_write_struct(&st, nullptr);
throw std::runtime_error{ "png_create_info_struct" };
}
png_set_compression_level(st, 0);
}
~PNGCompress() noexcept
{
png_destroy_write_struct(&st, &info);
}
void UseOutput(FILE* fout) noexcept
{
png_init_io(st, fout);
}
HRESULT WriteImage(const Image& image) noexcept(false)
{
int color_type = PNG_COLOR_TYPE_RGB;
bool using_bgr = false;
int channel = 4;
int bit_depth = 8;
switch (image.format)
{
case DXGI_FORMAT_R8_UNORM:
color_type = PNG_COLOR_TYPE_GRAY;
channel = 1;
break;
case DXGI_FORMAT_B8G8R8A8_UNORM:
case DXGI_FORMAT_B8G8R8X8_UNORM:
using_bgr = true;
[[fallthrough]];
case DXGI_FORMAT_R8G8B8A8_UNORM:
color_type = PNG_COLOR_TYPE_RGBA;
break;
default:
return HRESULT_E_NOT_SUPPORTED;
}
png_set_IHDR(st, info,
static_cast<uint32_t>(image.width),
static_cast<uint32_t>(image.height),
bit_depth,
color_type,
PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT,
PNG_FILTER_TYPE_DEFAULT);
png_write_info(st, info);
if (using_bgr)
png_set_bgr(st);
const size_t stride = static_cast<size_t>(channel) * image.width;
std::vector<png_bytep> rows(image.height);
for (size_t i = 0u; i< image.height; ++i)
rows[i] = image.pixels + stride * i;
png_write_rows(st, rows.data(), static_cast<uint32_t>(rows.size()));
// actual write will be done here
png_write_end(st, info);
return S_OK;
}
};
}
_Use_decl_annotations_
HRESULT DirectX::GetMetadataFromPNGFile(
const wchar_t* file,
TexMetadata& metadata)
{
if (!file)
return E_INVALIDARG;
try
{
auto fin = OpenFILE(file);
PNGDecompress decoder{};
decoder.UseInput(fin.get());
decoder.Update();
decoder.GetHeader(metadata);
return S_OK;
}
catch (const std::bad_alloc&)
{
return E_OUTOFMEMORY;
}
catch (const std::system_error& ec)
{
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
}
catch (const std::invalid_argument&)
{
return HRESULT_E_NOT_SUPPORTED;
}
catch (const std::exception&)
{
return E_FAIL;
}
}
_Use_decl_annotations_
HRESULT DirectX::LoadFromPNGFile(
const wchar_t* file,
TexMetadata* metadata,
ScratchImage& image)
{
if (!file)
return E_INVALIDARG;
image.Release();
try
{
auto fin = OpenFILE(file);
PNGDecompress decoder{};
decoder.UseInput(fin.get());
decoder.Update();
if (metadata == nullptr)
return decoder.GetImage(image);
return decoder.GetImage(*metadata, image);
}
catch (const std::bad_alloc&)
{
image.Release();
return E_OUTOFMEMORY;
}
catch (const std::system_error& ec)
{
image.Release();
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
}
catch (const std::invalid_argument&)
{
return HRESULT_E_NOT_SUPPORTED;
}
catch (const std::exception&)
{
image.Release();
return E_FAIL;
}
}
_Use_decl_annotations_
HRESULT DirectX::SaveToPNGFile(
const Image& image,
const wchar_t* file)
{
if (!file)
return E_INVALIDARG;
try
{
auto fout = CreateFILE(file);
PNGCompress encoder{};
encoder.UseOutput(fout.get());
return encoder.WriteImage(image);
}
catch (const std::bad_alloc&)
{
return E_OUTOFMEMORY;
}
catch (const std::system_error& ec)
{
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
}
catch (const std::exception&)
{
return E_FAIL;
}
}

33
Auxiliary/DirectXTexPNG.h Normal file
View File

@ -0,0 +1,33 @@
//--------------------------------------------------------------------------------------
// File: DirectXTexPNG.h
//
// DirectXTex Auxilary functions for using the PNG(http://www.libpng.org/pub/png/libpng.html) library
//
// For the Windows platform, the strong recommendation is to make use of the WIC
// functions rather than using the open source library. This module exists to support
// Windows Subsystem on Linux.
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//--------------------------------------------------------------------------------------
#pragma once
#include "DirectXTex.h"
namespace DirectX
{
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromPNGFile(
_In_z_ const wchar_t* szFile,
_Out_ TexMetadata& metadata);
DIRECTX_TEX_API HRESULT __cdecl LoadFromPNGFile(
_In_z_ const wchar_t* szFile,
_Out_opt_ TexMetadata* metadata,
_Out_ ScratchImage& image);
DIRECTX_TEX_API HRESULT __cdecl SaveToPNGFile(
_In_ const Image& image,
_In_z_ const wchar_t* szFile);
}

227
Auxiliary/DirectXTexXbox.h Normal file
View File

@ -0,0 +1,227 @@
//--------------------------------------------------------------------------------------
// File: DirectXTexXbox.h
//
// DirectXTex Auxilary functions for Xbox texture processing
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//--------------------------------------------------------------------------------------
#pragma once
#ifndef _M_X64
#error This tool is only supported for x64 native
#endif
#include "DirectXTex.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnonportable-system-include-path"
#pragma clang diagnostic ignored "-Wold-style-cast"
#endif
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
#include <xg_xs.h>
#else
#include <xg.h>
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef _GAMING_XBOX_SCARLETT
#include <d3d12_xs.h>
#elif defined(_GAMING_XBOX)
#include <d3d12_x.h>
#elif defined(_XBOX_ONE) && defined(_TITLE)
#include <d3d11_x.h>
#else
#include <d3d11_1.h>
#endif
#include <cstdint>
#include <utility>
#define DIRECTX_TEX_XBOX_VERSION 150
namespace Xbox
{
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
using XboxTileMode = XG_SWIZZLE_MODE;
constexpr XboxTileMode c_XboxTileModeInvalid = XG_SWIZZLE_MODE_INVALID;
constexpr XboxTileMode c_XboxTileModeLinear = XG_SWIZZLE_MODE_LINEAR;
#else
using XboxTileMode = XG_TILE_MODE;
constexpr XboxTileMode c_XboxTileModeInvalid = XG_TILE_MODE_INVALID;
constexpr XboxTileMode c_XboxTileModeLinear = XG_TILE_MODE_LINEAR;
#endif
class DIRECTX_TEX_API XboxImage
{
public:
XboxImage() noexcept
: dataSize(0), baseAlignment(0), tilemode(c_XboxTileModeInvalid), metadata{}, memory(nullptr)
{}
XboxImage(XboxImage&& moveFrom) noexcept
: dataSize(0), baseAlignment(0), tilemode(c_XboxTileModeInvalid), metadata{}, memory(nullptr)
{
*this = std::move(moveFrom);
}
~XboxImage() { Release(); }
XboxImage& __cdecl operator= (XboxImage&& moveFrom) noexcept;
XboxImage(const XboxImage&) = delete;
XboxImage& operator=(const XboxImage&) = delete;
HRESULT __cdecl Initialize(_In_ const XG_TEXTURE1D_DESC& desc, _In_ const XG_RESOURCE_LAYOUT& layout, _In_ uint32_t miscFlags2 = 0);
HRESULT __cdecl Initialize(_In_ const XG_TEXTURE2D_DESC& desc, _In_ const XG_RESOURCE_LAYOUT& layout, _In_ uint32_t miscFlags2 = 0);
HRESULT __cdecl Initialize(_In_ const XG_TEXTURE3D_DESC& desc, _In_ const XG_RESOURCE_LAYOUT& layout, _In_ uint32_t miscFlags2 = 0);
HRESULT __cdecl Initialize(_In_ const DirectX::TexMetadata& mdata, _In_ XboxTileMode tm, _In_ uint32_t size, _In_ uint32_t alignment);
void __cdecl Release();
const DirectX::TexMetadata& GetMetadata() const { return metadata; }
XboxTileMode GetTileMode() const { return tilemode; }
uint32_t GetSize() const { return dataSize; }
uint32_t GetAlignment() const { return baseAlignment; }
uint8_t* GetPointer() const { return memory; }
private:
uint32_t dataSize;
uint32_t baseAlignment;
XboxTileMode tilemode;
DirectX::TexMetadata metadata;
uint8_t* memory;
};
//---------------------------------------------------------------------------------
// Image I/O
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_Out_ DirectX::TexMetadata& metadata, _Out_ bool& isXbox);
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSFile(
_In_z_ const wchar_t* szFile, _Out_ DirectX::TexMetadata& metadata, _Out_ bool& isXbox);
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSMemoryEx(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_Out_ DirectX::TexMetadata& metadata, _Out_ bool& isXbox,
_Out_opt_ DirectX::DDSMetaData* ddPixelFormat);
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSFileEx(
_In_z_ const wchar_t* szFile, _Out_ DirectX::TexMetadata& metadata, _Out_ bool& isXbox,
_Out_opt_ DirectX::DDSMetaData* ddPixelFormat);
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_Out_opt_ DirectX::TexMetadata* metadata, _Out_ XboxImage& image);
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSFile(
_In_z_ const wchar_t* szFile,
_Out_opt_ DirectX::TexMetadata* metadata, _Out_ XboxImage& image);
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSMemoryEx(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_Out_opt_ DirectX::TexMetadata* metadata,
_Out_opt_ DirectX::DDSMetaData* ddPixelFormat,
_Out_ XboxImage& image);
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSFileEx(
_In_z_ const wchar_t* szFile,
_Out_opt_ DirectX::TexMetadata* metadata,
_Out_opt_ DirectX::DDSMetaData* ddPixelFormat,
_Out_ XboxImage& image);
DIRECTX_TEX_API HRESULT __cdecl SaveToDDSMemory(_In_ const XboxImage& xbox, _Out_ DirectX::Blob& blob);
DIRECTX_TEX_API HRESULT __cdecl SaveToDDSFile(_In_ const XboxImage& xbox, _In_z_ const wchar_t* szFile);
#ifdef __cpp_lib_byte
inline HRESULT __cdecl GetMetadataFromDDSMemory(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_Out_ DirectX::TexMetadata& metadata, _Out_ bool& isXbox)
{
return GetMetadataFromDDSMemory(reinterpret_cast<const uint8_t*>(pSource), size, metadata, isXbox);
}
inline HRESULT __cdecl GetMetadataFromDDSMemoryEx(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_Out_ DirectX::TexMetadata& metadata, _Out_ bool& isXbox,
_Out_opt_ DirectX::DDSMetaData* ddPixelFormat)
{
return GetMetadataFromDDSMemoryEx(reinterpret_cast<const uint8_t*>(pSource), size, metadata, isXbox, ddPixelFormat);
}
inline HRESULT __cdecl LoadFromDDSMemory(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_Out_opt_ DirectX::TexMetadata* metadata, _Out_ XboxImage& image)
{
return LoadFromDDSMemory(reinterpret_cast<const uint8_t*>(pSource), size, metadata, image);
}
inline HRESULT __cdecl LoadFromDDSMemoryEx(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_Out_opt_ DirectX::TexMetadata* metadata,
_Out_opt_ DirectX::DDSMetaData* ddPixelFormat,
_Out_ XboxImage& image)
{
return LoadFromDDSMemoryEx(reinterpret_cast<const uint8_t*>(pSource), size, metadata, ddPixelFormat, image);
}
#endif // __cpp_lib_byte
//---------------------------------------------------------------------------------
// Xbox Texture Tiling / Detiling (requires XG DLL to be present at runtime)
DIRECTX_TEX_API HRESULT __cdecl Tile(_In_ const DirectX::Image& srcImage, _Out_ XboxImage& xbox, _In_ XboxTileMode mode = c_XboxTileModeInvalid);
DIRECTX_TEX_API HRESULT __cdecl Tile(
_In_ const DirectX::Image* srcImages, _In_ size_t nimages, _In_ const DirectX::TexMetadata& metadata,
_Out_ XboxImage& xbox, _In_ XboxTileMode mode = c_XboxTileModeInvalid);
DIRECTX_TEX_API HRESULT __cdecl Detile(_In_ const XboxImage& xbox, _Out_ DirectX::ScratchImage& image);
//---------------------------------------------------------------------------------
// Direct3D 11.X functions
#if defined(_XBOX_ONE) && defined(_TITLE) && defined(__d3d11_x_h__)
DIRECTX_TEX_API HRESULT __cdecl CreateTexture(
_In_ ID3D11DeviceX* d3dDevice,
_In_ const XboxImage& xbox, _Outptr_opt_ ID3D11Resource** ppResource, _Outptr_ void** grfxMemory);
DIRECTX_TEX_API HRESULT __cdecl CreateShaderResourceView(
_In_ ID3D11DeviceX* d3dDevice,
_In_ const XboxImage& xbox, _Outptr_opt_ ID3D11ShaderResourceView** ppSRV, _Outptr_ void** grfxMemory);
DIRECTX_TEX_API void __cdecl FreeTextureMemory(_In_ ID3D11DeviceX* d3dDevice, _In_opt_ void* grfxMemory);
#endif
//---------------------------------------------------------------------------------
// Direct3D 12.X functions
#if ((defined(_XBOX_ONE) && defined(_TITLE)) || defined(_GAMING_XBOX)) && (defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__))
DIRECTX_TEX_API HRESULT __cdecl CreateTexture(
_In_ ID3D12Device* d3dDevice,
_In_ const XboxImage& xbox, _Outptr_opt_ ID3D12Resource** ppResource, _Outptr_ void** grfxMemory);
DIRECTX_TEX_API void __cdecl FreeTextureMemory(_In_ ID3D12Device* d3dDevice, _In_opt_ void* grfxMemory);
#endif
//---------------------------------------------------------------------------------
// DDS helper functions
DIRECTX_TEX_API HRESULT __cdecl EncodeDDSHeader(
const XboxImage& xbox,
_Out_writes_bytes_(maxsize) uint8_t* pDestination, _In_ size_t maxsize) noexcept;
#ifdef __cpp_lib_byte
inline HRESULT __cdecl EncodeDDSHeader(
const XboxImage& xbox,
_Out_writes_bytes_(maxsize) std::byte* pDestination, _In_ size_t maxsize) noexcept
{
return EncodeDDSHeader(xbox, reinterpret_cast<uint8_t*>(pDestination), maxsize);
}
#endif
} // namespace

View File

@ -0,0 +1,258 @@
//-------------------------------------------------------------------------------------
// DirectXTexD3D11X.cpp
//
// DirectXTex Auxilary functions for creating resouces from XboxImage containers
// via the CreatePlacement APIs
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//-------------------------------------------------------------------------------------
#include "DirectXTexP.h"
#include "DirectXTexXbox.h"
#ifdef _GAMING_XBOX
#error This module is not supported for GDK
#elif !defined(_XBOX_ONE) || !defined(_TITLE)
#error This module only supports Xbox One exclusive apps
#endif
using namespace Xbox;
using Microsoft::WRL::ComPtr;
namespace
{
//--------------------------------------------------------------------------------------
// Default XMemAlloc attributes for texture loading
//--------------------------------------------------------------------------------------
const uint64_t c_XMemAllocAttributes = MAKE_XALLOC_ATTRIBUTES(
eXALLOCAllocatorId_MiddlewareReservedMin,
0,
XALLOC_MEMTYPE_GRAPHICS_WRITECOMBINE_GPU_READONLY,
XALLOC_PAGESIZE_64KB,
XALLOC_ALIGNMENT_64K);
}
//=====================================================================================
// Entry-points
//=====================================================================================
//-------------------------------------------------------------------------------------
// Create a texture resource
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::CreateTexture(
ID3D11DeviceX* d3dDevice,
const XboxImage& xbox,
ID3D11Resource** ppResource,
void** grfxMemory)
{
if (!d3dDevice || !ppResource || !grfxMemory)
return E_INVALIDARG;
*grfxMemory = nullptr;
*ppResource = nullptr;
if (!xbox.GetPointer() || !xbox.GetAlignment() || !xbox.GetSize() || xbox.GetTileMode() == c_XboxTileModeInvalid)
return E_INVALIDARG;
// Allocate graphics memory
*grfxMemory = XMemAlloc(xbox.GetSize(), c_XMemAllocAttributes);
if (!*grfxMemory)
return E_OUTOFMEMORY;
// Copy tiled data into graphics memory
memcpy(*grfxMemory, xbox.GetPointer(), xbox.GetSize());
// Create texture resource
auto& metadata = xbox.GetMetadata();
HRESULT hr = E_FAIL;
switch (metadata.dimension)
{
case DirectX::TEX_DIMENSION_TEXTURE1D:
{
D3D11_TEXTURE1D_DESC desc = {};
desc.Width = static_cast<UINT>(metadata.width);
desc.MipLevels = static_cast<UINT>(metadata.mipLevels);
desc.ArraySize = static_cast<UINT>(metadata.arraySize);
desc.Format = metadata.format;
desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
ID3D11Texture1D* tex = nullptr;
hr = d3dDevice->CreatePlacementTexture1D(&desc, xbox.GetTileMode(), 0, *grfxMemory, &tex);
if (SUCCEEDED(hr) && tex)
{
*ppResource = tex;
}
}
break;
case DirectX::TEX_DIMENSION_TEXTURE2D:
{
D3D11_TEXTURE2D_DESC desc = {};
desc.Width = static_cast<UINT>(metadata.width);
desc.Height = static_cast<UINT>(metadata.height);
desc.MipLevels = static_cast<UINT>(metadata.mipLevels);
desc.ArraySize = static_cast<UINT>(metadata.arraySize);
desc.Format = metadata.format;
desc.SampleDesc.Count = 1;
desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
desc.MiscFlags = (metadata.miscFlags & DirectX::TEX_MISC_TEXTURECUBE) ? D3D11_RESOURCE_MISC_TEXTURECUBE : 0;
ID3D11Texture2D* tex = nullptr;
hr = d3dDevice->CreatePlacementTexture2D(&desc, xbox.GetTileMode(), 0, *grfxMemory, &tex);
if (SUCCEEDED(hr) && tex)
{
*ppResource = tex;
}
}
break;
case DirectX::TEX_DIMENSION_TEXTURE3D:
{
D3D11_TEXTURE3D_DESC desc = {};
desc.Width = static_cast<UINT>(metadata.width);
desc.Height = static_cast<UINT>(metadata.height);
desc.Depth = static_cast<UINT>(metadata.depth);
desc.MipLevels = static_cast<UINT>(metadata.mipLevels);
desc.Format = metadata.format;
desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
ID3D11Texture3D* tex = nullptr;
hr = d3dDevice->CreatePlacementTexture3D(&desc, xbox.GetTileMode(), 0, *grfxMemory, &tex);
if (SUCCEEDED(hr) && tex)
{
*ppResource = tex;
}
}
break;
default:
hr = E_FAIL;
break;
}
if (FAILED(hr))
{
XMemFree(grfxMemory, c_XMemAllocAttributes);
*grfxMemory = nullptr;
}
return hr;
}
//-------------------------------------------------------------------------------------
// Create a shader resource view and associated texture
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::CreateShaderResourceView(
ID3D11DeviceX* d3dDevice,
const XboxImage& xbox,
ID3D11ShaderResourceView** ppSRV,
void** grfxMemory)
{
if (!ppSRV)
return E_INVALIDARG;
*ppSRV = nullptr;
ComPtr<ID3D11Resource> resource;
HRESULT hr = CreateTexture(d3dDevice, xbox, resource.GetAddressOf(), grfxMemory);
if (FAILED(hr))
return hr;
assert(resource);
auto& metadata = xbox.GetMetadata();
D3D11_SHADER_RESOURCE_VIEW_DESC SRVDesc = {};
SRVDesc.Format = metadata.format;
switch (metadata.dimension)
{
case DirectX::TEX_DIMENSION_TEXTURE1D:
if (metadata.arraySize > 1)
{
SRVDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE1DARRAY;
SRVDesc.Texture1DArray.MipLevels = static_cast<UINT>(metadata.mipLevels);
SRVDesc.Texture1DArray.ArraySize = static_cast<UINT>(metadata.arraySize);
}
else
{
SRVDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE1D;
SRVDesc.Texture1D.MipLevels = static_cast<UINT>(metadata.mipLevels);
}
break;
case DirectX::TEX_DIMENSION_TEXTURE2D:
if (metadata.IsCubemap())
{
if (metadata.arraySize > 6)
{
assert((metadata.arraySize % 6) == 0);
SRVDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBEARRAY;
SRVDesc.TextureCubeArray.MipLevels = static_cast<UINT>(metadata.mipLevels);
SRVDesc.TextureCubeArray.NumCubes = static_cast<UINT>(metadata.arraySize / 6);
}
else
{
SRVDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
SRVDesc.TextureCube.MipLevels = static_cast<UINT>(metadata.mipLevels);
}
}
else if (metadata.arraySize > 1)
{
SRVDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DARRAY;
SRVDesc.Texture2DArray.MipLevels = static_cast<UINT>(metadata.mipLevels);
SRVDesc.Texture2DArray.ArraySize = static_cast<UINT>(metadata.arraySize);
}
else
{
SRVDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
SRVDesc.Texture2D.MipLevels = static_cast<UINT>(metadata.mipLevels);
}
break;
case DirectX::TEX_DIMENSION_TEXTURE3D:
assert(metadata.arraySize == 1);
SRVDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D;
SRVDesc.Texture3D.MipLevels = static_cast<UINT>(metadata.mipLevels);
break;
default:
assert(grfxMemory != nullptr);
XMemFree(grfxMemory, c_XMemAllocAttributes);
*grfxMemory = nullptr;
return E_FAIL;
}
hr = d3dDevice->CreateShaderResourceView(resource.Get(), &SRVDesc, ppSRV);
if (FAILED(hr))
{
XMemFree(grfxMemory, c_XMemAllocAttributes);
*grfxMemory = nullptr;
}
return hr;
}
//-------------------------------------------------------------------------------------
// Free allocated graphics memory
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
void Xbox::FreeTextureMemory(ID3D11DeviceX* d3dDevice, void* grfxMemory)
{
UNREFERENCED_PARAMETER(d3dDevice); // used only for overload resolution
if (grfxMemory)
{
XMemFree(grfxMemory, c_XMemAllocAttributes);
}
}

View File

@ -0,0 +1,117 @@
//-------------------------------------------------------------------------------------
// DirectXTexD3D12X.cpp
//
// DirectXTex Auxilary functions for creating resouces from XboxImage containers
// via the CreatePlacedResourceX API
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//-------------------------------------------------------------------------------------
#include "DirectXTexP.h"
#include "DirectXTexXbox.h"
#if !(defined(_XBOX_ONE) && defined(_TITLE)) && !defined(_GAMING_XBOX)
#error This module only supports Xbox exclusive apps
#endif
#ifdef _GAMING_XBOX
#include <xmem.h>
#endif
using namespace Xbox;
using Microsoft::WRL::ComPtr;
namespace
{
//--------------------------------------------------------------------------------------
// Default XMemAlloc attributes for texture loading
//--------------------------------------------------------------------------------------
const uint64_t c_XMemAllocAttributes = MAKE_XALLOC_ATTRIBUTES(
eXALLOCAllocatorId_MiddlewareReservedMin,
0,
XALLOC_MEMTYPE_GRAPHICS_WRITECOMBINE_GPU_READONLY,
XALLOC_PAGESIZE_64KB,
XALLOC_ALIGNMENT_64K
#ifdef _GAMING_XBOX
, 0
#endif
);
}
//=====================================================================================
// Entry-points
//=====================================================================================
//-------------------------------------------------------------------------------------
// Create a texture resource
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::CreateTexture(
ID3D12Device* d3dDevice,
const XboxImage& xbox,
ID3D12Resource** ppResource,
void** grfxMemory)
{
if (!d3dDevice || !ppResource || !grfxMemory)
return E_INVALIDARG;
*grfxMemory = nullptr;
*ppResource = nullptr;
if (!xbox.GetPointer() || !xbox.GetAlignment() || !xbox.GetSize() || xbox.GetTileMode() == c_XboxTileModeInvalid)
return E_INVALIDARG;
// Allocate graphics memory
*grfxMemory = XMemAlloc(xbox.GetSize(), c_XMemAllocAttributes);
if (!*grfxMemory)
return E_OUTOFMEMORY;
// Copy tiled data into graphics memory
memcpy(*grfxMemory, xbox.GetPointer(), xbox.GetSize());
// Create texture resource
auto& metadata = xbox.GetMetadata();
D3D12_RESOURCE_DESC desc = {};
desc.Width = static_cast<UINT>(metadata.width);
desc.Height = static_cast<UINT>(metadata.height);
desc.MipLevels = static_cast<UINT16>(metadata.mipLevels);
desc.DepthOrArraySize = (metadata.dimension == DirectX::TEX_DIMENSION_TEXTURE3D) ? static_cast<UINT16>(metadata.depth) : static_cast<UINT16>(metadata.arraySize);
desc.Format = metadata.format;
desc.Flags = D3D12_RESOURCE_FLAG_NONE;
desc.SampleDesc.Count = 1;
desc.SampleDesc.Quality = 0;
desc.Dimension = static_cast<D3D12_RESOURCE_DIMENSION>(metadata.dimension);
desc.Layout = static_cast<D3D12_TEXTURE_LAYOUT>(0x100 | xbox.GetTileMode());
HRESULT hr = d3dDevice->CreatePlacedResourceX(
reinterpret_cast<D3D12_GPU_VIRTUAL_ADDRESS>(*grfxMemory),
&desc,
D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE,
nullptr,
IID_GRAPHICS_PPV_ARGS(ppResource));
if (FAILED(hr))
{
XMemFree(*grfxMemory, c_XMemAllocAttributes);
*grfxMemory = nullptr;
}
return hr;
}
//-------------------------------------------------------------------------------------
// Free allocated graphics memory
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
void Xbox::FreeTextureMemory(ID3D12Device* d3dDevice, void* grfxMemory)
{
UNREFERENCED_PARAMETER(d3dDevice); // used only for overload resolution
if (grfxMemory)
{
XMemFree(grfxMemory, c_XMemAllocAttributes);
}
}

View File

@ -0,0 +1,822 @@
//--------------------------------------------------------------------------------------
// File: DirectXTexXboxDDS.cpp
//
// DirectXTex Auxilary functions for saving "XBOX" Xbox variants of DDS files
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//--------------------------------------------------------------------------------------
#include "DirectXTexP.h"
#include "DirectXTexXbox.h"
#include "DDS.h"
#if defined(_GAMING_XBOX) || defined(_USE_GXDK)
#include "gxdk.h"
#else
#include "xdk.h"
#endif
using namespace DirectX;
using namespace Xbox;
namespace
{
//-------------------------------------------------------------------------------------
// Decodes DDS header using XBOX extended header (variant of DX10 header)
//-------------------------------------------------------------------------------------
HRESULT DecodeDDSHeader(
_In_reads_bytes_(size) const uint8_t* pSource,
size_t size,
DirectX::TexMetadata& metadata,
_Out_opt_ DDSMetaData* ddPixelFormat,
_Out_opt_ XboxTileMode* tmode,
_Out_opt_ uint32_t* dataSize,
_Out_opt_ uint32_t* baseAlignment)
{
if (!pSource)
return E_INVALIDARG;
if (tmode)
{
*tmode = c_XboxTileModeInvalid;
}
if (dataSize)
{
*dataSize = 0;
}
if (baseAlignment)
{
*baseAlignment = 0;
}
metadata = {};
if (ddPixelFormat)
{
*ddPixelFormat = {};
}
if (size < DDS_MIN_HEADER_SIZE)
{
return HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
}
// DDS files always start with the same magic number ("DDS ")
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(pSource);
if (dwMagicNumber != DDS_MAGIC)
{
return E_FAIL;
}
auto pHeader = reinterpret_cast<const DDS_HEADER*>(reinterpret_cast<const uint8_t*>(pSource) + sizeof(uint32_t));
// Verify header to validate DDS file
if (pHeader->size != sizeof(DDS_HEADER)
|| pHeader->ddspf.size != sizeof(DDS_PIXELFORMAT))
{
return E_FAIL;
}
metadata.mipLevels = pHeader->mipMapCount;
if (metadata.mipLevels == 0)
metadata.mipLevels = 1;
// Check for XBOX extension
if (!(pHeader->ddspf.flags & DDS_FOURCC)
|| (MAKEFOURCC('X', 'B', 'O', 'X') != pHeader->ddspf.fourCC))
{
// We know it's a DDS file, but it's not an XBOX extension
return S_FALSE;
}
// Buffer must be big enough for both headers and magic value
if (size < DDS_XBOX_HEADER_SIZE)
{
return E_FAIL;
}
auto xboxext = reinterpret_cast<const DDS_HEADER_XBOX*>(
reinterpret_cast<const uint8_t*>(pSource) + DDS_MIN_HEADER_SIZE);
metadata.arraySize = xboxext->arraySize;
if (metadata.arraySize == 0)
{
return HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
}
metadata.format = xboxext->dxgiFormat;
if (!IsValid(metadata.format))
{
return HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
}
static_assert(static_cast<int>(TEX_MISC_TEXTURECUBE) == static_cast<int>(DDS_RESOURCE_MISC_TEXTURECUBE), "DDS header mismatch");
metadata.miscFlags = xboxext->miscFlag & ~static_cast<uint32_t>(TEX_MISC_TEXTURECUBE);
switch (xboxext->resourceDimension)
{
case DDS_DIMENSION_TEXTURE1D:
if ((pHeader->flags & DDS_HEIGHT) && pHeader->height != 1)
{
return HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
}
metadata.width = pHeader->width;
metadata.height = 1;
metadata.depth = 1;
metadata.dimension = TEX_DIMENSION_TEXTURE1D;
break;
case DDS_DIMENSION_TEXTURE2D:
if (xboxext->miscFlag & DDS_RESOURCE_MISC_TEXTURECUBE)
{
metadata.miscFlags |= TEX_MISC_TEXTURECUBE;
metadata.arraySize *= 6;
}
metadata.width = pHeader->width;
metadata.height = pHeader->height;
metadata.depth = 1;
metadata.dimension = TEX_DIMENSION_TEXTURE2D;
break;
case DDS_DIMENSION_TEXTURE3D:
if (!(pHeader->flags & DDS_HEADER_FLAGS_VOLUME))
{
return HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
}
if (metadata.arraySize > 1)
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
metadata.width = pHeader->width;
metadata.height = pHeader->height;
metadata.depth = pHeader->depth;
metadata.dimension = TEX_DIMENSION_TEXTURE3D;
break;
default:
return HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
}
if (static_cast<XboxTileMode>(xboxext->tileMode) == c_XboxTileModeInvalid)
{
return HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
}
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
else if (!(xboxext->tileMode & XBOX_TILEMODE_SCARLETT))
{
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
#else
else if (xboxext->tileMode & XBOX_TILEMODE_SCARLETT)
{
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
#endif
static_assert(static_cast<int>(TEX_MISC2_ALPHA_MODE_MASK) == static_cast<int>(DDS_MISC_FLAGS2_ALPHA_MODE_MASK), "DDS header mismatch");
static_assert(static_cast<int>(TEX_ALPHA_MODE_UNKNOWN) == static_cast<int>(DDS_ALPHA_MODE_UNKNOWN), "DDS header mismatch");
static_assert(static_cast<int>(TEX_ALPHA_MODE_STRAIGHT) == static_cast<int>(DDS_ALPHA_MODE_STRAIGHT), "DDS header mismatch");
static_assert(static_cast<int>(TEX_ALPHA_MODE_PREMULTIPLIED) == static_cast<int>(DDS_ALPHA_MODE_PREMULTIPLIED), "DDS header mismatch");
static_assert(static_cast<int>(TEX_ALPHA_MODE_OPAQUE) == static_cast<int>(DDS_ALPHA_MODE_OPAQUE), "DDS header mismatch");
static_assert(static_cast<int>(TEX_ALPHA_MODE_CUSTOM) == static_cast<int>(DDS_ALPHA_MODE_CUSTOM), "DDS header mismatch");
metadata.miscFlags2 = xboxext->miscFlags2;
if (tmode)
{
*tmode = static_cast<XboxTileMode>(xboxext->tileMode & ~XBOX_TILEMODE_SCARLETT);
}
if (baseAlignment)
*baseAlignment = xboxext->baseAlignment;
if (dataSize)
*dataSize = xboxext->dataSize;
// Handle DDS-specific metadata
if (ddPixelFormat)
{
ddPixelFormat->size = pHeader->ddspf.size;
ddPixelFormat->flags = pHeader->ddspf.flags;
ddPixelFormat->fourCC = pHeader->ddspf.fourCC;
ddPixelFormat->RGBBitCount = pHeader->ddspf.RGBBitCount;
ddPixelFormat->RBitMask = pHeader->ddspf.RBitMask;
ddPixelFormat->GBitMask = pHeader->ddspf.GBitMask;
ddPixelFormat->BBitMask = pHeader->ddspf.BBitMask;
ddPixelFormat->ABitMask = pHeader->ddspf.ABitMask;
}
return S_OK;
}
}
//=====================================================================================
// Entry-points
//=====================================================================================
//-------------------------------------------------------------------------------------
// Encodes DDS file header (magic value, header, XBOX extended header)
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::EncodeDDSHeader(
const XboxImage& xbox,
uint8_t* pDestination,
size_t maxsize) noexcept
{
if (!pDestination)
return E_INVALIDARG;
if (maxsize < DDS_XBOX_HEADER_SIZE)
return E_NOT_SUFFICIENT_BUFFER;
*reinterpret_cast<uint32_t*>(pDestination) = DDS_MAGIC;
auto header = reinterpret_cast<DDS_HEADER*>(reinterpret_cast<uint8_t*>(pDestination) + sizeof(uint32_t));
memset(header, 0, sizeof(DDS_HEADER));
header->size = sizeof(DDS_HEADER);
header->flags = DDS_HEADER_FLAGS_TEXTURE;
header->caps = DDS_SURFACE_FLAGS_TEXTURE;
auto& metadata = xbox.GetMetadata();
if (metadata.mipLevels > 0)
{
header->flags |= DDS_HEADER_FLAGS_MIPMAP;
if (metadata.mipLevels > UINT32_MAX)
return E_INVALIDARG;
header->mipMapCount = static_cast<uint32_t>(metadata.mipLevels);
if (header->mipMapCount > 1)
header->caps |= DDS_SURFACE_FLAGS_MIPMAP;
}
switch (metadata.dimension)
{
case TEX_DIMENSION_TEXTURE1D:
if (metadata.width > UINT32_MAX)
return E_INVALIDARG;
header->width = static_cast<uint32_t>(metadata.width);
header->height = header->depth = 1;
break;
case TEX_DIMENSION_TEXTURE2D:
if (metadata.height > UINT32_MAX
|| metadata.width > UINT32_MAX)
return E_INVALIDARG;
header->height = static_cast<uint32_t>(metadata.height);
header->width = static_cast<uint32_t>(metadata.width);
header->depth = 1;
if (metadata.IsCubemap())
{
header->caps |= DDS_SURFACE_FLAGS_CUBEMAP;
header->caps2 |= DDS_CUBEMAP_ALLFACES;
}
break;
case TEX_DIMENSION_TEXTURE3D:
if (metadata.height > UINT32_MAX
|| metadata.width > UINT32_MAX
|| metadata.depth > UINT32_MAX)
return E_INVALIDARG;
header->flags |= DDS_HEADER_FLAGS_VOLUME;
header->caps2 |= DDS_FLAGS_VOLUME;
header->height = static_cast<uint32_t>(metadata.height);
header->width = static_cast<uint32_t>(metadata.width);
header->depth = static_cast<uint32_t>(metadata.depth);
break;
default:
return E_FAIL;
}
size_t rowPitch, slicePitch;
ComputePitch(metadata.format, metadata.width, metadata.height, rowPitch, slicePitch, CP_FLAGS_NONE);
if (slicePitch > UINT32_MAX
|| rowPitch > UINT32_MAX)
return E_FAIL;
if (IsCompressed(metadata.format))
{
header->flags |= DDS_HEADER_FLAGS_LINEARSIZE;
header->pitchOrLinearSize = static_cast<uint32_t>(slicePitch);
}
else
{
header->flags |= DDS_HEADER_FLAGS_PITCH;
header->pitchOrLinearSize = static_cast<uint32_t>(rowPitch);
}
memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_XBOX, sizeof(DDS_PIXELFORMAT));
// Setup XBOX extended header
auto xboxext = reinterpret_cast<DDS_HEADER_XBOX*>(reinterpret_cast<uint8_t*>(header) + sizeof(DDS_HEADER));
memset(xboxext, 0, sizeof(DDS_HEADER_XBOX));
xboxext->dxgiFormat = metadata.format;
xboxext->resourceDimension = metadata.dimension;
if (metadata.arraySize > UINT32_MAX)
return E_INVALIDARG;
static_assert(static_cast<int>(TEX_MISC_TEXTURECUBE) == static_cast<int>(DDS_RESOURCE_MISC_TEXTURECUBE), "DDS header mismatch");
xboxext->miscFlag = metadata.miscFlags & ~static_cast<uint32_t>(TEX_MISC_TEXTURECUBE);
if (metadata.miscFlags & TEX_MISC_TEXTURECUBE)
{
xboxext->miscFlag |= TEX_MISC_TEXTURECUBE;
assert((metadata.arraySize % 6) == 0);
xboxext->arraySize = static_cast<UINT>(metadata.arraySize / 6);
}
else
{
xboxext->arraySize = static_cast<UINT>(metadata.arraySize);
}
static_assert(static_cast<int>(TEX_MISC2_ALPHA_MODE_MASK) == static_cast<int>(DDS_MISC_FLAGS2_ALPHA_MODE_MASK), "DDS header mismatch");
static_assert(static_cast<int>(TEX_ALPHA_MODE_UNKNOWN) == static_cast<int>(DDS_ALPHA_MODE_UNKNOWN), "DDS header mismatch");
static_assert(static_cast<int>(TEX_ALPHA_MODE_STRAIGHT) == static_cast<int>(DDS_ALPHA_MODE_STRAIGHT), "DDS header mismatch");
static_assert(static_cast<int>(TEX_ALPHA_MODE_PREMULTIPLIED) == static_cast<int>(DDS_ALPHA_MODE_PREMULTIPLIED), "DDS header mismatch");
static_assert(static_cast<int>(TEX_ALPHA_MODE_OPAQUE) == static_cast<int>(DDS_ALPHA_MODE_OPAQUE), "DDS header mismatch");
static_assert(static_cast<int>(TEX_ALPHA_MODE_CUSTOM) == static_cast<int>(DDS_ALPHA_MODE_CUSTOM), "DDS header mismatch");
xboxext->miscFlags2 = metadata.miscFlags2;
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
xboxext->tileMode = static_cast<uint32_t>(xbox.GetTileMode()) | XBOX_TILEMODE_SCARLETT;
#else
xboxext->tileMode = static_cast<uint32_t>(xbox.GetTileMode());
#endif
xboxext->baseAlignment = xbox.GetAlignment();
xboxext->dataSize = xbox.GetSize();
#ifdef _GXDK_VER
xboxext->xdkVer = _GXDK_VER;
#elif defined(_XDK_VER)
xboxext->xdkVer = _XDK_VER;
#endif
return S_OK;
}
//-------------------------------------------------------------------------------------
// Obtain metadata from DDS file in memory/on disk
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::GetMetadataFromDDSMemory(
const uint8_t* pSource,
size_t size,
TexMetadata& metadata,
bool& isXbox)
{
return Xbox::GetMetadataFromDDSMemoryEx(pSource, size, metadata, isXbox, nullptr);
}
_Use_decl_annotations_
HRESULT Xbox::GetMetadataFromDDSMemoryEx(
const uint8_t* pSource,
size_t size,
TexMetadata& metadata,
bool& isXbox,
DDSMetaData* ddPixelFormat)
{
if (!pSource || !size)
return E_INVALIDARG;
isXbox = false;
HRESULT hr = DecodeDDSHeader(pSource, size, metadata, ddPixelFormat, nullptr, nullptr, nullptr);
if (hr == S_FALSE)
{
hr = DirectX::GetMetadataFromDDSMemoryEx(pSource, size, DirectX::DDS_FLAGS_NONE, metadata, ddPixelFormat);
}
else if (SUCCEEDED(hr))
{
isXbox = true;
}
return hr;
}
_Use_decl_annotations_
HRESULT Xbox::GetMetadataFromDDSFile(
const wchar_t* szFile,
TexMetadata& metadata,
bool& isXbox)
{
return Xbox::GetMetadataFromDDSFileEx(szFile, metadata, isXbox, nullptr);
}
_Use_decl_annotations_
HRESULT Xbox::GetMetadataFromDDSFileEx(
const wchar_t* szFile,
TexMetadata& metadata,
bool& isXbox,
DDSMetaData* ddPixelFormat)
{
if (!szFile)
return E_INVALIDARG;
isXbox = false;
ScopedHandle hFile(safe_handle(CreateFile2(
szFile,
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
}
// Get the file size
FILE_STANDARD_INFO fileInfo;
if (!GetFileInformationByHandleEx(hFile.get(), FileStandardInfo, &fileInfo, sizeof(fileInfo)))
{
return HRESULT_FROM_WIN32(GetLastError());
}
// File is too big for 32-bit allocation, so reject read (4 GB should be plenty large enough for a valid DDS file)
if (fileInfo.EndOfFile.HighPart > 0)
{
return HRESULT_FROM_WIN32(ERROR_FILE_TOO_LARGE);
}
// Need at least enough data to fill the standard header and magic number to be a valid DDS
if (fileInfo.EndOfFile.LowPart < DDS_MIN_HEADER_SIZE)
{
return E_FAIL;
}
// Read the header in (including extended header if present)
uint8_t header[DDS_XBOX_HEADER_SIZE] = {};
DWORD bytesRead = 0;
if (!ReadFile(hFile.get(), header, DDS_XBOX_HEADER_SIZE, &bytesRead, nullptr))
{
return HRESULT_FROM_WIN32(GetLastError());
}
HRESULT hr = DecodeDDSHeader(header, bytesRead, metadata, ddPixelFormat, nullptr, nullptr, nullptr);
if (hr == S_FALSE)
{
hr = DirectX::GetMetadataFromDDSMemoryEx(header, bytesRead, DirectX::DDS_FLAGS_NONE, metadata, ddPixelFormat);
}
else if (SUCCEEDED(hr))
{
isXbox = true;
}
return hr;
}
//-------------------------------------------------------------------------------------
// Load a DDS file in memory
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::LoadFromDDSMemory(
const uint8_t* pSource,
size_t size,
TexMetadata* metadata,
XboxImage& xbox)
{
return Xbox::LoadFromDDSMemoryEx(pSource, size, metadata, nullptr, xbox);
}
_Use_decl_annotations_
HRESULT Xbox::LoadFromDDSMemoryEx(
const uint8_t* pSource,
size_t size,
TexMetadata* metadata,
DDSMetaData* ddPixelFormat,
XboxImage& xbox)
{
if (!pSource || !size)
return E_INVALIDARG;
xbox.Release();
TexMetadata mdata;
uint32_t dataSize;
uint32_t baseAlignment;
XboxTileMode tmode;
HRESULT hr = DecodeDDSHeader(pSource, size, mdata, ddPixelFormat, &tmode, &dataSize, &baseAlignment);
if (hr == S_FALSE)
{
// It's a DDS, but not an XBOX variant
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
if (FAILED(hr))
{
return hr;
}
if (!dataSize || !baseAlignment)
{
return E_FAIL;
}
if (size <= DDS_XBOX_HEADER_SIZE)
{
return E_FAIL;
}
// Copy tiled data
const size_t remaining = size - DDS_XBOX_HEADER_SIZE;
if (remaining < dataSize)
{
return HRESULT_FROM_WIN32(ERROR_HANDLE_EOF);
}
hr = xbox.Initialize(mdata, tmode, dataSize, baseAlignment);
if (FAILED(hr))
return hr;
assert(xbox.GetPointer() != nullptr);
memcpy(xbox.GetPointer(), reinterpret_cast<const uint8_t*>(pSource) + DDS_XBOX_HEADER_SIZE, dataSize);
if (metadata)
memcpy(metadata, &mdata, sizeof(TexMetadata));
return S_OK;
}
//-------------------------------------------------------------------------------------
// Load a DDS file from disk
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::LoadFromDDSFile(
const wchar_t* szFile,
TexMetadata* metadata,
XboxImage& xbox)
{
return Xbox::LoadFromDDSFileEx(szFile, metadata, nullptr, xbox);
}
_Use_decl_annotations_
HRESULT Xbox::LoadFromDDSFileEx(
const wchar_t* szFile,
TexMetadata* metadata,
DDSMetaData* ddPixelFormat,
XboxImage& xbox)
{
if (!szFile)
return E_INVALIDARG;
xbox.Release();
ScopedHandle hFile(safe_handle(CreateFile2(
szFile,
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
}
// Get the file size
FILE_STANDARD_INFO fileInfo;
if (!GetFileInformationByHandleEx(hFile.get(), FileStandardInfo, &fileInfo, sizeof(fileInfo)))
{
return HRESULT_FROM_WIN32(GetLastError());
}
// File is too big for 32-bit allocation, so reject read (4 GB should be plenty large enough for a valid DDS file)
if (fileInfo.EndOfFile.HighPart > 0)
{
return HRESULT_FROM_WIN32(ERROR_FILE_TOO_LARGE);
}
// Need at least enough data to fill the standard header and magic number to be a valid DDS
if (fileInfo.EndOfFile.LowPart < DDS_MIN_HEADER_SIZE)
{
return E_FAIL;
}
// Read the header in (including extended header if present)
uint8_t header[DDS_XBOX_HEADER_SIZE] = {};
DWORD bytesRead = 0;
if (!ReadFile(hFile.get(), header, DDS_XBOX_HEADER_SIZE, &bytesRead, nullptr))
{
return HRESULT_FROM_WIN32(GetLastError());
}
TexMetadata mdata;
XboxTileMode tmode;
uint32_t dataSize;
uint32_t baseAlignment;
HRESULT hr = DecodeDDSHeader(header, bytesRead, mdata, ddPixelFormat, &tmode, &dataSize, &baseAlignment);
if (hr == S_FALSE)
{
// It's a DDS, but not an XBOX variant
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
if (FAILED(hr))
return hr;
if (!dataSize || !baseAlignment)
{
return E_FAIL;
}
// Read tiled data
const DWORD remaining = fileInfo.EndOfFile.LowPart - DDS_XBOX_HEADER_SIZE;
if (remaining == 0)
return E_FAIL;
if (remaining < dataSize)
{
return HRESULT_FROM_WIN32(ERROR_HANDLE_EOF);
}
hr = xbox.Initialize(mdata, tmode, dataSize, baseAlignment);
if (FAILED(hr))
return hr;
assert(xbox.GetPointer() != nullptr);
if (!ReadFile(hFile.get(), xbox.GetPointer(), dataSize, &bytesRead, nullptr))
{
xbox.Release();
return HRESULT_FROM_WIN32(GetLastError());
}
if (metadata)
memcpy(metadata, &mdata, sizeof(TexMetadata));
return S_OK;
}
//-------------------------------------------------------------------------------------
// Save a DDS file to memory
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::SaveToDDSMemory(const XboxImage& xbox, Blob& blob)
{
if (!xbox.GetPointer() || !xbox.GetSize() || !xbox.GetAlignment())
return E_INVALIDARG;
blob.Release();
HRESULT hr = blob.Initialize(DDS_XBOX_HEADER_SIZE + xbox.GetSize());
if (FAILED(hr))
return hr;
// Copy header
auto pDestination = blob.GetBufferPointer();
assert(pDestination);
hr = EncodeDDSHeader(xbox, pDestination, DDS_XBOX_HEADER_SIZE);
if (FAILED(hr))
{
blob.Release();
return hr;
}
// Copy tiled data
const size_t remaining = blob.GetBufferSize() - DDS_XBOX_HEADER_SIZE;
pDestination += DDS_XBOX_HEADER_SIZE;
if (!remaining)
{
blob.Release();
return E_FAIL;
}
if (remaining < xbox.GetSize())
{
blob.Release();
return E_UNEXPECTED;
}
memcpy(pDestination, xbox.GetPointer(), xbox.GetSize());
return S_OK;
}
//-------------------------------------------------------------------------------------
// Save a DDS file to disk
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::SaveToDDSFile(const XboxImage& xbox, const wchar_t* szFile)
{
if (!szFile || !xbox.GetPointer() || !xbox.GetSize() || !xbox.GetAlignment())
return E_INVALIDARG;
// Create DDS Header
uint8_t header[DDS_XBOX_HEADER_SIZE] = {};
HRESULT hr = EncodeDDSHeader(xbox, header, DDS_XBOX_HEADER_SIZE);
if (FAILED(hr))
return hr;
// Create file and write header
ScopedHandle hFile(safe_handle(CreateFile2(
szFile,
GENERIC_WRITE, 0, CREATE_ALWAYS,
nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
}
DWORD bytesWritten;
if (!WriteFile(hFile.get(), header, static_cast<DWORD>(DDS_XBOX_HEADER_SIZE), &bytesWritten, nullptr))
{
return HRESULT_FROM_WIN32(GetLastError());
}
if (bytesWritten != DDS_XBOX_HEADER_SIZE)
{
return E_FAIL;
}
// Write tiled data
if (!WriteFile(hFile.get(), xbox.GetPointer(), static_cast<DWORD>(xbox.GetSize()), &bytesWritten, nullptr))
{
return HRESULT_FROM_WIN32(GetLastError());
}
if (bytesWritten != xbox.GetSize())
{
return E_FAIL;
}
return S_OK;
}
//--------------------------------------------------------------------------------------
// Adapters for /Zc:wchar_t- clients
#if defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED)
namespace Xbox
{
HRESULT __cdecl GetMetadataFromDDSFile(
_In_z_ const __wchar_t* szFile,
_Out_ DirectX::TexMetadata& metadata,
_Out_ bool& isXbox)
{
return GetMetadataFromDDSFile(reinterpret_cast<const unsigned short*>(szFile), metadata, isXbox);
}
HRESULT __cdecl GetMetadataFromDDSFileEx(
_In_z_ const __wchar_t* szFile,
_Out_ DirectX::TexMetadata& metadata,
_Out_ bool& isXbox,
_Out_opt_ DirectX::DDSMetaData* ddPixelFormat)
{
return GetMetadataFromDDSFileEx(reinterpret_cast<const unsigned short*>(szFile), metadata, isXbox, ddPixelFormat);
}
HRESULT __cdecl LoadFromDDSFile(
_In_z_ const __wchar_t* szFile,
_Out_opt_ DirectX::TexMetadata* metadata,
_Out_ XboxImage& image)
{
return LoadFromDDSFile(reinterpret_cast<const unsigned short*>(szFile), metadata, image);
}
HRESULT __cdecl LoadFromDDSFileEx(
_In_z_ const __wchar_t* szFile,
_Out_opt_ DirectX::TexMetadata* metadata,
_Out_opt_ DirectX::DDSMetaData* ddPixelFormat,
_Out_ XboxImage& image)
{
return LoadFromDDSFileEx(reinterpret_cast<const unsigned short*>(szFile), metadata, ddPixelFormat, image);
}
HRESULT __cdecl SaveToDDSFile(_In_ const XboxImage& xbox, _In_z_ const __wchar_t* szFile)
{
return SaveToDDSFile(xbox, reinterpret_cast<const unsigned short*>(szFile));
}
}
#endif // !_NATIVE_WCHAR_T_DEFINED

View File

@ -0,0 +1,559 @@
//--------------------------------------------------------------------------------------
// File: DirectXTexXboxDetile.cpp
//
// DirectXTex Auxilary functions for converting from Xbox tiled to linear
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//--------------------------------------------------------------------------------------
#include "DirectXTexP.h"
#include "DirectXTexXbox.h"
using Microsoft::WRL::ComPtr;
using namespace DirectX;
using namespace DirectX::Internal;
using namespace Xbox;
namespace
{
//----------------------------------------------------------------------------------
inline HRESULT DetileByElement1D(
const XboxImage& xbox,
uint32_t level,
_In_ XGTextureAddressComputer* computer,
const XG_RESOURCE_LAYOUT& layout,
_In_reads_(nimages) const Image* const * result,
size_t nimages,
size_t bpp,
size_t w,
bool packed)
{
const uint8_t* sptr = xbox.GetPointer();
const uint8_t* endPtr = sptr + layout.SizeBytes;
assert((nimages > 0) && (nimages <= UINT32_MAX));
for (size_t item = 0; item < nimages; ++item)
{
const Image* img = result[item];
if (!img || !img->pixels)
return E_POINTER;
assert(img->width == result[0]->width);
assert(img->height == result[0]->height);
assert(img->rowPitch == result[0]->rowPitch);
assert(img->format == result[0]->format);
uint8_t* dptr = img->pixels;
for (size_t x = 0; x < w; ++x)
{
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
const UINT64 element = (packed) ? (x >> 1) : x;
const size_t offset = computer->GetTexelElementOffsetBytes(0, static_cast<uint32_t>(level), element, 0, static_cast<uint32_t>(item), 0, nullptr);
#else
const size_t offset = computer->GetTexelElementOffsetBytes(0, static_cast<uint32_t>(level), x, 0, static_cast<uint32_t>(item), 0);
#endif
if (offset == size_t(-1))
return E_FAIL;
const uint8_t* src = sptr + offset;
if ((src + bpp) > endPtr)
return E_FAIL;
memcpy(dptr, src, bpp);
dptr += bpp;
if (packed)
++x;
}
}
return S_OK;
}
//-------------------------------------------------------------------------------------
// 1D Tiling
//-------------------------------------------------------------------------------------
HRESULT Detile1D(
const XboxImage& xbox,
uint32_t level,
_In_ XGTextureAddressComputer* computer,
const XG_RESOURCE_LAYOUT& layout,
_In_reads_(nimages) const Image** result,
size_t nimages)
{
if (!nimages || nimages > UINT32_MAX)
return E_INVALIDARG;
if (!xbox.GetPointer() || !computer || !result || !result[0])
return E_POINTER;
assert(layout.Planes == 1);
const DXGI_FORMAT format = result[0]->format;
assert(format == xbox.GetMetadata().format);
assert(!IsCompressed(format));
bool byelement = IsTypeless(format);
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
if (nimages > 1)
byelement = true;
#endif
if (IsPacked(format))
{
const size_t bpp = (BitsPerPixel(format) + 7) / 8;
// XG (XboxOne) incorrectly returns 2 instead of 4 here for layout.Plane[0].BytesPerElement
const size_t w = result[0]->width;
assert(((w + 1) / 2) == layout.Plane[0].MipLayout[level].WidthElements);
return DetileByElement1D(xbox, level, computer, layout, result, nimages, bpp, w, true);
}
else if (byelement)
{
//--- Typeless is done with per-element copy ----------------------------------
const size_t bpp = (BitsPerPixel(format) + 7) / 8;
assert(bpp == layout.Plane[0].BytesPerElement);
const size_t w = result[0]->width;
assert(w == layout.Plane[0].MipLayout[level].WidthElements);
return DetileByElement1D(xbox, level, computer, layout, result, nimages, bpp, w, false);
}
else
{
//--- Standard format handling ------------------------------------------------
auto& mip = layout.Plane[0].MipLayout[level];
const UINT32 tiledPixels = mip.PitchPixels * mip.PaddedDepthOrArraySize;
auto scanline = make_AlignedArrayXMVECTOR(tiledPixels + result[0]->width);
XMVECTOR* target = scanline.get();
XMVECTOR* tiled = target + result[0]->width;
#ifdef _DEBUG
memset(target, 0xCD, sizeof(XMVECTOR) * result[0]->width);
memset(tiled, 0xDD, sizeof(XMVECTOR) * tiledPixels);
#endif
// Load tiled texture
if ((xbox.GetSize() - mip.OffsetBytes) < mip.SizeBytes)
return E_FAIL;
if (!LoadScanline(tiled, tiledPixels, xbox.GetPointer() + mip.OffsetBytes, mip.SizeBytes, xbox.GetMetadata().format))
return E_FAIL;
// Perform detiling
for (size_t item = 0; item < nimages; ++item)
{
const Image* img = result[item];
if (!img || !img->pixels)
return E_POINTER;
assert(img->width == result[0]->width);
assert(img->height == result[0]->height);
assert(img->rowPitch == result[0]->rowPitch);
assert(img->format == result[0]->format);
for (size_t x = 0; x < img->width; ++x)
{
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, static_cast<uint32_t>(item), 0, nullptr);
#else
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, static_cast<uint32_t>(item), 0);
#endif
if (offset == size_t(-1))
return E_FAIL;
assert(offset >= mip.OffsetBytes);
assert(offset < mip.OffsetBytes + mip.SizeBytes);
offset = (offset - mip.OffsetBytes) / layout.Plane[0].BytesPerElement;
assert(offset < tiledPixels);
target[x] = tiled[offset];
}
if (!StoreScanline(img->pixels, img->rowPitch, img->format, target, img->width))
return E_FAIL;
}
}
return S_OK;
}
//-------------------------------------------------------------------------------------
// 2D Tiling
//-------------------------------------------------------------------------------------
HRESULT Detile2D(
const XboxImage& xbox,
uint32_t level,
_In_ XGTextureAddressComputer* computer,
_In_reads_(nimages) const Image** result,
size_t nimages)
{
if (!nimages || nimages > UINT32_MAX)
return E_INVALIDARG;
if (!xbox.GetPointer() || !computer || !result || !result[0])
return E_POINTER;
assert(xbox.GetMetadata().format == result[0]->format);
uint8_t* baseAddr = xbox.GetPointer();
const auto& metadata = xbox.GetMetadata();
for (size_t item = 0; item < nimages; ++item)
{
const Image* img = result[item];
if (!img || !img->pixels)
return E_POINTER;
assert(img->width == result[0]->width);
assert(img->height == result[0]->height);
assert(img->rowPitch == result[0]->rowPitch);
assert(img->format == result[0]->format);
HRESULT hr = computer->CopyFromSubresource(
img->pixels,
0u,
metadata.CalculateSubresource(level, item),
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
0u,
#endif
baseAddr,
static_cast<UINT32>(img->rowPitch),
0u);
if (FAILED(hr))
{
return hr;
}
}
return S_OK;
}
//-------------------------------------------------------------------------------------
// 3D Tiling
//-------------------------------------------------------------------------------------
HRESULT Detile3D(
const XboxImage& xbox,
uint32_t level,
_In_ XGTextureAddressComputer* computer,
const Image& result)
{
if (!computer || !xbox.GetPointer() || !result.pixels)
return E_POINTER;
assert(xbox.GetMetadata().format == result.format);
uint8_t* baseAddr = xbox.GetPointer();
const auto& metadata = xbox.GetMetadata();
return computer->CopyFromSubresource(
result.pixels,
0u,
metadata.CalculateSubresource(level, 0),
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
0u,
#endif
baseAddr,
static_cast<UINT32>(result.rowPitch),
static_cast<UINT32>(result.slicePitch));
}
}
//=====================================================================================
// Entry-points
//=====================================================================================
//-------------------------------------------------------------------------------------
// Detile image
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::Detile(
const XboxImage& xbox,
DirectX::ScratchImage& image)
{
if (!xbox.GetSize() || !xbox.GetPointer() || xbox.GetTileMode() == c_XboxTileModeInvalid)
return E_INVALIDARG;
image.Release();
auto& metadata = xbox.GetMetadata();
if (metadata.format == DXGI_FORMAT_R1_UNORM
|| IsVideo(metadata.format))
{
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
switch (metadata.format)
{
case DXGI_FORMAT_R32G32B32_TYPELESS:
case DXGI_FORMAT_R32G32B32_FLOAT:
case DXGI_FORMAT_R32G32B32_UINT:
case DXGI_FORMAT_R32G32B32_SINT:
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
default:
break;
}
XG_RESOURCE_LAYOUT layout = {};
switch (metadata.dimension)
{
case TEX_DIMENSION_TEXTURE1D:
{
if (metadata.width > D3D11_REQ_TEXTURE1D_U_DIMENSION
|| metadata.mipLevels > D3D11_REQ_MIP_LEVELS
|| metadata.arraySize > D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION)
return E_INVALIDARG;
XG_TEXTURE1D_DESC desc = {};
desc.Width = static_cast<UINT>(metadata.width);
desc.MipLevels = static_cast<UINT>(metadata.mipLevels);
desc.ArraySize = static_cast<UINT>(metadata.arraySize);
desc.Format = static_cast<XG_FORMAT>(metadata.format);
desc.Usage = XG_USAGE_DEFAULT;
desc.BindFlags = XG_BIND_SHADER_RESOURCE;
desc.MiscFlags = (metadata.IsCubemap()) ? XG_RESOURCE_MISC_TEXTURECUBE : 0;
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
desc.SwizzleMode = xbox.GetTileMode();
#else
desc.TileMode = xbox.GetTileMode();
#endif
ComPtr<XGTextureAddressComputer> computer;
HRESULT hr = XGCreateTexture1DComputer(&desc, computer.GetAddressOf());
if (FAILED(hr))
return hr;
hr = computer->GetResourceLayout(&layout);
if (FAILED(hr))
return hr;
if (layout.Planes != 1)
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
if (layout.SizeBytes != xbox.GetSize()
|| layout.BaseAlignmentBytes != xbox.GetAlignment())
return E_UNEXPECTED;
hr = image.Initialize(metadata);
if (FAILED(hr))
return hr;
for (size_t level = 0; level < metadata.mipLevels; ++level)
{
if (metadata.arraySize > 1)
{
std::vector<const Image*> images;
images.reserve(metadata.arraySize);
for (size_t item = 0; item < metadata.arraySize; ++item)
{
const Image* img = image.GetImage(level, item, 0);
if (!img)
{
image.Release();
return E_FAIL;
}
images.push_back(img);
}
hr = Detile1D(xbox, static_cast<uint32_t>(level), computer.Get(), layout, &images[0], images.size());
}
else
{
const Image* img = image.GetImage(level, 0, 0);
if (!img)
{
image.Release();
return E_FAIL;
}
hr = Detile1D(xbox, static_cast<uint32_t>(level), computer.Get(), layout, &img, 1);
}
if (FAILED(hr))
{
image.Release();
return hr;
}
}
}
break;
case TEX_DIMENSION_TEXTURE2D:
{
if (metadata.width > D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION
|| metadata.height > D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION
|| metadata.mipLevels > D3D11_REQ_MIP_LEVELS
|| metadata.arraySize > D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION)
return E_INVALIDARG;
XG_TEXTURE2D_DESC desc = {};
desc.Width = static_cast<UINT>(metadata.width);
desc.Height = static_cast<UINT>(metadata.height);
desc.MipLevels = static_cast<UINT>(metadata.mipLevels);
desc.ArraySize = static_cast<UINT>(metadata.arraySize);
desc.Format = static_cast<XG_FORMAT>(metadata.format);
desc.SampleDesc.Count = 1;
desc.Usage = XG_USAGE_DEFAULT;
desc.BindFlags = XG_BIND_SHADER_RESOURCE;
desc.MiscFlags = (metadata.miscFlags & TEX_MISC_TEXTURECUBE) ? XG_RESOURCE_MISC_TEXTURECUBE : 0;
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
desc.SwizzleMode = xbox.GetTileMode();
#else
desc.TileMode = xbox.GetTileMode();
#endif
ComPtr<XGTextureAddressComputer> computer;
HRESULT hr = XGCreateTexture2DComputer(&desc, computer.GetAddressOf());
if (FAILED(hr))
return hr;
hr = computer->GetResourceLayout(&layout);
if (FAILED(hr))
return hr;
if (layout.Planes != 1)
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
if (layout.SizeBytes != xbox.GetSize()
|| layout.BaseAlignmentBytes != xbox.GetAlignment())
return E_UNEXPECTED;
hr = image.Initialize(metadata);
if (FAILED(hr))
return hr;
for (size_t level = 0; level < metadata.mipLevels; ++level)
{
if (metadata.arraySize > 1)
{
std::vector<const Image*> images;
images.reserve(metadata.arraySize);
for (size_t item = 0; item < metadata.arraySize; ++item)
{
const Image* img = image.GetImage(level, item, 0);
if (!img)
{
image.Release();
return E_FAIL;
}
images.push_back(img);
}
hr = Detile2D(xbox, static_cast<uint32_t>(level), computer.Get(), &images[0], images.size());
}
else
{
const Image* img = image.GetImage(level, 0, 0);
if (!img)
{
image.Release();
return E_FAIL;
}
hr = Detile2D(xbox, static_cast<uint32_t>(level), computer.Get(), &img, 1);
}
if (FAILED(hr))
{
image.Release();
return hr;
}
}
}
break;
case TEX_DIMENSION_TEXTURE3D:
{
if (metadata.width > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION
|| metadata.height > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION
|| metadata.depth > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION
|| metadata.mipLevels > D3D11_REQ_MIP_LEVELS
|| metadata.arraySize != 1)
return E_INVALIDARG;
XG_TEXTURE3D_DESC desc = {};
desc.Width = static_cast<UINT>(metadata.width);
desc.Height = static_cast<UINT>(metadata.height);
desc.Depth = static_cast<UINT>(metadata.depth);
desc.MipLevels = static_cast<UINT>(metadata.mipLevels);
desc.Format = static_cast<XG_FORMAT>(metadata.format);
desc.Usage = XG_USAGE_DEFAULT;
desc.BindFlags = XG_BIND_SHADER_RESOURCE;
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
desc.SwizzleMode = xbox.GetTileMode();
#else
desc.TileMode = xbox.GetTileMode();
#endif
ComPtr<XGTextureAddressComputer> computer;
HRESULT hr = XGCreateTexture3DComputer(&desc, computer.GetAddressOf());
if (FAILED(hr))
return hr;
hr = computer->GetResourceLayout(&layout);
if (FAILED(hr))
return hr;
if (layout.Planes != 1)
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
if (layout.SizeBytes != xbox.GetSize()
|| layout.BaseAlignmentBytes != xbox.GetAlignment())
return E_UNEXPECTED;
hr = image.Initialize(metadata);
if (FAILED(hr))
return hr;
auto d = static_cast<uint32_t>(metadata.depth);
size_t index = 0;
for (size_t level = 0; level < metadata.mipLevels; ++level)
{
if ((index + d) > image.GetImageCount())
{
image.Release();
return E_FAIL;
}
// Relies on the fact that slices are contiguous
hr = Detile3D(xbox, static_cast<uint32_t>(level), computer.Get(), image.GetImages()[index]);
if (FAILED(hr))
{
image.Release();
return hr;
}
index += d;
if (d > 1)
d >>= 1;
}
}
break;
default:
return E_FAIL;
}
return S_OK;
}

View File

@ -0,0 +1,319 @@
//--------------------------------------------------------------------------------------
// File: DirectXTexXboxImage.cpp
//
// DirectXTex Auxilary functions for Xbox texture blob
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//--------------------------------------------------------------------------------------
#include "DirectXTexP.h"
#include "DirectXTexXbox.h"
using namespace DirectX;
using namespace Xbox;
// Sanity check XG library values against DirectXTex's values
static_assert(static_cast<int>(XG_FORMAT_UNKNOWN) == static_cast<int>(DXGI_FORMAT_UNKNOWN), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32B32A32_TYPELESS) == static_cast<int>(DXGI_FORMAT_R32G32B32A32_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32B32A32_FLOAT) == static_cast<int>(DXGI_FORMAT_R32G32B32A32_FLOAT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32B32A32_UINT) == static_cast<int>(DXGI_FORMAT_R32G32B32A32_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32B32A32_SINT) == static_cast<int>(DXGI_FORMAT_R32G32B32A32_SINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32B32_TYPELESS) == static_cast<int>(DXGI_FORMAT_R32G32B32_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32B32_FLOAT) == static_cast<int>(DXGI_FORMAT_R32G32B32_FLOAT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32B32_UINT) == static_cast<int>(DXGI_FORMAT_R32G32B32_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32B32_SINT) == static_cast<int>(DXGI_FORMAT_R32G32B32_SINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16B16A16_TYPELESS) == static_cast<int>(DXGI_FORMAT_R16G16B16A16_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16B16A16_FLOAT) == static_cast<int>(DXGI_FORMAT_R16G16B16A16_FLOAT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16B16A16_UNORM) == static_cast<int>(DXGI_FORMAT_R16G16B16A16_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16B16A16_UINT) == static_cast<int>(DXGI_FORMAT_R16G16B16A16_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16B16A16_SNORM) == static_cast<int>(DXGI_FORMAT_R16G16B16A16_SNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16B16A16_SINT) == static_cast<int>(DXGI_FORMAT_R16G16B16A16_SINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32_TYPELESS) == static_cast<int>(DXGI_FORMAT_R32G32_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32_FLOAT) == static_cast<int>(DXGI_FORMAT_R32G32_FLOAT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32_UINT) == static_cast<int>(DXGI_FORMAT_R32G32_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G32_SINT) == static_cast<int>(DXGI_FORMAT_R32G32_SINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32G8X24_TYPELESS) == static_cast<int>(DXGI_FORMAT_R32G8X24_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_D32_FLOAT_S8X24_UINT) == static_cast<int>(DXGI_FORMAT_D32_FLOAT_S8X24_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32_FLOAT_X8X24_TYPELESS) == static_cast<int>(DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_X32_TYPELESS_G8X24_UINT) == static_cast<int>(DXGI_FORMAT_X32_TYPELESS_G8X24_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R10G10B10A2_TYPELESS) == static_cast<int>(DXGI_FORMAT_R10G10B10A2_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R10G10B10A2_UNORM) == static_cast<int>(DXGI_FORMAT_R10G10B10A2_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R10G10B10A2_UINT) == static_cast<int>(DXGI_FORMAT_R10G10B10A2_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R11G11B10_FLOAT) == static_cast<int>(DXGI_FORMAT_R11G11B10_FLOAT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8B8A8_TYPELESS) == static_cast<int>(DXGI_FORMAT_R8G8B8A8_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8B8A8_UNORM) == static_cast<int>(DXGI_FORMAT_R8G8B8A8_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8B8A8_UNORM_SRGB) == static_cast<int>(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8B8A8_UINT) == static_cast<int>(DXGI_FORMAT_R8G8B8A8_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8B8A8_SNORM) == static_cast<int>(DXGI_FORMAT_R8G8B8A8_SNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8B8A8_SINT) == static_cast<int>(DXGI_FORMAT_R8G8B8A8_SINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16_TYPELESS) == static_cast<int>(DXGI_FORMAT_R16G16_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16_FLOAT) == static_cast<int>(DXGI_FORMAT_R16G16_FLOAT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16_UNORM) == static_cast<int>(DXGI_FORMAT_R16G16_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16_UINT) == static_cast<int>(DXGI_FORMAT_R16G16_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16_SNORM) == static_cast<int>(DXGI_FORMAT_R16G16_SNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16G16_SINT) == static_cast<int>(DXGI_FORMAT_R16G16_SINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32_TYPELESS) == static_cast<int>(DXGI_FORMAT_R32_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_D32_FLOAT) == static_cast<int>(DXGI_FORMAT_D32_FLOAT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32_FLOAT) == static_cast<int>(DXGI_FORMAT_R32_FLOAT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32_UINT) == static_cast<int>(DXGI_FORMAT_R32_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R32_SINT) == static_cast<int>(DXGI_FORMAT_R32_SINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R24G8_TYPELESS) == static_cast<int>(DXGI_FORMAT_R24G8_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_D24_UNORM_S8_UINT) == static_cast<int>(DXGI_FORMAT_D24_UNORM_S8_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R24_UNORM_X8_TYPELESS) == static_cast<int>(DXGI_FORMAT_R24_UNORM_X8_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_X24_TYPELESS_G8_UINT) == static_cast<int>(DXGI_FORMAT_X24_TYPELESS_G8_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8_TYPELESS) == static_cast<int>(DXGI_FORMAT_R8G8_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8_UNORM) == static_cast<int>(DXGI_FORMAT_R8G8_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8_UINT) == static_cast<int>(DXGI_FORMAT_R8G8_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8_SNORM) == static_cast<int>(DXGI_FORMAT_R8G8_SNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8_SINT) == static_cast<int>(DXGI_FORMAT_R8G8_SINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16_TYPELESS) == static_cast<int>(DXGI_FORMAT_R16_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16_FLOAT) == static_cast<int>(DXGI_FORMAT_R16_FLOAT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_D16_UNORM) == static_cast<int>(DXGI_FORMAT_D16_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16_UNORM) == static_cast<int>(DXGI_FORMAT_R16_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16_UINT) == static_cast<int>(DXGI_FORMAT_R16_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16_SNORM) == static_cast<int>(DXGI_FORMAT_R16_SNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R16_SINT) == static_cast<int>(DXGI_FORMAT_R16_SINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8_TYPELESS) == static_cast<int>(DXGI_FORMAT_R8_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8_UNORM) == static_cast<int>(DXGI_FORMAT_R8_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8_UINT) == static_cast<int>(DXGI_FORMAT_R8_UINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8_SNORM) == static_cast<int>(DXGI_FORMAT_R8_SNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8_SINT) == static_cast<int>(DXGI_FORMAT_R8_SINT), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_A8_UNORM) == static_cast<int>(DXGI_FORMAT_A8_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R1_UNORM) == static_cast<int>(DXGI_FORMAT_R1_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R9G9B9E5_SHAREDEXP) == static_cast<int>(DXGI_FORMAT_R9G9B9E5_SHAREDEXP), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R8G8_B8G8_UNORM) == static_cast<int>(DXGI_FORMAT_R8G8_B8G8_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_G8R8_G8B8_UNORM) == static_cast<int>(DXGI_FORMAT_G8R8_G8B8_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC1_TYPELESS) == static_cast<int>(DXGI_FORMAT_BC1_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC1_UNORM) == static_cast<int>(DXGI_FORMAT_BC1_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC1_UNORM_SRGB) == static_cast<int>(DXGI_FORMAT_BC1_UNORM_SRGB), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC2_TYPELESS) == static_cast<int>(DXGI_FORMAT_BC2_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC2_UNORM) == static_cast<int>(DXGI_FORMAT_BC2_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC2_UNORM_SRGB) == static_cast<int>(DXGI_FORMAT_BC2_UNORM_SRGB), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC3_TYPELESS) == static_cast<int>(DXGI_FORMAT_BC3_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC3_UNORM) == static_cast<int>(DXGI_FORMAT_BC3_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC3_UNORM_SRGB) == static_cast<int>(DXGI_FORMAT_BC3_UNORM_SRGB), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC4_TYPELESS) == static_cast<int>(DXGI_FORMAT_BC4_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC4_UNORM) == static_cast<int>(DXGI_FORMAT_BC4_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC4_SNORM) == static_cast<int>(DXGI_FORMAT_BC4_SNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC5_TYPELESS) == static_cast<int>(DXGI_FORMAT_BC5_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC5_UNORM) == static_cast<int>(DXGI_FORMAT_BC5_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC5_SNORM) == static_cast<int>(DXGI_FORMAT_BC5_SNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_B5G6R5_UNORM) == static_cast<int>(DXGI_FORMAT_B5G6R5_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_B5G5R5A1_UNORM) == static_cast<int>(DXGI_FORMAT_B5G5R5A1_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_B8G8R8A8_UNORM) == static_cast<int>(DXGI_FORMAT_B8G8R8A8_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_B8G8R8X8_UNORM) == static_cast<int>(DXGI_FORMAT_B8G8R8X8_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_R10G10B10_XR_BIAS_A2_UNORM) == static_cast<int>(DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_B8G8R8A8_TYPELESS) == static_cast<int>(DXGI_FORMAT_B8G8R8A8_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_B8G8R8A8_UNORM_SRGB) == static_cast<int>(DXGI_FORMAT_B8G8R8A8_UNORM_SRGB), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_B8G8R8X8_TYPELESS) == static_cast<int>(DXGI_FORMAT_B8G8R8X8_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_B8G8R8X8_UNORM_SRGB) == static_cast<int>(DXGI_FORMAT_B8G8R8X8_UNORM_SRGB), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC6H_TYPELESS) == static_cast<int>(DXGI_FORMAT_BC6H_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC6H_UF16) == static_cast<int>(DXGI_FORMAT_BC6H_UF16), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC6H_SF16) == static_cast<int>(DXGI_FORMAT_BC6H_SF16), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC7_TYPELESS) == static_cast<int>(DXGI_FORMAT_BC7_TYPELESS), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC7_UNORM) == static_cast<int>(DXGI_FORMAT_BC7_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_BC7_UNORM_SRGB) == static_cast<int>(DXGI_FORMAT_BC7_UNORM_SRGB), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_AYUV) == static_cast<int>(DXGI_FORMAT_AYUV), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_Y410) == static_cast<int>(DXGI_FORMAT_Y410), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_Y416) == static_cast<int>(DXGI_FORMAT_Y416), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_NV12) == static_cast<int>(DXGI_FORMAT_NV12), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_P010) == static_cast<int>(DXGI_FORMAT_P010), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_P016) == static_cast<int>(DXGI_FORMAT_P016), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_420_OPAQUE) == static_cast<int>(DXGI_FORMAT_420_OPAQUE), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_YUY2) == static_cast<int>(DXGI_FORMAT_YUY2), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_Y210) == static_cast<int>(DXGI_FORMAT_Y210), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_Y216) == static_cast<int>(DXGI_FORMAT_Y216), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_NV11) == static_cast<int>(DXGI_FORMAT_NV11), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_AI44) == static_cast<int>(DXGI_FORMAT_AI44), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_IA44) == static_cast<int>(DXGI_FORMAT_IA44), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_P8) == static_cast<int>(DXGI_FORMAT_P8), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_A8P8) == static_cast<int>(DXGI_FORMAT_A8P8), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_FORMAT_B4G4R4A4_UNORM) == static_cast<int>(DXGI_FORMAT_B4G4R4A4_UNORM), "XG vs. DXGI mismatch");
static_assert(static_cast<int>(XG_RESOURCE_DIMENSION_TEXTURE1D) == static_cast<int>(TEX_DIMENSION_TEXTURE1D), "XG vs. Direct3D 11 mismatch");
static_assert(static_cast<int>(XG_RESOURCE_DIMENSION_TEXTURE2D) == static_cast<int>(TEX_DIMENSION_TEXTURE2D), "XG vs. Direct3D 11 mismatch");
static_assert(static_cast<int>(XG_RESOURCE_DIMENSION_TEXTURE3D) == static_cast<int>(TEX_DIMENSION_TEXTURE3D), "XG vs. Direct3D 11 mismatch");
static_assert(static_cast<int>(XG_RESOURCE_MISC_TEXTURECUBE) == static_cast<int>(TEX_MISC_TEXTURECUBE), "XG vs. Direct3D 11 mismatch");
//--------------------------------------------------------------------------------------
// Initialize memory
//--------------------------------------------------------------------------------------
XboxImage& XboxImage::operator= (XboxImage&& moveFrom) noexcept
{
if (this != &moveFrom)
{
Release();
dataSize = moveFrom.dataSize;
baseAlignment = moveFrom.baseAlignment;
tilemode = moveFrom.tilemode;
metadata = moveFrom.metadata;
memory = moveFrom.memory;
moveFrom.dataSize = 0;
moveFrom.baseAlignment = 0;
moveFrom.tilemode = c_XboxTileModeInvalid;
moveFrom.memory = nullptr;
}
return *this;
}
_Use_decl_annotations_
HRESULT XboxImage::Initialize(const XG_TEXTURE1D_DESC& desc, const XG_RESOURCE_LAYOUT& layout, uint32_t miscFlags2)
{
if (!layout.SizeBytes || !layout.BaseAlignmentBytes)
return E_INVALIDARG;
Release();
if (layout.SizeBytes > UINT32_MAX
|| layout.BaseAlignmentBytes > UINT32_MAX)
return E_FAIL;
memory = reinterpret_cast<uint8_t*>(_aligned_malloc(layout.SizeBytes, 16));
if (!memory)
return E_OUTOFMEMORY;
memset(memory, 0, layout.SizeBytes);
memset(&metadata, 0, sizeof(metadata));
metadata.width = desc.Width;
metadata.height = 1;
metadata.depth = 1;
metadata.arraySize = desc.ArraySize;
metadata.mipLevels = layout.MipLevels;
metadata.format = static_cast<DXGI_FORMAT>(desc.Format);
metadata.dimension = TEX_DIMENSION_TEXTURE1D;
metadata.miscFlags2 = miscFlags2;
dataSize = static_cast<uint32_t>(layout.SizeBytes);
baseAlignment = static_cast<uint32_t>(layout.BaseAlignmentBytes);
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
tilemode = desc.SwizzleMode;
#else
tilemode = desc.TileMode;
#endif
return S_OK;
}
_Use_decl_annotations_
HRESULT XboxImage::Initialize(const XG_TEXTURE2D_DESC& desc, const XG_RESOURCE_LAYOUT& layout, uint32_t miscFlags2)
{
if (!layout.SizeBytes || !layout.BaseAlignmentBytes)
return E_INVALIDARG;
Release();
if (layout.SizeBytes > UINT32_MAX
|| layout.BaseAlignmentBytes > UINT32_MAX)
return E_FAIL;
memory = reinterpret_cast<uint8_t*>(_aligned_malloc(layout.SizeBytes, 16));
if (!memory)
return E_OUTOFMEMORY;
memset(memory, 0, layout.SizeBytes);
memset(&metadata, 0, sizeof(metadata));
metadata.width = desc.Width;
metadata.height = desc.Height;
metadata.depth = 1;
metadata.arraySize = desc.ArraySize;
metadata.mipLevels = layout.MipLevels;
metadata.miscFlags = (desc.MiscFlags & XG_RESOURCE_MISC_TEXTURECUBE) ? TEX_MISC_TEXTURECUBE : 0;
metadata.format = static_cast<DXGI_FORMAT>(desc.Format);
metadata.dimension = TEX_DIMENSION_TEXTURE2D;
metadata.miscFlags2 = miscFlags2;
dataSize = static_cast<uint32_t>(layout.SizeBytes);
baseAlignment = static_cast<uint32_t>(layout.BaseAlignmentBytes);
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
tilemode = desc.SwizzleMode;
#else
tilemode = desc.TileMode;
#endif
return S_OK;
}
_Use_decl_annotations_
HRESULT XboxImage::Initialize(const XG_TEXTURE3D_DESC& desc, const XG_RESOURCE_LAYOUT& layout, uint32_t miscFlags2)
{
if (!layout.SizeBytes || !layout.BaseAlignmentBytes)
return E_INVALIDARG;
Release();
if (layout.SizeBytes > UINT32_MAX
|| layout.BaseAlignmentBytes > UINT32_MAX)
return E_FAIL;
memory = reinterpret_cast<uint8_t*>(_aligned_malloc(layout.SizeBytes, 16));
if (!memory)
return E_OUTOFMEMORY;
memset(memory, 0, layout.SizeBytes);
memset(&metadata, 0, sizeof(metadata));
metadata.width = desc.Width;
metadata.height = desc.Height;
metadata.depth = desc.Depth;
metadata.arraySize = 1;
metadata.mipLevels = layout.MipLevels;
metadata.format = static_cast<DXGI_FORMAT>(desc.Format);
metadata.dimension = TEX_DIMENSION_TEXTURE3D;
metadata.miscFlags2 = miscFlags2;
dataSize = static_cast<uint32_t>(layout.SizeBytes);
baseAlignment = static_cast<uint32_t>(layout.BaseAlignmentBytes);
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
tilemode = desc.SwizzleMode;
#else
tilemode = desc.TileMode;
#endif
return S_OK;
}
_Use_decl_annotations_
HRESULT XboxImage::Initialize(const DirectX::TexMetadata& mdata, XboxTileMode tm, uint32_t size, uint32_t alignment)
{
if (!size || !alignment || tm == c_XboxTileModeInvalid)
return E_INVALIDARG;
Release();
memory = reinterpret_cast<uint8_t*>(_aligned_malloc(size, 16));
if (!memory)
return E_OUTOFMEMORY;
memset(memory, 0, size);
metadata = mdata;
dataSize = size;
baseAlignment = alignment;
tilemode = tm;
return S_OK;
}
//--------------------------------------------------------------------------------------
// Release memory
//--------------------------------------------------------------------------------------
void XboxImage::Release()
{
if (memory)
{
_aligned_free(memory);
memory = nullptr;
}
}

View File

@ -0,0 +1,758 @@
//--------------------------------------------------------------------------------------
// File: DirectXTexXboxTile.cpp
//
// DirectXTex Auxilary functions for converting from linear to Xbox tiling
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//--------------------------------------------------------------------------------------
#include "DirectXTexP.h"
#include "DirectXTexXbox.h"
//#define VERBOSE
using Microsoft::WRL::ComPtr;
using namespace DirectX;
using namespace DirectX::Internal;
using namespace Xbox;
namespace
{
//----------------------------------------------------------------------------------
inline HRESULT TileByElement1D(
_In_reads_(nimages) const Image* const * images,
size_t nimages,
uint32_t level,
_In_ XGTextureAddressComputer* computer,
_In_ const XG_RESOURCE_LAYOUT& layout,
const XboxImage& xbox,
size_t bpp,
size_t w,
bool packed)
{
uint8_t* dptr = xbox.GetPointer();
const uint8_t* endPtr = dptr + layout.SizeBytes;
for (size_t item = 0; item < nimages; ++item)
{
const Image* img = images[item];
if (!img || !img->pixels)
return E_POINTER;
assert(img->width == images[0]->width);
assert(img->height == images[0]->height);
assert(img->rowPitch == images[0]->rowPitch);
assert(img->format == images[0]->format);
const uint8_t* sptr = img->pixels;
for (size_t x = 0; x < w; ++x)
{
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
UINT64 element = (packed) ? (x >> 1) : x;
size_t offset = computer->GetTexelElementOffsetBytes(0, level, element, 0, static_cast<uint32_t>(item), 0, nullptr);
#else
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, static_cast<uint32_t>(item), 0);
#endif
if (offset == size_t(-1))
return E_FAIL;
uint8_t* dest = dptr + offset;
if ((dest + bpp) > endPtr)
return E_FAIL;
memcpy(dest, sptr, bpp);
sptr += bpp;
if (packed)
++x;
}
}
return S_OK;
}
//----------------------------------------------------------------------------------
#ifdef VERBOSE
void DebugPrintDesc(const XG_TEXTURE1D_DESC& desc)
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"XG_TEXTURE1D_DESC = { %u, %u, %u, %u, %u, %u, %u, %u, %u, %u }\n",
desc.Width, desc.MipLevels, desc.ArraySize, desc.Format, desc.Usage, desc.BindFlags, desc.CPUAccessFlags, desc.MiscFlags,
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
desc.SwizzleMode,
#else
desc.TileMode,
#endif
desc.Pitch);
OutputDebugStringW(buff);
}
void DebugPrintDesc(const XG_TEXTURE2D_DESC& desc)
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"XG_TEXTURE2D_DESC = { %u, %u, %u, %u, %u, { %u, %u }, %u, %u, %u, %u, %u, %u }\n",
desc.Width, desc.Height, desc.MipLevels, desc.ArraySize, desc.Format, desc.SampleDesc.Count, desc.SampleDesc.Quality, desc.Usage, desc.BindFlags, desc.CPUAccessFlags, desc.MiscFlags,
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
desc.SwizzleMode,
#else
desc.TileMode,
#endif
desc.Pitch);
OutputDebugStringW(buff);
}
void DebugPrintDesc(const XG_TEXTURE3D_DESC& desc)
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"XG_TEXTURE3D_DESC = { %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u }\n",
desc.Width, desc.Height, desc.Depth, desc.MipLevels, desc.Format, desc.Usage, desc.BindFlags, desc.CPUAccessFlags, desc.MiscFlags,
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
desc.SwizzleMode,
#else
desc.TileMode,
#endif
desc.Pitch);
OutputDebugStringW(buff);
}
void DebugPrintLayout(const XG_RESOURCE_LAYOUT& layout)
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"Layout %u planes, %uD, %u mips, %llu size, %llu alignment\n", layout.Planes, layout.Dimension - 1, layout.MipLevels, layout.SizeBytes, layout.BaseAlignmentBytes);
OutputDebugStringW(buff);
for (size_t p = 0; p < layout.Planes; ++p)
{
auto& plane = layout.Plane[p];
swprintf_s(buff, L"Plane %zu: %u bpe, %llu size, %llu offset, %llu alignment\n", p, plane.BytesPerElement, plane.SizeBytes, plane.BaseOffsetBytes, plane.BaseAlignmentBytes);
OutputDebugStringW(buff);
for (size_t level = 0; level < layout.MipLevels; ++level)
{
auto& mip = plane.MipLayout[level];
swprintf_s(buff, L"\tLevel %zu: %llu size, %llu slice2D, %llu offset, %u alignment\n", level, mip.SizeBytes, mip.Slice2DSizeBytes, mip.OffsetBytes, mip.AlignmentBytes);
OutputDebugStringW(buff);
swprintf_s(buff, L"\t\t%u x %u x %u (padded %u x %u x %u)\n", mip.WidthElements, mip.HeightElements, mip.DepthOrArraySize,
mip.PaddedWidthElements, mip.PaddedHeightElements, mip.PaddedDepthOrArraySize);
OutputDebugStringW(buff);
swprintf_s(buff, L"\t\tpitch %u pixels (%u bytes)\n", mip.PitchPixels, mip.PitchBytes);
OutputDebugStringW(buff);
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
swprintf_s(buff, L"\t\t\t%u samples, %u swizzlemode\n", mip.SampleCount, mip.SwizzleMode);
#else
swprintf_s(buff, L"\t\t\t%u samples, %u tilemode\n", mip.SampleCount, mip.TileMode);
#endif
OutputDebugStringW(buff);
}
}
}
#endif
//-------------------------------------------------------------------------------------
// 1D Tiling
//-------------------------------------------------------------------------------------
HRESULT Tile1D(
_In_reads_(nimages) const Image** images,
size_t nimages,
uint32_t level,
_In_ XGTextureAddressComputer* computer,
const XG_RESOURCE_LAYOUT& layout,
const XboxImage& xbox)
{
if (!nimages || nimages > UINT32_MAX)
return E_INVALIDARG;
if (!images || !images[0] || !computer || !xbox.GetPointer())
return E_POINTER;
assert(layout.Planes == 1);
const DXGI_FORMAT format = images[0]->format;
assert(format == xbox.GetMetadata().format);
assert(!IsCompressed(format));
bool byelement = IsTypeless(format);
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
if (nimages > 1)
byelement = true;
#endif
if (IsPacked(format))
{
const size_t bpp = (BitsPerPixel(format) + 7) / 8;
// XG (XboxOne) incorrectly returns 2 instead of 4 here for layout.Plane[0].BytesPerElement
const size_t w = images[0]->width;
assert(((w + 1) / 2) == layout.Plane[0].MipLayout[level].WidthElements);
return TileByElement1D(images, nimages, level, computer, layout, xbox, bpp, w, true);
}
else if (byelement)
{
//--- Typeless is done with per-element copy ----------------------------------
const size_t bpp = (BitsPerPixel(format) + 7) / 8;
assert(bpp == layout.Plane[0].BytesPerElement);
const size_t w = images[0]->width;
assert(w == layout.Plane[0].MipLayout[level].WidthElements);
return TileByElement1D(images, nimages, level, computer, layout, xbox, bpp, w, false);
}
else
{
//--- Standard format handling ------------------------------------------------
auto& mip = layout.Plane[0].MipLayout[level];
const UINT32 tiledPixels = mip.PitchPixels * mip.PaddedDepthOrArraySize;
auto scanline = make_AlignedArrayXMVECTOR(images[0]->width + tiledPixels);
XMVECTOR* row = scanline.get();
XMVECTOR* tiled = row + images[0]->width;
#ifdef _DEBUG
memset(row, 0xCD, sizeof(XMVECTOR) * images[0]->width);
#endif
memset(tiled, 0, sizeof(XMVECTOR) * tiledPixels);
// Perform tiling
for (size_t item = 0; item < nimages; ++item)
{
const Image* img = images[item];
if (!img || !img->pixels)
return E_POINTER;
assert(img->width == images[0]->width);
assert(img->height == images[0]->height);
assert(img->rowPitch == images[0]->rowPitch);
assert(img->format == images[0]->format);
if (!LoadScanline(row, img->width, img->pixels, img->rowPitch, img->format))
return E_FAIL;
for (size_t x = 0; x < img->width; ++x)
{
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, static_cast<uint32_t>(item), 0, nullptr);
#else
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, static_cast<uint32_t>(item), 0);
#endif
if (offset == size_t(-1))
return E_FAIL;
assert(offset >= mip.OffsetBytes);
assert(offset < mip.OffsetBytes + mip.SizeBytes);
offset = (offset - mip.OffsetBytes) / layout.Plane[0].BytesPerElement;
assert(offset < tiledPixels);
tiled[offset] = row[x];
}
}
// Store tiled texture
assert(mip.OffsetBytes + mip.SizeBytes <= layout.SizeBytes);
if (!StoreScanline(xbox.GetPointer() + mip.OffsetBytes, mip.SizeBytes, xbox.GetMetadata().format, tiled, tiledPixels))
return E_FAIL;
}
return S_OK;
}
//-------------------------------------------------------------------------------------
// 2D Tiling
//-------------------------------------------------------------------------------------
HRESULT Tile2D(
_In_reads_(nimages) const Image** images,
size_t nimages,
uint32_t level,
_In_ XGTextureAddressComputer* computer,
const XboxImage& xbox)
{
if (!nimages || nimages > UINT32_MAX)
return E_INVALIDARG;
if (!images || !images[0] || !computer || !xbox.GetPointer())
return E_POINTER;
uint8_t* baseAddr = xbox.GetPointer();
const auto& metadata = xbox.GetMetadata();
for (size_t item = 0; item < nimages; ++item)
{
const Image* img = images[item];
if (!img || !img->pixels)
return E_POINTER;
assert(img->width == images[0]->width);
assert(img->height == images[0]->height);
assert(img->rowPitch == images[0]->rowPitch);
assert(img->format == images[0]->format);
HRESULT hr = computer->CopyIntoSubresource(
baseAddr,
0u,
metadata.CalculateSubresource(level, item),
img->pixels,
static_cast<UINT32>(img->rowPitch),
0u);
if (FAILED(hr))
{
return hr;
}
}
return S_OK;
}
//-------------------------------------------------------------------------------------
// 3D Tiling
//-------------------------------------------------------------------------------------
HRESULT Tile3D(
const Image& image,
uint32_t level,
_In_ XGTextureAddressComputer* computer,
const XboxImage& xbox)
{
if (!image.pixels || !computer || !xbox.GetPointer())
return E_POINTER;
uint8_t* baseAddr = xbox.GetPointer();
const auto& metadata = xbox.GetMetadata();
return computer->CopyIntoSubresource(
baseAddr,
0u,
metadata.CalculateSubresource(level, 0),
image.pixels,
static_cast<UINT32>(image.rowPitch),
static_cast<UINT32>(image.slicePitch));
}
}
//=====================================================================================
// Entry-points
//=====================================================================================
//-------------------------------------------------------------------------------------
// Tile image
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::Tile(
const DirectX::Image& srcImage,
XboxImage& xbox,
XboxTileMode mode)
{
if (!srcImage.pixels
|| srcImage.width > D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION
|| srcImage.height > D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION)
return E_INVALIDARG;
xbox.Release();
if (srcImage.format == DXGI_FORMAT_R1_UNORM
|| IsVideo(srcImage.format))
{
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
if (mode == c_XboxTileModeInvalid)
{
// If no specific tile mode is given, assume the optimal default
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
mode = XGComputeOptimalSwizzleMode(XG_RESOURCE_DIMENSION_TEXTURE2D, static_cast<XG_FORMAT>(srcImage.format),
static_cast<UINT>(srcImage.width), static_cast<UINT>(srcImage.height),
1, 1, XG_BIND_SHADER_RESOURCE);
#else
mode = XGComputeOptimalTileMode(XG_RESOURCE_DIMENSION_TEXTURE2D, static_cast<XG_FORMAT>(srcImage.format),
static_cast<UINT>(srcImage.width), static_cast<UINT>(srcImage.height),
1, 1, XG_BIND_SHADER_RESOURCE);
#endif
}
XG_TEXTURE2D_DESC desc = {};
desc.Width = static_cast<UINT>(srcImage.width);
desc.Height = static_cast<UINT>(srcImage.height);
desc.MipLevels = 1;
desc.ArraySize = 1;
desc.Format = static_cast<XG_FORMAT>(srcImage.format);
desc.SampleDesc.Count = 1;
desc.Usage = XG_USAGE_DEFAULT;
desc.BindFlags = XG_BIND_SHADER_RESOURCE;
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
desc.SwizzleMode = mode;
#else
desc.TileMode = mode;
#endif
ComPtr<XGTextureAddressComputer> computer;
HRESULT hr = XGCreateTexture2DComputer(&desc, computer.GetAddressOf());
if (FAILED(hr))
return hr;
XG_RESOURCE_LAYOUT layout;
hr = computer->GetResourceLayout(&layout);
if (FAILED(hr))
return hr;
if (layout.Planes != 1)
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
hr = xbox.Initialize(desc, layout);
if (FAILED(hr))
return hr;
const Image* images = &srcImage;
hr = Tile2D(&images, 1, 0, computer.Get(), xbox);
if (FAILED(hr))
{
xbox.Release();
return hr;
}
return S_OK;
}
//-------------------------------------------------------------------------------------
// Tile image (complex)
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT Xbox::Tile(
const DirectX::Image* srcImages,
size_t nimages,
const DirectX::TexMetadata& metadata,
XboxImage& xbox,
XboxTileMode mode)
{
if (!srcImages || !nimages || nimages > UINT32_MAX)
return E_INVALIDARG;
switch (metadata.dimension)
{
case TEX_DIMENSION_TEXTURE1D:
if (metadata.width > D3D11_REQ_TEXTURE1D_U_DIMENSION
|| metadata.mipLevels > D3D11_REQ_MIP_LEVELS
|| metadata.arraySize > D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION)
return E_INVALIDARG;
break;
case TEX_DIMENSION_TEXTURE2D:
if (metadata.width > D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION
|| metadata.height > D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION
|| metadata.mipLevels > D3D11_REQ_MIP_LEVELS
|| metadata.arraySize > D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION)
return E_INVALIDARG;
break;
case TEX_DIMENSION_TEXTURE3D:
if (metadata.width > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION
|| metadata.height > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION
|| metadata.depth > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION
|| metadata.mipLevels > D3D11_REQ_MIP_LEVELS
|| metadata.arraySize != 1)
return E_INVALIDARG;
break;
default:
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
xbox.Release();
if (metadata.format == DXGI_FORMAT_R1_UNORM
|| IsVideo(metadata.format))
{
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
switch (metadata.format)
{
case DXGI_FORMAT_R32G32B32_TYPELESS:
case DXGI_FORMAT_R32G32B32_FLOAT:
case DXGI_FORMAT_R32G32B32_UINT:
case DXGI_FORMAT_R32G32B32_SINT:
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
default:
break;
}
if (mode == c_XboxTileModeInvalid)
{
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
mode = XGComputeOptimalSwizzleMode(static_cast<XG_RESOURCE_DIMENSION>(metadata.dimension), static_cast<XG_FORMAT>(metadata.format),
static_cast<UINT>(metadata.width), static_cast<UINT>(metadata.height),
static_cast<UINT>((metadata.dimension == TEX_DIMENSION_TEXTURE3D) ? metadata.depth : metadata.arraySize),
1, XG_BIND_SHADER_RESOURCE);
#else
// If no specific tile mode is given, assume the optimal default
mode = XGComputeOptimalTileMode(static_cast<XG_RESOURCE_DIMENSION>(metadata.dimension), static_cast<XG_FORMAT>(metadata.format),
static_cast<UINT>(metadata.width), static_cast<UINT>(metadata.height),
static_cast<UINT>((metadata.dimension == TEX_DIMENSION_TEXTURE3D) ? metadata.depth : metadata.arraySize),
1, XG_BIND_SHADER_RESOURCE);
#endif
}
XG_RESOURCE_LAYOUT layout = {};
switch (metadata.dimension)
{
case TEX_DIMENSION_TEXTURE1D:
{
XG_TEXTURE1D_DESC desc = {};
desc.Width = static_cast<UINT>(metadata.width);
desc.MipLevels = static_cast<UINT>(metadata.mipLevels);
desc.ArraySize = static_cast<UINT>(metadata.arraySize);
desc.Format = static_cast<XG_FORMAT>(metadata.format);
desc.Usage = XG_USAGE_DEFAULT;
desc.BindFlags = XG_BIND_SHADER_RESOURCE;
desc.MiscFlags = (metadata.IsCubemap()) ? XG_RESOURCE_MISC_TEXTURECUBE : 0;
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
desc.SwizzleMode = mode;
#else
desc.TileMode = mode;
#endif
#ifdef VERBOSE
DebugPrintDesc(desc);
#endif
ComPtr<XGTextureAddressComputer> computer;
HRESULT hr = XGCreateTexture1DComputer(&desc, computer.GetAddressOf());
if (FAILED(hr))
return hr;
hr = computer->GetResourceLayout(&layout);
if (FAILED(hr))
return hr;
#ifdef VERBOSE
DebugPrintLayout(layout);
#endif
if (layout.Planes != 1)
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
hr = xbox.Initialize(desc, layout, metadata.miscFlags2);
if (FAILED(hr))
return hr;
for (size_t level = 0; level < metadata.mipLevels; ++level)
{
if (metadata.arraySize > 1)
{
std::vector<const Image*> images;
images.reserve(metadata.arraySize);
for (size_t item = 0; item < metadata.arraySize; ++item)
{
const size_t index = metadata.ComputeIndex(level, item, 0);
if (index >= nimages)
{
xbox.Release();
return E_FAIL;
}
images.push_back(&srcImages[index]);
}
hr = Tile1D(&images[0], images.size(), static_cast<uint32_t>(level), computer.Get(), layout, xbox);
}
else
{
const size_t index = metadata.ComputeIndex(level, 0, 0);
if (index >= nimages)
{
xbox.Release();
return E_FAIL;
}
const Image* images = &srcImages[index];
hr = Tile1D(&images, 1, static_cast<uint32_t>(level), computer.Get(), layout, xbox);
}
if (FAILED(hr))
{
xbox.Release();
return hr;
}
}
}
break;
case TEX_DIMENSION_TEXTURE2D:
{
XG_TEXTURE2D_DESC desc = {};
desc.Width = static_cast<UINT>(metadata.width);
desc.Height = static_cast<UINT>(metadata.height);
desc.MipLevels = static_cast<UINT>(metadata.mipLevels);
desc.ArraySize = static_cast<UINT>(metadata.arraySize);
desc.Format = static_cast<XG_FORMAT>(metadata.format);
desc.SampleDesc.Count = 1;
desc.Usage = XG_USAGE_DEFAULT;
desc.BindFlags = XG_BIND_SHADER_RESOURCE;
desc.MiscFlags = (metadata.miscFlags & TEX_MISC_TEXTURECUBE) ? XG_RESOURCE_MISC_TEXTURECUBE : 0;
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
desc.SwizzleMode = mode;
#else
desc.TileMode = mode;
#endif
#ifdef VERBOSE
DebugPrintDesc(desc);
#endif
ComPtr<XGTextureAddressComputer> computer;
HRESULT hr = XGCreateTexture2DComputer(&desc, computer.GetAddressOf());
if (FAILED(hr))
return hr;
hr = computer->GetResourceLayout(&layout);
if (FAILED(hr))
return hr;
#ifdef VERBOSE
DebugPrintLayout(layout);
#endif
if (layout.Planes != 1)
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
hr = xbox.Initialize(desc, layout, metadata.miscFlags2);
if (FAILED(hr))
return hr;
for (size_t level = 0; level < metadata.mipLevels; ++level)
{
if (metadata.arraySize > 1)
{
std::vector<const Image*> images;
images.reserve(metadata.arraySize);
for (size_t item = 0; item < metadata.arraySize; ++item)
{
const size_t index = metadata.ComputeIndex(level, item, 0);
if (index >= nimages)
{
xbox.Release();
return E_FAIL;
}
images.push_back(&srcImages[index]);
}
hr = Tile2D(&images[0], images.size(), static_cast<uint32_t>(level), computer.Get(), xbox);
}
else
{
const size_t index = metadata.ComputeIndex(level, 0, 0);
if (index >= nimages)
{
xbox.Release();
return E_FAIL;
}
const Image* images = &srcImages[index];
hr = Tile2D(&images, 1, static_cast<uint32_t>(level), computer.Get(), xbox);
}
if (FAILED(hr))
{
xbox.Release();
return hr;
}
}
}
break;
case TEX_DIMENSION_TEXTURE3D:
{
XG_TEXTURE3D_DESC desc = {};
desc.Width = static_cast<UINT>(metadata.width);
desc.Height = static_cast<UINT>(metadata.height);
desc.Depth = static_cast<UINT>(metadata.depth);
desc.MipLevels = static_cast<UINT>(metadata.mipLevels);
desc.Format = static_cast<XG_FORMAT>(metadata.format);
desc.Usage = XG_USAGE_DEFAULT;
desc.BindFlags = XG_BIND_SHADER_RESOURCE;
#if defined(_GAMING_XBOX_SCARLETT) || defined(_USE_SCARLETT)
desc.SwizzleMode = mode;
#else
desc.TileMode = mode;
#endif
#ifdef VERBOSE
DebugPrintDesc(desc);
#endif
ComPtr<XGTextureAddressComputer> computer;
HRESULT hr = XGCreateTexture3DComputer(&desc, computer.GetAddressOf());
if (FAILED(hr))
return hr;
hr = computer->GetResourceLayout(&layout);
if (FAILED(hr))
return hr;
#ifdef VERBOSE
DebugPrintLayout(layout);
#endif
if (layout.Planes != 1)
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
hr = xbox.Initialize(desc, layout, metadata.miscFlags2);
if (FAILED(hr))
return hr;
auto d = static_cast<uint32_t>(metadata.depth);
size_t index = 0;
for (size_t level = 0; level < metadata.mipLevels; ++level)
{
if ((index + d) > nimages)
{
xbox.Release();
return E_FAIL;
}
// Relies on the fact that slices are contiguous
hr = Tile3D(srcImages[index], static_cast<uint32_t>(level), computer.Get(), xbox);
if (FAILED(hr))
{
xbox.Release();
return hr;
}
index += d;
if (d > 1)
d >>= 1;
}
}
break;
default:
return E_FAIL;
}
return S_OK;
}

View File

@ -6,13 +6,141 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXT
## Release History
### July 9, 2025
* Reformat source using updated .editorconfig settings and general lint cleanup
* Minor code review
* CMake project updates
### March 24, 2025
* C++17 `std::byte` support for `FromMemory` functions
* Added **ComputeTileShape** method to compute Direct3D Tiled Resource standard dimensions
* Added *isd3d12* defaulted parameter to `IsPlaner` for change to depth/stencil formats
* DDS reader `DDS_FLAGS_PERMISSIVE` supports a DX10 variant with 'incorrect' cubemap counts
* Retired support for Windows 7 and Windows 8.0
* CMake project updates including support for BUILD_SHARED_LIBS (i.e. DLL vs. static library)
* texconv:
* Add `--ignore-srgb` switch which passes `TGA_FLAGS_IGNORE_SRGB` or `WIC_FLAGS_IGNORE_SRGB`
* Add `--wic-uncompressed` switch which applies to TIFF and HEIF
* Updates for `--wic-lossless` (JPEG-XR only) and `--wic-quality` (also applies to HEIF) switches
* The `--ignore-mips` switch now properly blocks use on array textures
* Remove 'heic' file extension for writing which is only supported for reading by *HEIF Image Extensions*
* Add support for 'phm' file extension to indicate Portable Half Map
### October 28, 2024
* All enums now use ``uint32_t`` as the underlying type rather than ``unsigned long`` or ``int``.
* Added **BytesPerBlock** utility helper
* Fixed bug in DirectX 12 `CaptureTexture` for MSAA resolve state handling
* texassemble, texconv, texdiag:
* Add "GNU-style" *--long-options* to the command-line tools (all existing switches are still supported)
* Fixed bug in texdiag's ``dumpdds`` command output filename extension handling
* Refactored code to use shared header
* CMake and MSBuild project updates
### 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
* CMake project updates
* Retired VS 2019 projects for the UWP platform
### March 6, 2024
* Xbox Auxiliary tiling/detiling code optimization
### February 21, 2024
* TGA reader now limited to 4 GB for maximum image size for security hardening
* Project updates for improved logging of shader compilation errors and GDK validation
* CMake project updates and refactor
* Minor code review for Clang, MinGW, and Intel compilers
* Auxiliary updated with LIBJPEG and LIBPNG implementations for use on WSL which lacks WIC
* texassemble: new ``from-mips`` command
* texconv: Updated to support Xbox extension functionality
### December 31, 2023
* TGA reader bug fix for offset boundary check
* PPM/PFM reader bug fixes for bounds checking
* Xbox-specific functionality added to Auxiliary folder
* CMake project updates including pkg-config file generation
* Code review
### October 28, 2023
* New ``DDS_PERMISSIVE_FLAG`` to allow reading of various DDS DX9 file variants
* *breaking change* required to accept reading *Unreal Tournament 2004* DDS files
* Allows cases where DDS_HEADER size is incorrectly set to 24
* Allows cases where DDPIXELFORMAT size is incorrectly set to 24
* Allows cases where DDS_HEADER.MipMapCount is set to the wrong value
* texassemble/texconv/texdiag: ``-flist`` option updated to support filenames with spaces
* texconv: ``-permissive`` switch added to opt-in use of new flag when reading DDS files
### September 1, 2023
* **CompressEx** and **ConvertEx** functions added with status callback and options structs
* Added optional ``DDSMetaData`` return for Ex versions of DDS loader functions
* Added ``TEX_ALPHA_WEIGHT_DEFAULT`` constant (set to 1.0)
* DDS reader updated to support variant used by *Unreal Tournament 2004*
* Fixed overvalidation bug with BC7 GPU compressor with SRGB formats
* Retired ARM (32-bit) support for the UWP platform
* CMake project updates
### June 13, 2023
* Added ``TEX_FILTER_RGB_COPY_ALPHA`` flag and support for ``DXGI_FORMAT_A4B4G4R4_UNORM``
* DDS loader now supports 'swizzled' DXT5 variant FourCCs
* CMake project updates
* texconv: Added ``-f BC3n``, ``-f DXT5nm``, and ``-f RXBG`` support; ``.ddx`` file extension; and ``-tgazeroalpha`` switch
* texassemble/texconv/texdiag: Fix minor display issue with error messages
* texassemble/texconv/texdiag: Supports Long Paths on Windows 10, Version 1607 or later
### April 28, 2023
* Updated D3DX12 internal copy with latest changes from DirectX-Headers GitHub
* CMake project updates and fixes for clang/LLVM v16 warnings
* texassemble/texconv/texdiag: Windows on ARM64 version
### March 30, 2023
* Fix for `SRGB_IN` / `SRGB_OUT` flag handling for GPU BC7 compressor
* Fix to clamp negative values when encoding with the GPU BC6H compressor
* GPU BC6H/BC7 encoder updated to make optional use of DirectCompute 5.0
* CMake project updates
* Code review
* Retired VS 2017 legacy Xbox One XDK projects
* texassemble/texconv/texdiag: Updated to support Windows or UNIX-style path separators
### January 31, 2023
* Fixed memory overwrite bug in **ConvertToSinglePlane** that can lead to a potential security issue for untrusted planar video format DDS files
* Make sure ScratchImage zero-fills image memory
* Fix DirectX12 GPU-validation warnings for texture loaders
* Minor fix for non-Win32 builds
* ddsview: Updated sample app with a ``-forcesrgb`` command-line switch
### December 15, 2022
* ARM/ARM64 platform fix for 16bpp pixel conversion
* Updated D3DX12 internal copy with latest changes from DirectX-Headers GitHub
* CMake project updated to require 3.20 or later
* CMake and MSBuild project updates
* Added Azure Dev Ops Pipeline YAML files
* ``Auxiliary`` folder added with DirectXEXR.h/.cpp optional module
* Test suite updated with CTest support
* Spectre-mitigated libraries added to NuGet packages
* texassemble: added commands *v-cross-fnz*, *h-tee*, and *cube-from-\**
* texconv: Fixed minor printf output issue
### October 17, 2022
* Minor fix for ``CompileShaders.cmd`` to address additional 'paths with spaces' issues
* Minor CMake and CMakePresets updates
* Code review
### July 29, 2022
* Added ``MakeLinear`` DXGI_FORMAT utility function.
* Added **MakeLinear** DXGI_FORMAT utility function.
* *breaking change* ``CreateTextureEx`` and ``CreateShaderResourceViewEx`` functions now use ``CREATETEX_FLAGS`` instead of a ``bool forceSRGB`` parameter.
* Updates for MinGW ABI fixes for DirectX12 in the latest DirectX-Headers.
* CMake and MSBuild project updates
@ -21,7 +149,7 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXT
### May 9, 2022
* TGA reader updated to support 24-bit paletted uncompressed color-mapped images (used by a DCC application)
* Added `IsBGR` utility method
* Added **IsBGR** utility method
* Workaround for driver issue on some systems using DirectX 11 `Capture` method
* Fix for problem with resizing/mipmaps generation for HDR content using box/fant filter which should avoid going through WIC code paths
* Minor updates for VS 2022 (17.2)
@ -42,6 +170,7 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXT
* Optional C++17 usage in a few places
### February 28, 2022
* Made **EncodeDDSHeader** a public function instead of being internal only
* Updated D3DX12 internal copy with latest changes from GitHub
* Code and project review including fixing clang v13 warnings
* Added CMakePresets.json
@ -109,7 +238,7 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXT
### August 15, 2020
* Added ``DDS_FLAGS_ALLOW_LARGE_FILES`` flag for DDS loader to allow textures with dimensions that are too big for Direct3D
* Added ``FormatDataType`` function
* Added **FormatDataType** function
* Fixed bug with DX12 ``Capture`` with 'small alignment' textures
* Code review and project updates
* Added GDK projects
@ -127,9 +256,9 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXT
### June 1, 2020
* Converted to typed enum bitmask flags (see release notes for details on this potential *breaking change*)
+ **ComputePitch**, **xxxDDSxxx**, **xxxWICxxx**, **FlipRotate**, **Resize**, **Convert**, **GenerateMipMaps**, **GenerateMipMaps3D**, **PremultiplyAlpha**, **Compress**, **ComputeNormalMap**, **CopyRectangle**, **ComputeMSE**
* **ComputePitch**, **xxxDDSxxx**, **xxxWICxxx**, **FlipRotate**, **Resize**, **Convert**, **GenerateMipMaps**, **GenerateMipMaps3D**, **PremultiplyAlpha**, **Compress**, **ComputeNormalMap**, **CopyRectangle**, **ComputeMSE**
* ``WIC_FLAGS_DEFAULT_SRGB`` / ``WIC_LOADER_SRGB_DEFAULT`` flag added when loading image via WIC without explicit colorspace metadata
* WIC loader for ``PNG`` codec now checks ``gAMA`` chunk to determine colorspace if the ``sRGB`` chunk is not found for legacy sRGB detection.
* WIC loader for ``PNG`` codec now checks ``gAMA`` chunk to determine colorspace if the ``sRGB`` chunk is not found for legacy sRGB detection.
* Fixed conformance issues when using ``/Zc:preprocessor``
* CMake project updates
@ -265,7 +394,7 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXT
### July 26, 2017
* Support for reading non-standard DDS files written by nVidia Texture Tools (NVTT)
* Fix for **ComputeMSE** when using ``CMSE_IMAGE2_X2_BIAS``
* Fix for WIC writer then codec target format requires a palette
* Fix for WIC writer then codec target format requires a palette
* Code cleanup
### April 24, 2017
@ -440,9 +569,9 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXT
### June 15, 2013
* Custom filtering implementation for **Resize** & **GenerateMipMaps(3D)** - Point, Box, Linear, Cubic, and Triangle
+ ``TEX_FILTER_TRIANGLE`` finite low-pass triangle filter
+ ``TEX_FILTER_WRAP``, ``TEX_FILTER_MIRROR`` texture semantics for custom filtering
+ ``TEX_FILTER_BOX`` alias for ``TEX_FILTER_FANT WIC``
* ``TEX_FILTER_TRIANGLE`` finite low-pass triangle filter
* ``TEX_FILTER_WRAP``, ``TEX_FILTER_MIRROR`` texture semantics for custom filtering
* ``TEX_FILTER_BOX`` alias for ``TEX_FILTER_FANT WIC``
* Ordered and error diffusion dithering for non-WIC conversion
* sRGB gamma correct custom filtering and conversion
* ``DDS_FLAGS_EXPAND_LUMINANCE`` - Reader conversion option for L8, L16, and A8L8 legacy DDS files

View File

@ -1,9 +1,13 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cmake_minimum_required (VERSION 3.13)
cmake_minimum_required (VERSION 3.20)
set(DIRECTXTEX_VERSION 1.9.7)
set(DIRECTXTEX_VERSION 2.0.8)
if(XBOX_CONSOLE_TARGET STREQUAL "durango")
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
endif()
project (DirectXTex
VERSION ${DIRECTXTEX_VERSION}
@ -11,12 +15,18 @@ project (DirectXTex
HOMEPAGE_URL "https://go.microsoft.com/fwlink/?LinkId=248926"
LANGUAGES CXX)
if(DEFINED XBOX_CONSOLE_TARGET)
set(CMAKE_CXX_STANDARD_LIBRARIES "")
endif()
option(BUILD_TOOLS "Build tex command-line tools" ON)
option(BUILD_SAMPLE "Build DDSView sample" ON)
option(BUILD_SHARED_LIBS "Build DirectXTex as a shared library" OFF)
option(BUILD_SAMPLE "Build DDSView sample (requires fxc.exe)" ON)
# Includes the functions for Direct3D 11 resources and DirectCompute compression
option(BUILD_DX11 "Build with DirectX11 Runtime support" ON)
option(BUILD_DX11 "Build with DirectX11 Runtime support (requires fxc.exe)" ON)
# Includes the functions for creating Direct3D 12 resources at runtime
option(BUILD_DX12 "Build with DirectX12 Runtime support" ON)
@ -24,34 +34,59 @@ option(BUILD_DX12 "Build with DirectX12 Runtime support" ON)
# Enable the use of OpenMP for software BC6H/BC7 compression
option(BC_USE_OPENMP "Build with OpenMP support" ON)
# Builds Xbox extensions for Host PC
option(BUILD_XBOX_EXTS_XBOXONE "Build Xbox library extensions for Xbox One" OFF)
option(BUILD_XBOX_EXTS_SCARLETT "Build Xbox library extensions for Xbox Series X|S" OFF)
# https://devblogs.microsoft.com/cppblog/spectre-mitigations-in-msvc/
option(ENABLE_SPECTRE_MITIGATION "Build using /Qspectre for MSVC" OFF)
option(DISABLE_MSVC_ITERATOR_DEBUGGING "Disable iterator debugging in Debug configurations with the MSVC CRT" OFF)
option(ENABLE_CODE_ANALYSIS "Use Static Code Analysis on build" OFF)
option(ENABLE_CODE_COVERAGE "Build with code-coverage" OFF)
option(USE_PREBUILT_SHADERS "Use externally built HLSL shaders" OFF)
option(NO_WCHAR_T "Use legacy wide-character as unsigned short" OFF)
option(BUILD_FUZZING "Build for fuzz testing" OFF)
# Includes the functions for loading/saving OpenEXR files at runtime
option(ENABLE_OPENEXR_SUPPORT "Build with OpenEXR support" OFF)
# See https://www.ijg.org/
option(ENABLE_LIBJPEG_SUPPORT "Build with libjpeg support" OFF)
# See http://www.libpng.org/pub/png/libpng.html
option(ENABLE_LIBPNG_SUPPORT "Build with libpng support" OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/CMake")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/CMake")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/CMake")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
if (DEFINED VCPKG_TARGET_ARCHITECTURE)
set(DIRECTX_ARCH ${VCPKG_TARGET_ARCHITECTURE})
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$")
set(DIRECTX_ARCH x86)
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Xx]64$")
set(DIRECTX_ARCH x64)
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$")
set(DIRECTX_ARCH arm)
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]64$")
set(DIRECTX_ARCH arm64)
if(WINDOWS_STORE OR (DEFINED XBOX_CONSOLE_TARGET))
set(BUILD_DX12 ON)
set(BUILD_TOOLS OFF)
set(BUILD_SAMPLE OFF)
endif()
if((DEFINED XBOX_CONSOLE_TARGET) AND (NOT (XBOX_CONSOLE_TARGET STREQUAL "durango")))
set(BUILD_DX11 OFF)
endif()
include(GNUInstallDirs)
include(build/CompilerAndLinker.cmake)
if((DEFINED DIRECTX_ARCH) AND (${DIRECTX_ARCH} STREQUAL "arm64ec"))
# OpenEXR doesn't support ARM64EC
set(ENABLE_OPENEXR_SUPPORT OFF)
endif()
#--- Library
set(LIBRARY_HEADERS
@ -81,40 +116,90 @@ set(LIBRARY_SOURCES
DirectXTex/DirectXTexUtil.cpp)
if(WIN32)
set(LIBRARY_SOURCES ${LIBRARY_SOURCES}
list(APPEND LIBRARY_SOURCES
DirectXTex/DirectXTexFlipRotate.cpp
DirectXTex/DirectXTexWIC.cpp)
endif()
set(SHADER_SOURCES
DirectXTex/Shaders/BC6HEncode.hlsl
DirectXTex/Shaders/BC7Encode.hlsl)
if(DEFINED XBOX_CONSOLE_TARGET)
if(BUILD_DX11 AND WIN32)
set(LIBRARY_SOURCES ${LIBRARY_SOURCES}
DirectXTex/BCDirectCompute.h
DirectXTex/BCDirectCompute.cpp
DirectXTex/DirectXTexCompressGPU.cpp
DirectXTex/DirectXTexD3D11.cpp)
list(APPEND LIBRARY_HEADERS Auxiliary/DirectXTexXbox.h)
list(APPEND LIBRARY_SOURCES
Auxiliary/DirectXTexXboxDDS.cpp
Auxiliary/DirectXTexXboxDetile.cpp
Auxiliary/DirectXTexXboxImage.cpp
Auxiliary/DirectXTexXboxTile.cpp)
if((XBOX_CONSOLE_TARGET STREQUAL "durango") AND BUILD_DX11)
list(APPEND LIBRARY_SOURCES Auxiliary/DirectXTexXboxD3D11X.cpp)
endif()
if(BUILD_DX12)
list(APPEND LIBRARY_SOURCES Auxiliary/DirectXTexXboxD3D12X.cpp)
endif()
elseif((BUILD_XBOX_EXTS_XBOXONE OR BUILD_XBOX_EXTS_SCARLETT) AND WIN32)
if(DEFINED ENV{GameDKLatest})
cmake_path(SET GameDK_DIR "$ENV{GameDKLatest}")
endif()
if(DEFINED ENV{XboxOneXDKLatest})
cmake_path(SET XboxOneXDK_DIR "$ENV{XboxOneXDKLatest}")
endif()
list(APPEND LIBRARY_HEADERS Auxiliary/DirectXTexXbox.h)
list(APPEND LIBRARY_SOURCES
Auxiliary/DirectXTexXboxDDS.cpp
Auxiliary/DirectXTexXboxDetile.cpp
Auxiliary/DirectXTexXboxImage.cpp
Auxiliary/DirectXTexXboxTile.cpp)
endif()
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)
set(LIBRARY_SOURCES ${LIBRARY_SOURCES}
DirectXTex/d3dx12.h
DirectXTex/DirectXTexD3D12.cpp)
list(APPEND LIBRARY_SOURCES DirectXTex/DirectXTexD3D12.cpp)
if(NOT (DEFINED XBOX_CONSOLE_TARGET))
list(APPEND LIBRARY_SOURCES Common/d3dx12.h)
endif()
endif()
if(ENABLE_OPENEXR_SUPPORT)
set(LIBRARY_HEADERS ${LIBRARY_HEADERS}
Auxiliary/DirectXTexEXR.h)
set(LIBRARY_SOURCES ${LIBRARY_SOURCES}
Auxiliary/DirectXTexEXR.cpp)
list(APPEND LIBRARY_HEADERS Auxiliary/DirectXTexEXR.h)
list(APPEND LIBRARY_SOURCES Auxiliary/DirectXTexEXR.cpp)
endif()
if(BUILD_DX11 AND WIN32)
if (NOT COMPILED_SHADERS)
if (USE_PREBUILT_SHADERS)
if(ENABLE_LIBJPEG_SUPPORT)
if(WIN32)
message(STATUS "Use of the Windows Imaging Component (WIC) instead of libjpeg is recommended.")
endif()
list(APPEND LIBRARY_HEADERS Auxiliary/DirectXTexJPEG.h)
list(APPEND LIBRARY_SOURCES Auxiliary/DirectXTexJPEG.cpp)
endif()
if(ENABLE_LIBPNG_SUPPORT)
if(WIN32)
message(STATUS "Use of the Windows Imaging Component (WIC) instead of libpng is recommended.")
endif()
list(APPEND LIBRARY_HEADERS Auxiliary/DirectXTexPNG.h)
list(APPEND LIBRARY_SOURCES Auxiliary/DirectXTexPNG.cpp)
endif()
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")
endif()
set(COMPILED_SHADERS ${CMAKE_CURRENT_BINARY_DIR}/Shaders/Compiled)
@ -123,22 +208,46 @@ if(BUILD_DX11 AND WIN32)
file(TO_CMAKE_PATH ${COMPILED_SHADERS} COMPILED_SHADERS)
endif()
set(LIBRARY_SOURCES ${LIBRARY_SOURCES}
${COMPILED_SHADERS}/BC6HEncode_EncodeBlockCS.inc)
list(APPEND LIBRARY_SOURCES ${COMPILED_SHADERS}/BC6HEncode_EncodeBlockCS.inc)
if (NOT USE_PREBUILT_SHADERS)
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}" $<$<BOOL:${DIRECTX_FXC_TOOL}>:LegacyShaderCompiler=${DIRECTX_FXC_TOOL}> CompileShaders.cmd > "${COMPILED_SHADERS}/compileshaders.log"
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/DirectXTex/Shaders"
USES_TERMINAL)
endif()
endif()
add_library(${PROJECT_NAME} STATIC ${LIBRARY_SOURCES} ${LIBRARY_HEADERS})
if(WIN32 AND BUILD_SHARED_LIBS)
message(STATUS "Build library as a DLL")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/build/DirectXTex.rc.in"
"${CMAKE_CURRENT_BINARY_DIR}/DirectXTex.rc" @ONLY)
add_library(${PROJECT_NAME} SHARED ${LIBRARY_SOURCES} ${LIBRARY_HEADERS} "${CMAKE_CURRENT_BINARY_DIR}/DirectXTex.rc")
target_compile_definitions(${PROJECT_NAME} PRIVATE DIRECTX_TEX_EXPORT)
target_compile_definitions(${PROJECT_NAME} INTERFACE DIRECTX_TEX_IMPORT)
if(XBOX_CONSOLE_TARGET MATCHES "scarlett")
target_link_libraries(${PROJECT_NAME} PRIVATE xgameplatform.lib xg_xs.lib xmem.lib)
elseif(XBOX_CONSOLE_TARGET MATCHES "xboxone")
target_link_libraries(${PROJECT_NAME} PRIVATE xgameplatform.lib xg_x.lib xmem.lib)
elseif(XBOX_CONSOLE_TARGET MATCHES "durango")
target_link_libraries(${PROJECT_NAME} PRIVATE kernelx.lib xg_x.lib combase.lib)
endif()
else()
add_library(${PROJECT_NAME} ${LIBRARY_SOURCES} ${LIBRARY_HEADERS})
endif()
if(BUILD_DX11 AND WIN32)
target_include_directories(${PROJECT_NAME} PRIVATE ${COMPILED_SHADERS})
@ -152,33 +261,108 @@ target_include_directories(${PROJECT_NAME} PUBLIC
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11)
if(ENABLE_OPENEXR_SUPPORT)
find_package(OpenEXR REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenEXR::OpenEXR)
if(BC_USE_OPENMP)
find_package(OpenMP)
if(OpenMP_CXX_FOUND)
target_link_libraries(${PROJECT_NAME} PUBLIC OpenMP::OpenMP_CXX)
else()
set(BC_USE_OPENMP OFF)
endif()
endif()
if ((${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16") AND (NOT MINGW))
if(ENABLE_OPENEXR_SUPPORT)
find_package(OpenEXR REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC OpenEXR::OpenEXR)
endif()
if(BUILD_XBOX_EXTS_SCARLETT AND WIN32)
if(EXISTS "${GameDK_DIR}/GXDK/toolKit/include/gxdk.h")
message(STATUS "Building Xbox extensions for Xbox Series X|S")
add_library(Xbox::GDKX SHARED IMPORTED)
set_target_properties(Xbox::GDKX PROPERTIES
IMPORTED_LOCATION "${GameDK_DIR}/GXDK/bin/Scarlett/xg_xs.dll"
IMPORTED_IMPLIB "${GameDK_DIR}/GXDK/toolKit/lib/amd64/Scarlett/xg_xs.lib"
MAP_IMPORTED_CONFIG_MINSIZEREL ""
MAP_IMPORTED_CONFIG_RELWITHDEBINFO ""
INTERFACE_COMPILE_DEFINITIONS "_USE_GXDK;_USE_SCARLETT"
INTERFACE_INCLUDE_DIRECTORIES "${GameDK_DIR}/GXDK/toolKit/include;${GameDK_DIR}/GXDK/toolKit/include/Scarlett")
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_XBOX_EXTS)
target_link_libraries(${PROJECT_NAME} PUBLIC Xbox::GDKX)
else()
message(FATAL_ERROR "Building Xbox extensions requires GameDKLatest")
endif()
elseif(BUILD_XBOX_EXTS_XBOXONE AND WIN32)
if(EXISTS "${GameDK_DIR}/GXDK/toolKit/include/gxdk.h")
message(STATUS "Building Xbox extensions for XboxOne using the Microsoft GDK")
add_library(Xbox::GDKX SHARED IMPORTED)
set_target_properties(Xbox::GDKX PROPERTIES
IMPORTED_LOCATION "${GameDK_DIR}/GXDK/bin/XboxOne/xg.dll"
IMPORTED_IMPLIB "${GameDK_DIR}/GXDK/toolKit/lib/amd64/XboxOne/xg.lib"
MAP_IMPORTED_CONFIG_MINSIZEREL ""
MAP_IMPORTED_CONFIG_RELWITHDEBINFO ""
INTERFACE_COMPILE_DEFINITIONS "_USE_GXDK"
INTERFACE_INCLUDE_DIRECTORIES "${GameDK_DIR}/GXDK/toolKit/include;${GameDK_DIR}/GXDK/toolKit/include/XboxOne")
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_XBOX_EXTS)
target_link_libraries(${PROJECT_NAME} PUBLIC Xbox::GDKX)
elseif(EXISTS "${XboxOneXDK_DIR}/PC/include/xdk.h")
message(STATUS "Building Xbox extensions for XboxOne using the Xbox One XDK")
add_library(Xbox::XDK SHARED IMPORTED)
set_target_properties(Xbox::XDK PROPERTIES
IMPORTED_LOCATION "${XboxOneXDK_DIR}/bin/xg.dll"
IMPORTED_IMPLIB "${XboxOneXDK_DIR}/PC/lib/amd64/xg.lib"
MAP_IMPORTED_CONFIG_MINSIZEREL ""
MAP_IMPORTED_CONFIG_RELWITHDEBINFO ""
INTERFACE_INCLUDE_DIRECTORIES "${XboxOneXDK_DIR}/PC/include")
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_XBOX_EXTS)
target_link_libraries(${PROJECT_NAME} PUBLIC Xbox::XDK)
else()
message(FATAL_ERROR "Building Xbox extensions requires GameDKLatest or XboxOneXDKLatest")
endif()
endif()
if(ENABLE_LIBJPEG_SUPPORT)
find_package(JPEG REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC JPEG::JPEG)
endif()
if(ENABLE_LIBPNG_SUPPORT)
find_package(PNG REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC PNG::PNG)
endif()
if(NOT MINGW)
target_precompile_headers(${PROJECT_NAME} PRIVATE DirectXTex/DirectXTexP.h)
endif()
if(MSVC)
# Use max Warning Level
string(REPLACE "/W3 " "/Wall " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "/W3 " "/Wall " CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
string(REPLACE "/W3 " "/Wall " CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
if(MINGW OR (NOT WIN32))
find_package(directxmath CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectXMath)
# Not using typeid or dynamic_cast, so disable RTTI to save binary size
string(REPLACE "/GR " "/GR- " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "/GR " "/GR- " CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
string(REPLACE "/GR " "/GR- " CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
find_package(directx-headers CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectX-Headers)
target_compile_definitions(${PROJECT_NAME} PUBLIC USING_DIRECTX_HEADERS)
else()
find_package(directxmath CONFIG QUIET)
find_package(directx-headers CONFIG QUIET)
endif()
if (MINGW OR (NOT WIN32) OR VCPKG_TOOLCHAIN)
message("INFO: Using VCPKG for DirectX-Headers and DirectXMath.")
find_package(directx-headers CONFIG REQUIRED)
find_package(directxmath CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectX-Headers Microsoft::DirectXMath)
if(directxmath_FOUND)
message(STATUS "Using DirectXMath package")
target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectXMath)
endif()
if(directx-headers_FOUND)
message(STATUS "Using DirectX-Headers package")
target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectX-Headers)
target_compile_definitions(${PROJECT_NAME} PRIVATE USING_DIRECTX_HEADERS)
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CXX_COMPILER_ID:MSVC,Intel>:/wd4062> $<$<CXX_COMPILER_ID:Clang,IntelLLVM>:-Wno-switch-enum>)
endif()
#--- Package
@ -197,7 +381,7 @@ install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/.nuget/${PROJECT_NAME}-config.cmake.in
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/build/${PROJECT_NAME}-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME})
@ -214,200 +398,308 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME})
#--- Command-line tools
if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE))
set(TOOL_EXES texassemble texconv texdiag)
# Create pkg-config file
include(build/JoinPaths.cmake)
# from: https://github.com/jtojnar/cmake-snips#concatenating-paths-when-building-pkg-config-files
join_paths(DIRECTXTEX_INCLUDEDIR_FOR_PKG_CONFIG "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
join_paths(DIRECTXTEX_LIBDIR_FOR_PKG_CONFIG "\${prefix}" "${CMAKE_INSTALL_LIBDIR}")
set(DIRECTXTEX_DEP_L "")
if(ENABLE_OPENEXR_SUPPORT)
list(APPEND DIRECTXTEX_DEP_L "OpenEXR")
endif()
if(directxmath_FOUND)
list(APPEND DIRECTXTEX_DEP_L "DirectXMath")
endif()
if(directx-headers_FOUND)
list(APPEND DIRECTXTEX_DEP_L "DirectX-Headers")
endif()
if(ENABLE_LIBJPEG_SUPPORT AND JPEG_FOUND)
list(APPEND DIRECTXTEX_DEP_L "libjpeg")
endif()
if(ENABLE_LIBPNG_SUPPORT AND PNG_FOUND)
list(APPEND DIRECTXTEX_DEP_L "libpng")
endif()
list(LENGTH DIRECTXTEX_DEP_L DEP_L)
if(DEP_L)
STRING(REPLACE ";" ", " DIRECTXTEX_DEP " ${DIRECTXTEX_DEP_L}")
endif()
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/build/DirectXTex.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/DirectXTex.pc" @ONLY)
# Install the pkg-config file
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/DirectXTex.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
#--- Command-line tools
set(TOOL_EXES "")
if(BUILD_TOOLS AND WIN32)
add_executable(texassemble
Texassemble/texassemble.cpp
Texassemble/texassemble.rc
Common/CmdLineHelpers.h
Common/settings.manifest
Texassemble/AnimatedGif.cpp)
target_link_libraries(texassemble ${PROJECT_NAME} ole32.lib version.lib)
target_compile_features(texassemble PRIVATE cxx_std_17)
target_link_libraries(texassemble PRIVATE ${PROJECT_NAME} ole32.lib version.lib)
source_group(texassemble REGULAR_EXPRESSION Texassemble/*.*)
list(APPEND TOOL_EXES texassemble)
endif()
if(BUILD_TOOLS AND BUILD_DX11 AND WIN32)
add_executable(texconv
Texconv/texconv.cpp
Texconv/texconv.rc
Common/CmdLineHelpers.h
Common/settings.manifest
Texconv/ExtendedBMP.cpp
Texconv/PortablePixMap.cpp)
target_link_libraries(texconv ${PROJECT_NAME} ole32.lib shell32.lib version.lib)
target_compile_features(texconv PRIVATE cxx_std_17)
target_link_libraries(texconv PRIVATE ${PROJECT_NAME} ole32.lib shell32.lib version.lib)
source_group(texconv REGULAR_EXPRESSION Texconv/*.*)
list(APPEND TOOL_EXES texconv)
endif()
if(BUILD_TOOLS AND WIN32)
add_executable(texdiag
Texdiag/texdiag.cpp
Texdiag/texdiag.rc)
target_link_libraries(texdiag ${PROJECT_NAME} ole32.lib version.lib)
Texdiag/texdiag.rc
Common/CmdLineHelpers.h
Common/settings.manifest)
target_compile_features(texdiag PRIVATE cxx_std_17)
target_link_libraries(texdiag PRIVATE ${PROJECT_NAME} ole32.lib version.lib)
source_group(texdiag REGULAR_EXPRESSION Texdiag/*.*)
list(APPEND TOOL_EXES texdiag)
endif()
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_include_directories(${t} PRIVATE Common)
endforeach()
if(BUILD_TOOLS AND WIN32)
if(ENABLE_OPENEXR_SUPPORT)
foreach(t IN LISTS TOOL_EXES)
target_include_directories(${t} PRIVATE Auxiliary)
target_link_libraries(${t} ${OPENEXR_ILMIMF_LIBRARY})
target_compile_options(${t} PRIVATE -DUSE_OPENEXR)
target_link_libraries(${t} PRIVATE ${OPENEXR_ILMIMF_LIBRARY})
target_compile_definitions(${t} PRIVATE USE_OPENEXR)
endforeach()
endif()
if(ENABLE_LIBJPEG_SUPPORT)
foreach(t IN LISTS TOOL_EXES)
target_include_directories(${t} PRIVATE Auxiliary)
target_link_libraries(${t} PRIVATE JPEG::JPEG)
target_compile_definitions(${t} PRIVATE USE_LIBJPEG)
endforeach()
endif()
if(ENABLE_LIBPNG_SUPPORT)
foreach(t IN LISTS TOOL_EXES)
target_include_directories(${t} PRIVATE Auxiliary)
target_link_libraries(${t} PRIVATE PNG::PNG)
target_compile_definitions(${t} PRIVATE USE_LIBPNG)
endforeach()
endif()
if(BUILD_XBOX_EXTS_SCARLETT OR BUILD_XBOX_EXTS_XBOXONE)
target_include_directories(texconv PRIVATE Auxiliary)
target_compile_definitions(texconv PRIVATE USE_XBOX_EXTS)
target_link_libraries(texconv PUBLIC $<TARGET_NAME_IF_EXISTS:Xbox::GDKX> $<TARGET_NAME_IF_EXISTS:Xbox::XDK>)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.21")
add_custom_command(TARGET texconv POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_RUNTIME_DLLS:texconv> $<TARGET_FILE_DIR:texconv>
COMMAND_EXPAND_LISTS
)
endif()
endif()
endif()
#--- DDSView sample
if(BUILD_SAMPLE AND BUILD_DX11 AND WIN32 AND (NOT WINDOWS_STORE))
if(BUILD_SAMPLE AND BUILD_DX11 AND WIN32)
list(APPEND TOOL_EXES ddsview)
if (NOT COMPILED_DDSVIEW_SHADERS)
if (USE_PREBUILT_SHADERS)
message(FATAL_ERROR "ERROR: Using prebuilt shaders requires the COMPILED_DDSVIEW_SHADERS variable is set")
endif()
set(COMPILED_DDSVIEW_SHADERS ${CMAKE_CURRENT_BINARY_DIR}/Shaders/Compiled)
file(MAKE_DIRECTORY ${COMPILED_DDSVIEW_SHADERS})
else()
file(TO_CMAKE_PATH ${COMPILED_DDSVIEW_SHADERS} COMPILED_DDSVIEW_SHADERS)
endif()
add_executable(ddsview WIN32
DDSView/ddsview.cpp
DDSView/ddsview.rc
${COMPILED_DDSVIEW_SHADERS}/ddsview_ps1D.inc)
target_link_libraries(ddsview ${PROJECT_NAME} d3d11.lib ole32.lib)
${COMPILED_SHADERS}/ddsview_ps1D.inc)
target_link_libraries(ddsview PRIVATE ${PROJECT_NAME} d3d11.lib ole32.lib)
source_group(ddsview REGULAR_EXPRESSION DDSView/*.*)
target_include_directories(ddsview PRIVATE ${COMPILED_DDSVIEW_SHADERS})
target_include_directories(ddsview PRIVATE ${COMPILED_SHADERS})
if (NOT USE_PREBUILT_SHADERS)
if(NOT USE_PREBUILT_SHADERS)
add_custom_command(
OUTPUT "${COMPILED_DDSVIEW_SHADERS}/ddsview_ps1D.inc"
OUTPUT "${COMPILED_SHADERS}/ddsview_ps1D.inc"
MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/DDSView/hlsl.cmd"
DEPENDS "${PROJECT_SOURCE_DIR}/DDSView/ddsview.fx"
DEPENDS "DDSView/ddsview.hlsl"
COMMENT "Generating HLSL shaders for DDSView..."
COMMAND COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_DDSVIEW_SHADERS}" hlsl.cmd > "${COMPILED_DDSVIEW_SHADERS}/hlsl.log"
COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_SHADERS}" $<$<BOOL:${DIRECTX_FXC_TOOL}>:LegacyShaderCompiler=${DIRECTX_FXC_TOOL}> hlsl.cmd > "${COMPILED_SHADERS}/hlsl_ddsview.log"
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/DDSView"
USES_TERMINAL)
endif()
endif()
if (MINGW OR (NOT WIN32) OR VCPKG_TOOLCHAIN)
if(directxmath_FOUND)
foreach(t IN LISTS TOOL_EXES)
target_link_libraries(${t} Microsoft::DirectXMath)
target_link_libraries(${t} PRIVATE Microsoft::DirectXMath)
endforeach()
endif()
if(TOOL_EXES)
message(STATUS "Building tools: ${TOOL_EXES}")
endif()
if(MSVC)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE /fp:fast "$<$<NOT:$<CONFIG:DEBUG>>:/guard:cf>")
target_link_options(${t} PRIVATE /DYNAMICBASE /NXCOMPAT)
target_compile_options(${t} PRIVATE /Wall /GR-)
endforeach()
if((${CMAKE_SIZEOF_VOID_P} EQUAL 4) AND (NOT ${DIRECTX_ARCH} MATCHES "^arm"))
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_link_options(${t} PRIVATE /SAFESEH)
endforeach()
endif()
if((MSVC_VERSION GREATER_EQUAL 1928) AND (CMAKE_SIZEOF_VOID_P EQUAL 8)
AND NOT ENABLE_OPENEXR_SUPPORT
AND ((NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)))
if(NO_WCHAR_T)
message(STATUS "Using non-native wchar_t as unsigned short")
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_link_options(${t} PRIVATE "$<$<NOT:$<CONFIG:DEBUG>>:/guard:ehcont>")
target_compile_options(${t} PRIVATE "/Zc:wchar_t-")
endforeach()
endif()
endif()
if(NOT ${DIRECTX_ARCH} MATCHES "^arm")
if (${CMAKE_SIZEOF_VOID_P} EQUAL "4")
set(ARCH_SSE2 $<$<CXX_COMPILER_ID:MSVC>:/arch:SSE2> $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse2>)
else()
set(ARCH_SSE2 $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse2>)
endif()
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_definitions(${t} PRIVATE ${COMPILER_DEFINES})
target_compile_options(${t} PRIVATE ${COMPILER_SWITCHES})
target_link_options(${t} PRIVATE ${LINKER_SWITCHES})
endforeach()
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE ${ARCH_SSE2})
endforeach()
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM")
set(WarningsLib -Wall -Wpedantic -Wextra)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(WarningsLib "-Wpedantic" "-Wextra")
target_compile_options(${PROJECT_NAME} PRIVATE ${WarningsLib})
# OpenMP is not supported for clang for Windows by default
set(WarningsEXE ${WarningsLib} "-Wno-c++98-compat" "-Wno-c++98-compat-pedantic" "-Wno-switch" "-Wno-switch-enum" "-Wno-covered-switch-default" "-Wno-language-extension-token" "-Wno-missing-prototypes" "-Wno-global-constructors" "-Wno-double-promotion")
foreach(t IN LISTS TOOL_EXES)
target_compile_options(${t} PRIVATE ${WarningsEXE})
endforeach()
endif()
if(MINGW)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE -Wno-ignored-attributes)
target_link_options(${t} PRIVATE -municode)
endforeach()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE /sdl /permissive- /JMC- /Zc:__cplusplus)
endforeach()
if(ENABLE_CODE_ANALYSIS)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE /analyze)
endforeach()
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.24)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE /ZH:SHA_256)
endforeach()
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE /Zc:preprocessor /wd5105)
endforeach()
endif()
if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm")))
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_link_options(${t} PRIVATE /CETCOMPAT)
endforeach()
endif()
if(BC_USE_OPENMP)
target_compile_options(${PROJECT_NAME} PRIVATE /openmp /Zc:twoPhase-)
if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE))
target_compile_options(texconv PRIVATE /openmp /Zc:twoPhase-)
if((BUILD_XBOX_EXTS_XBOXONE OR BUILD_XBOX_EXTS_SCARLETT) AND WIN32)
list(APPEND WarningsLib "-Wno-microsoft-enum-value" "-Wno-non-virtual-dtor" "-Wno-ignored-pragmas" "-Wno-deprecated-dynamic-exception-spec")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
list(APPEND WarningsLib "-Wno-reserved-identifier")
endif()
endif()
set(WarningsEXE "/wd4061" "/wd4062" "/wd4365" "/wd4514" "/wd4625" "/wd4626" "/wd4627" "/wd4668" "/wd4710" "/wd4751" "/wd4820" "/wd5026" "/wd5027" "/wd5039" "/wd5045" "/wd5219")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
list(APPEND WarningsEXE "/wd5262" "/wd5264")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
list(APPEND WarningsLib "-Wno-unsafe-buffer-usage")
endif()
target_compile_options(${PROJECT_NAME} PRIVATE ${WarningsLib})
set(WarningsEXE ${WarningsLib} "-Wno-c++98-compat" "-Wno-c++98-compat-pedantic" "-Wno-switch" "-Wno-switch-enum" "-Wno-switch-default" "-Wno-covered-switch-default" "-Wno-language-extension-token" "-Wno-missing-prototypes" "-Wno-global-constructors" "-Wno-double-promotion")
foreach(t IN LISTS TOOL_EXES)
target_compile_options(${t} PRIVATE ${WarningsEXE})
endforeach()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE "-Wno-ignored-attributes" "-Walloc-size-larger-than=4GB")
if(BUILD_SHARED_LIBS)
target_compile_options(${t} PRIVATE "-Wno-attributes")
endif()
endforeach()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.37)
AND (NOT (${DIRECTX_ARCH} MATCHES "^arm"))
AND ((${DIRECTX_ARCH} STREQUAL "x64") OR (CMAKE_SIZEOF_VOID_P EQUAL 8)))
# Enable since DirectXTex library has a lot of large switch statements
target_compile_options(${PROJECT_NAME} PRIVATE /jumptablerdata)
endif()
if(ENABLE_CODE_ANALYSIS)
message(STATUS "Building with Code Analysis (PREFIX)")
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE /analyze /WX)
endforeach()
endif()
if(ENABLE_SPECTRE_MITIGATION
AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.13)
AND (NOT ENABLE_OPENEXR_SUPPORT)
AND (NOT WINDOWS_STORE))
message(STATUS "Building Spectre-mitigated libraries")
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE "/Qspectre")
endforeach()
endif()
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26)
AND BUILD_XBOX_EXTS_XBOXONE)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE /wd5104 /wd5204)
endforeach()
endif()
set(WarningsEXE "/wd4061" "/wd4062" "/wd4365" "/wd4514" "/wd4571" "/wd4625" "/wd4626" "/wd4627" "/wd4668" "/wd4710" "/wd4711" "/wd4751" "/wd4774" "/wd4820" "/wd5026" "/wd5027" "/wd5039" "/wd5045" "/wd5219")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
list(APPEND WarningsEXE "/wd5262" "/wd5264")
endif()
foreach(t IN LISTS TOOL_EXES)
target_compile_options(${t} PRIVATE ${WarningsEXE})
endforeach()
if(BUILD_FUZZING AND (NOT WINDOWS_STORE))
string(REPLACE "/DNDEBUG" "" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
string(REPLACE "/DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.32)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE ${ASAN_SWITCHES})
target_link_libraries(${t} PRIVATE ${ASAN_LIBS})
endforeach()
endif()
endif()
endif()
if(WIN32)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_definitions(${t} PRIVATE _UNICODE UNICODE)
endforeach()
if(WINDOWS_STORE)
target_compile_definitions(${PROJECT_NAME} PRIVATE WINAPI_FAMILY=WINAPI_FAMILY_APP)
endif()
if(BUILD_DX12 OR WINDOWS_STORE)
if(BUILD_DX12)
message("INFO: Building with DirectX 12 Runtime support")
endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE _WIN32_WINNT=0x0A00)
if(XBOX_CONSOLE_TARGET STREQUAL "durango")
set(WINVER 0x0602)
elseif(BUILD_DX12 OR (${DIRECTX_ARCH} MATCHES "^arm64"))
message(STATUS "Building with DirectX 12 Runtime support")
set(WINVER 0x0A00)
elseif(${DIRECTX_ARCH} MATCHES "^arm")
set(WINVER 0x0602)
else()
message("INFO: Building with Windows 7 compatibility")
target_compile_definitions(${PROJECT_NAME} PRIVATE _WIN32_WINNT=0x0601 _WIN7_PLATFORM_UPDATE)
message(STATUS "Building with Windows 8.1 compatibility")
set(WINVER 0x0603)
endif()
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_definitions(${t} PRIVATE _WIN32_WINNT=${WINVER})
endforeach()
if(DISABLE_MSVC_ITERATOR_DEBUGGING)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_definitions(${t} PRIVATE _ITERATOR_DEBUG_LEVEL=0)
endforeach()
endif()
endif()
if(BUILD_TOOLS AND BUILD_DX11 AND WIN32)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT texconv)
endif()
if(BUILD_TOOLS AND (NOT VCPKG_TOOLCHAIN))
foreach(t IN LISTS TOOL_EXES)
target_compile_definitions(${t} PRIVATE _WIN32_WINNT=0x0601)
install(TARGETS ${t} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach()
endif()
if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE))
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT texconv)
#--- Test suite
if(WIN32 AND (NOT WINDOWS_STORE) AND (NOT (DEFINED XBOX_CONSOLE_TARGET)))
include(CTest)
if(BUILD_TESTING AND (EXISTS "${CMAKE_CURRENT_LIST_DIR}/Tests/CMakeLists.txt"))
enable_testing()
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/Tests)
if(ENABLE_CODE_COVERAGE AND (DEFINED COV_COMPILER_SWITCHES))
target_compile_options(${PROJECT_NAME} PRIVATE ${COV_COMPILER_SWITCHES})
endif()
elseif(BUILD_FUZZING AND (EXISTS "${CMAKE_CURRENT_LIST_DIR}/Tests/fuzzloaders/CMakeLists.txt"))
message(STATUS "Building for fuzzing")
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/Tests/fuzzloaders)
endif()
endif()

View File

@ -29,15 +29,6 @@
"cacheVariables": { "DIRECTX_ARCH": "x86" },
"hidden": true
},
{
"name": "ARM",
"architecture": {
"value": "arm",
"strategy": "external"
},
"cacheVariables": { "DIRECTX_ARCH": "arm" },
"hidden": true
},
{
"name": "ARM64",
"architecture": {
@ -47,6 +38,19 @@
"cacheVariables": { "DIRECTX_ARCH": "arm64" },
"hidden": true
},
{
"name": "ARM64EC",
"architecture": {
"value": "arm64ec",
"strategy": "external"
},
"cacheVariables": { "DIRECTX_ARCH": "arm64ec" },
"environment": {
"CFLAGS": "/arm64EC",
"CXXFLAGS": "/arm64EC"
},
"hidden": true
},
{
"name": "Debug",
@ -55,7 +59,11 @@
},
{
"name": "Release",
"cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" },
"cacheVariables":
{
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_INTERPROCEDURAL_OPTIMIZATION": true
},
"hidden": true
},
@ -81,6 +89,22 @@
"strategy": "external"
}
},
{
"name": "Clang-X86",
"environment": {
"CFLAGS": "-m32",
"CXXFLAGS": "-m32"
},
"hidden": true
},
{
"name": "Clang-AArch64",
"environment": {
"CFLAGS": "--target=arm64-pc-windows-msvc",
"CXXFLAGS": "--target=arm64-pc-windows-msvc"
},
"hidden": true
},
{
"name": "GNUC",
"hidden": true,
@ -94,12 +118,39 @@
},
{
"name": "Win7",
"name": "Win8",
"cacheVariables": {
"BUILD_DX12": false
},
"hidden": true
},
{
"name": "GDKX",
"cacheVariables": {
"BUILD_XBOX_EXTS_XBOXONE": true
},
"environment": {
"XboxOneXDKLatest": ""
},
"hidden": true
},
{
"name": "GDKXS",
"cacheVariables": {
"BUILD_XBOX_EXTS_SCARLETT": true
},
"hidden": true
},
{
"name": "XDK",
"cacheVariables": {
"BUILD_XBOX_EXTS_XBOXONE": true
},
"environment": {
"GameDKLatest": ""
},
"hidden": true
},
{
"name": "UWP",
"cacheVariables": {
@ -109,6 +160,27 @@
},
"hidden": true
},
{
"name": "Scarlett",
"cacheVariables": {
"XBOX_CONSOLE_TARGET": "scarlett"
},
"hidden": true
},
{
"name": "XboxOne",
"cacheVariables": {
"XBOX_CONSOLE_TARGET": "xboxone"
},
"hidden": true
},
{
"name": "Durango",
"cacheVariables": {
"XBOX_CONSOLE_TARGET": "durango"
},
"hidden": true
},
{
"name": "VCPKG",
"cacheVariables": {
@ -126,87 +198,247 @@
},
"hidden": true
},
{
"name": "JPEG_PNG",
"cacheVariables": {
"ENABLE_LIBJPEG_SUPPORT": true,
"ENABLE_LIBPNG_SUPPORT": true
},
"hidden": true
},
{
"name": "MinGW32",
"hidden": true,
"environment": {
"PATH": "$penv{PATH};c:/mingw32/bin"
"PATH": "$penv{PATH};c:/mingw32/bin;c:/mingw32/libexec/gcc/i686-w64-mingw32/12.2.0"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x86-mingw-static",
"VCPKG_HOST_TRIPLET": "x86-mingw-static"
"VCPKG_HOST_TRIPLET": "x64-windows"
}
},
{
"name": "MinGW64",
"hidden": true,
"environment": {
"PATH": "$penv{PATH};c:/mingw64/bin"
"PATH": "$penv{PATH};c:/mingw64/bin;c:/mingw64/libexec/gcc/x86_64-w64-mingw32/12.2.0"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-mingw-static",
"VCPKG_HOST_TRIPLET": "x64-mingw-static"
"VCPKG_HOST_TRIPLET": "x64-windows"
}
},
{
"name": "Intel",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_COMPILER": "icl.exe",
"BUILD_TOOLS": false
},
"toolset": {
"value": "host=x64",
"strategy": "external"
}
},
{
"name": "IntelLLVM",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_COMPILER": "icx.exe"
},
"toolset": {
"value": "host=x64",
"strategy": "external"
}
},
{ "name": "x64-Debug" , "description": "MSVC for x64 (Debug) with DX12", "inherits": [ "base", "x64", "Debug", "MSVC" ] },
{ "name": "x64-Release" , "description": "MSVC for x64 (Release) with DX12", "inherits": [ "base", "x64", "Release", "MSVC" ] },
{ "name": "x86-Debug" , "description": "MSVC for x86 (Debug) with DX12", "inherits": [ "base", "x86", "Debug", "MSVC" ] },
{ "name": "x86-Release" , "description": "MSVC for x86 (Release) with DX12", "inherits": [ "base", "x86", "Release", "MSVC" ] },
{ "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug) with DX12", "inherits": [ "base", "ARM64", "Debug", "MSVC" ] },
{ "name": "arm64-Release", "description": "MSVC for ARM64 (Release) with DX12", "inherits": [ "base", "ARM64", "Release", "MSVC" ] },
{
"name": "Analyze",
"cacheVariables":
{
"ENABLE_CODE_ANALYSIS": true
},
"hidden": true
},
{
"name": "Coverage",
"cacheVariables":
{
"BUILD_TOOLS": false,
"ENABLE_CODE_COVERAGE": true
},
"hidden": true
},
{
"name": "Fuzzing",
"cacheVariables": {
"BUILD_FUZZING": true,
"BUILD_TESTING": false
},
"hidden": true
},
{ "name": "x64-Debug" , "description": "MSVC for x64 (Debug) with DX12", "inherits": [ "base", "x64", "Debug", "MSVC" ] },
{ "name": "x64-Release" , "description": "MSVC for x64 (Release) with DX12", "inherits": [ "base", "x64", "Release", "MSVC" ] },
{ "name": "x86-Debug" , "description": "MSVC for x86 (Debug) with DX12", "inherits": [ "base", "x86", "Debug", "MSVC" ] },
{ "name": "x86-Release" , "description": "MSVC for x86 (Release) with DX12", "inherits": [ "base", "x86", "Release", "MSVC" ] },
{ "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug) with DX12", "inherits": [ "base", "ARM64", "Debug", "MSVC" ] },
{ "name": "arm64-Release" , "description": "MSVC for ARM64 (Release) with DX12", "inherits": [ "base", "ARM64", "Release", "MSVC" ] },
{ "name": "arm64ec-Debug" , "description": "MSVC for ARM64EC (Debug) with DX12", "inherits": [ "base", "ARM64EC", "Debug", "MSVC" ] },
{ "name": "arm64ec-Release", "description": "MSVC for ARM64EC (Release) with DX12", "inherits": [ "base", "ARM64EC", "Release", "MSVC" ] },
{ "name": "x64-Debug-UWP" , "description": "MSVC for x64 (Debug) for UWP", "inherits": [ "base", "x64", "Debug", "MSVC", "UWP" ] },
{ "name": "x64-Release-UWP" , "description": "MSVC for x64 (Release) for UWP", "inherits": [ "base", "x64", "Release", "MSVC", "UWP" ] },
{ "name": "x86-Debug-UWP" , "description": "MSVC for x86 (Debug) for UWP", "inherits": [ "base", "x86", "Debug", "MSVC", "UWP" ] },
{ "name": "x86-Release-UWP" , "description": "MSVC for x86 (Release) for UWP", "inherits": [ "base", "x86", "Release", "MSVC", "UWP" ] },
{ "name": "arm-Debug-UWP" , "description": "MSVC for ARM (Debug) for UWP", "inherits": [ "base", "ARM", "Debug", "MSVC", "UWP" ] },
{ "name": "arm-Release-UWP" , "description": "MSVC for ARM (Release) for UWP", "inherits": [ "base", "ARM", "Release", "MSVC", "UWP" ] },
{ "name": "arm64-Debug-UWP" , "description": "MSVC for ARM64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "MSVC", "UWP" ] },
{ "name": "arm64-Release-UWP", "description": "MSVC for ARM64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "MSVC", "UWP" ] },
{ "name": "x64-Debug-Win7" , "description": "MSVC for x64 (Debug) for Windows 7", "inherits": [ "base", "x64", "Debug", "MSVC", "Win7" ] },
{ "name": "x64-Release-Win7" , "description": "MSVC for x64 (Release) for Windows 7", "inherits": [ "base", "x64", "Release", "MSVC", "Win7" ] },
{ "name": "x86-Debug-Win7" , "description": "MSVC for x86 (Debug) for Windows 7", "inherits": [ "base", "x86", "Debug", "MSVC", "Win7" ] },
{ "name": "x86-Release-Win7" , "description": "MSVC for x86 (Release) for Windows 7", "inherits": [ "base", "x86", "Release", "MSVC", "Win7" ] },
{ "name": "x64-Debug-Win8" , "description": "MSVC for x64 (Debug) for Windows 8.1", "inherits": [ "base", "x64", "Debug", "MSVC", "Win8" ] },
{ "name": "x64-Release-Win8" , "description": "MSVC for x64 (Release) for Windows 8.1", "inherits": [ "base", "x64", "Release", "MSVC", "Win8" ] },
{ "name": "x86-Debug-Win8" , "description": "MSVC for x86 (Debug) for Windows 8.1", "inherits": [ "base", "x86", "Debug", "MSVC", "Win8" ] },
{ "name": "x86-Release-Win8" , "description": "MSVC for x86 (Release) for Windows 8.1", "inherits": [ "base", "x86", "Release", "MSVC", "Win8" ] },
{ "name": "x64-Debug-VCPKG" , "description": "MSVC for x64 (Debug) using VCPKG", "inherits": [ "base", "x64", "Debug", "MSVC", "VCPKG" ] },
{ "name": "x64-Release-VCPKG" , "description": "MSVC for x64 (Release) using VCPKG", "inherits": [ "base", "x64", "Release", "MSVC", "VCPKG" ] },
{ "name": "x86-Debug-VCPKG" , "description": "MSVC for x86 (Debug) using VCPKG", "inherits": [ "base", "x86", "Debug", "MSVC", "VCPKG" ] },
{ "name": "x86-Release-VCPKG" , "description": "MSVC for x86 (Release) using VCPKG", "inherits": [ "base", "x86", "Release", "MSVC", "VCPKG" ] },
{ "name": "arm64-Debug-VCPKG" , "description": "MSVC for ARM64 (Debug) using VCPKG", "inherits": [ "base", "ARM64", "Debug", "MSVC", "VCPKG" ] },
{ "name": "arm64-Release-VCPKG", "description": "MSVC for ARM64 (Release) using VCPKG", "inherits": [ "base", "ARM64", "Release", "MSVC", "VCPKG" ] },
{ "name": "x64-Debug-Scarlett" , "description": "MSVC for x64 (Debug) for Xbox Series X|S", "inherits": [ "base", "x64", "Debug", "MSVC", "Scarlett" ] },
{ "name": "x64-Release-Scarlett" , "description": "MSVC for x64 (Release) for Xbox Series X|S", "inherits": [ "base", "x64", "Release", "MSVC", "Scarlett" ] },
{ "name": "x64-Debug-XboxOne" , "description": "MSVC for x64 (Debug) for Xbox One", "inherits": [ "base", "x64", "Debug", "MSVC", "XboxOne" ] },
{ "name": "x64-Release-XboxOne" , "description": "MSVC for x64 (Release) for Xbox One", "inherits": [ "base", "x64", "Release", "MSVC", "XboxOne" ] },
{ "name": "x64-Debug-Durango" , "description": "MSVC for x64 (Debug) for legacy Xbox One XDK", "inherits": [ "base", "x64", "Debug", "MSVC", "Durango" ] },
{ "name": "x64-Release-Durango" , "description": "MSVC for x64 (Release) for legacy Xbox One XDK", "inherits": [ "base", "x64", "Release", "MSVC", "Durango" ] },
{ "name": "x64-Debug-VCPKG" , "description": "MSVC for x64 (Debug) using VCPKG", "inherits": [ "base", "x64", "Debug", "MSVC", "VCPKG" ] },
{ "name": "x64-Release-VCPKG" , "description": "MSVC for x64 (Release) using VCPKG", "inherits": [ "base", "x64", "Release", "MSVC", "VCPKG" ] },
{ "name": "x86-Debug-VCPKG" , "description": "MSVC for x86 (Debug) using VCPKG", "inherits": [ "base", "x86", "Debug", "MSVC", "VCPKG" ] },
{ "name": "x86-Release-VCPKG" , "description": "MSVC for x86 (Release) using VCPKG", "inherits": [ "base", "x86", "Release", "MSVC", "VCPKG" ] },
{ "name": "arm64-Debug-VCPKG" , "description": "MSVC for ARM64 (Debug) using VCPKG", "inherits": [ "base", "ARM64", "Debug", "MSVC", "VCPKG" ] },
{ "name": "arm64-Release-VCPKG" , "description": "MSVC for ARM64 (Release) using VCPKG", "inherits": [ "base", "ARM64", "Release", "MSVC", "VCPKG" ] },
{ "name": "arm64ec-Debug-VCPKG" , "description": "MSVC for ARM64EC (Debug) using VCPKG", "inherits": [ "base", "ARM64EC", "Debug", "MSVC", "VCPKG" ], "cacheVariables": { "VCPKG_TARGET_TRIPLET": "arm64ec-windows" } },
{ "name": "arm64ec-Release-VCPKG", "description": "MSVC for ARM64EC (Release) using VCPKG", "inherits": [ "base", "ARM64EC", "Release", "MSVC", "VCPKG" ], "cacheVariables": { "VCPKG_TARGET_TRIPLET": "arm64ec-windows" } },
{ "name": "x64-Debug-EXR" , "description": "MSVC for x64 (Debug) using VCPKG/OpenEXR", "inherits": [ "base", "x64", "Debug", "MSVC", "VCPKG", "EXR" ] },
{ "name": "x64-Release-EXR" , "description": "MSVC for x64 (Release) using VCPKG/OpenEXR", "inherits": [ "base", "x64", "Release", "MSVC", "VCPKG", "EXR" ] },
{ "name": "x64-Debug-JPEG-PNG" , "description": "MSVC for x64 (Debug) using VCPKG/PNG/JPEG", "inherits": [ "base", "x64", "Debug", "MSVC", "VCPKG", "JPEG_PNG" ] },
{ "name": "x64-Release-JPEG-PNG", "description": "MSVC for x64 (Release) using VCPKG/PNG/JPEG", "inherits": [ "base", "x64", "Release", "MSVC", "VCPKG", "JPEG_PNG" ] },
{ "name": "x64-Debug-Clang" , "description": "Clang/LLVM for x64 (Debug) with DX12", "inherits": [ "base", "x64", "Debug", "Clang" ] },
{ "name": "x64-Release-Clang" , "description": "Clang/LLVM for x64 (Release) with DX12", "inherits": [ "base", "x64", "Release", "Clang" ] },
{ "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug) with DX12", "inherits": [ "base", "x86", "Debug", "Clang" ], "environment": { "CXXFLAGS": "-m32" } },
{ "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release) with DX12", "inherits": [ "base", "x86", "Release", "Clang" ], "environment": { "CXXFLAGS": "-m32" } },
{ "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug) with DX12", "inherits": [ "base", "ARM64", "Debug", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } },
{ "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release) with DX12", "inherits": [ "base", "ARM64", "Release", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } },
{ "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug) with DX12", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86" ] },
{ "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release) with DX12", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86" ] },
{ "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug) with DX12", "inherits": [ "base", "ARM64", "Debug", "Clang", "Clang-AArch64" ] },
{ "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release) with DX12", "inherits": [ "base", "ARM64", "Release", "Clang", "Clang-AArch64" ] },
{ "name": "x64-Debug-UWP-Clang" , "description": "Clang/LLVM for x64 (Debug) for UWP", "inherits": [ "base", "x64", "Debug", "Clang", "UWP" ] },
{ "name": "x64-Release-UWP-Clang" , "description": "Clang/LLVM for x64 (Release) for UWP", "inherits": [ "base", "x64", "Release", "Clang", "UWP" ] },
{ "name": "x86-Debug-UWP-Clang" , "description": "Clang/LLVM for x86 (Debug) for UWP", "inherits": [ "base", "x86", "Debug", "Clang", "UWP" ], "environment": { "CXXFLAGS": "-m32" } },
{ "name": "x86-Release-UWP-Clang" , "description": "Clang/LLVM for x86 (Release) for UWP", "inherits": [ "base", "x86", "Release", "Clang", "UWP" ], "environment": { "CXXFLAGS": "-m32" } },
{ "name": "arm64-Debug-UWP-Clang" , "description": "Clang/LLVM for AArch64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "Clang", "UWP" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } },
{ "name": "arm64-Release-UWP-Clang", "description": "Clang/LLVM for AArch64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "Clang", "UWP" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } },
{ "name": "x86-Debug-UWP-Clang" , "description": "Clang/LLVM for x86 (Debug) for UWP", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86", "UWP" ] },
{ "name": "x86-Release-UWP-Clang" , "description": "Clang/LLVM for x86 (Release) for UWP", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86", "UWP" ] },
{ "name": "arm64-Debug-UWP-Clang" , "description": "Clang/LLVM for AArch64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "Clang", "Clang-AArch64", "UWP" ] },
{ "name": "arm64-Release-UWP-Clang", "description": "Clang/LLVM for AArch64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "Clang", "Clang-AArch64", "UWP" ] },
{ "name": "x64-Debug-Win7-Clang" , "description": "Clang/LLVM for x64 (Debug) for Windows 7", "inherits": [ "base", "x64", "Debug", "Clang", "Win7" ] },
{ "name": "x64-Release-Win7-Clang", "description": "Clang/LLVM for x64 (Release) for Windows 7", "inherits": [ "base", "x64", "Release", "Clang", "Win7" ] },
{ "name": "x86-Debug-Win7-Clang" , "description": "Clang/LLVM for x86 (Debug) for Windows 7", "inherits": [ "base", "x86", "Debug", "Clang", "Win7" ], "environment": { "CXXFLAGS": "-m32" } },
{ "name": "x86-Release-Win7-Clang", "description": "Clang/LLVM for x86 (Release) for Windows 7", "inherits": [ "base", "x86", "Release", "Clang", "Win7" ], "environment": { "CXXFLAGS": "-m32" } },
{ "name": "x64-Debug-Win8-Clang" , "description": "Clang/LLVM for x64 (Debug) for Windows 8.1", "inherits": [ "base", "x64", "Debug", "Clang", "Win8" ] },
{ "name": "x64-Release-Win8-Clang", "description": "Clang/LLVM for x64 (Release) for Windows 8.1", "inherits": [ "base", "x64", "Release", "Clang", "Win8" ] },
{ "name": "x86-Debug-Win8-Clang" , "description": "Clang/LLVM for x86 (Debug) for Windows 8.1", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86", "Win8" ] },
{ "name": "x86-Release-Win8-Clang", "description": "Clang/LLVM for x86 (Release) for Windows 8.1", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86", "Win8" ] },
{ "name": "x64-Debug-Clang-VCPKG" , "description": "Clang/LLVM for x64 (Debug) using VCPKG/OpenEXR", "inherits": [ "base", "x64", "Debug", "Clang", "VCPKG" ] },
{ "name": "x64-Release-Clang-VCPKG" , "description": "Clang/LLVM for x64 (Release) using VCPKG/OpenEXR", "inherits": [ "base", "x64", "Release", "Clang", "VCPKG" ] },
{ "name": "x86-Debug-Clang-VCPKG" , "description": "Clang/LLVM for x86 (Debug) using VCPKG/OpenEXR", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86", "VCPKG" ] },
{ "name": "x86-Release-Clang-VCPKG" , "description": "Clang/LLVM for x86 (Release) using VCPKG/OpenEXR", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86", "VCPKG" ] },
{ "name": "arm64-Debug-Clang-VCPKG" , "description": "Clang/LLVM for AArch64 (Debug) using VCPKG/OpenEXR", "inherits": [ "base", "ARM64", "Debug", "Clang", "Clang-AArch64", "VCPKG" ] },
{ "name": "arm64-Release-Clang-VCPKG", "description": "Clang/LLVM for AArch64 (Release) using VCPKG/OpenEXR", "inherits": [ "base", "ARM64", "Release", "Clang", "Clang-AArch64", "VCPKG" ] },
{ "name": "x64-Debug-Clang-JPEG-PNG" , "description": "Clang/LLVM for x64 (Debug) with DX12", "inherits": [ "base", "x64", "Debug", "Clang", "VCPKG", "JPEG_PNG" ] },
{ "name": "x64-Release-Clang-JPEG-PNG" , "description": "Clang/LLVM for x64 (Release) with DX12", "inherits": [ "base", "x64", "Release", "Clang", "VCPKG", "JPEG_PNG" ] },
{ "name": "x64-Debug-GDKX" , "description": "MSVC for x64 (Debug) Xbox One Extensions", "inherits": [ "base", "x64", "Debug", "GDKX", "MSVC" ] },
{ "name": "x64-Release-GDKX" , "description": "MSVC for x64 (Release) Xbox One Extensions", "inherits": [ "base", "x64", "Release", "GDKX", "MSVC" ] },
{ "name": "x64-Debug-GDKX-S" , "description": "MSVC for x64 (Debug) Xbox Series X|S Extensions", "inherits": [ "base", "x64", "Debug", "GDKXS", "MSVC" ] },
{ "name": "x64-Release-GDKX-S" , "description": "MSVC for x64 (Release) Xbox Series X|S Extensions", "inherits": [ "base", "x64", "Release", "GDKXS", "MSVC" ] },
{ "name": "x64-Debug-XDK" , "description": "MSVC for x64 (Debug) Xbox One Extensions (legacy)", "inherits": [ "base", "x64", "Debug", "XDK", "MSVC" ] },
{ "name": "x64-Release-XDK" , "description": "MSVC for x64 (Release) Xbox One Extensions (legacy)", "inherits": [ "base", "x64", "Release", "XDK", "MSVC" ] },
{ "name": "x64-Debug-GDKX-Clang" , "description": "MSVC for x64 (Debug) Xbox One Extensions", "inherits": [ "base", "x64", "Debug", "GDKX", "Clang" ] },
{ "name": "x64-Release-GDKX-Clang" , "description": "MSVC for x64 (Release) Xbox One Extensions", "inherits": [ "base", "x64", "Release", "GDKX", "Clang" ] },
{ "name": "x64-Debug-GDKX-S-Clang" , "description": "MSVC for x64 (Debug) Xbox Series X|S Extensions", "inherits": [ "base", "x64", "Debug", "GDKXS", "Clang" ] },
{ "name": "x64-Release-GDKX-S-Clang" , "description": "MSVC for x64 (Release) Xbox Series X|S Extensions", "inherits": [ "base", "x64", "Release", "GDKXS", "Clang" ] },
{ "name": "x64-Debug-Scarlett-Clang" , "description": "Clang/LLVM for x64 (Debug) for Xbox Series X|S", "inherits": [ "base", "x64", "Debug", "Clang", "Scarlett" ] },
{ "name": "x64-Release-Scarlett-Clang", "description": "Clang/LLVM for x64 (Release) for Xbox Series X|S", "inherits": [ "base", "x64", "Release", "Clang", "Scarlett" ] },
{ "name": "x64-Debug-XboxOne-Clang" , "description": "Clang/LLVM for x64 (Debug) for Xbox One", "inherits": [ "base", "x64", "Debug", "Clang", "XboxOne" ] },
{ "name": "x64-Release-XboxOne-Clang" , "description": "Clang/LLVM for x64 (Release) for Xbox One", "inherits": [ "base", "x64", "Release", "Clang", "XboxOne" ] },
{ "name": "x64-Debug-MinGW" , "description": "MinG-W64 (Debug)", "inherits": [ "base", "x64", "Debug", "GNUC", "VCPKG", "MinGW64" ] },
{ "name": "x64-Release-MinGW", "description": "MinG-W64 (Release)", "inherits": [ "base", "x64", "Release", "GNUC", "VCPKG", "MinGW64" ] },
{ "name": "x86-Debug-MinGW" , "description": "MinG-W32 (Debug)", "inherits": [ "base", "x86", "Debug", "GNUC", "VCPKG", "MinGW32" ] },
{ "name": "x86-Release-MinGW", "description": "MinG-W32 (Release)", "inherits": [ "base", "x86", "Release", "GNUC", "VCPKG", "MinGW32" ] },
{ "name": "x64-Debug-Linux", "description": "WSL Linux x64 (Debug)", "inherits": [ "base", "x64", "Debug", "VCPKG" ] },
{ "name": "x64-Release-Linux", "description": "WSL Linux x64 (Release)", "inherits": [ "base", "x64", "Release", "VCPKG" ] },
{ "name": "arm64-Debug-Linux", "description": "WSL Linux ARM64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "VCPKG" ] },
{ "name": "arm64-Release-Linux", "description": "WSL Linux ARM64 (Release)", "inherits": [ "base", "ARM64", "Release", "VCPKG" ] }
{ "name": "x64-Debug-MinGW-JPEG-PNG" , "description": "MinG-W64 (Debug)", "inherits": [ "base", "x64", "Debug", "GNUC", "VCPKG", "MinGW64", "JPEG_PNG" ] },
{ "name": "x64-Release-MinGW-JPEG-PNG", "description": "MinG-W64 (Release)", "inherits": [ "base", "x64", "Release", "GNUC", "VCPKG", "MinGW64", "JPEG_PNG" ] },
{ "name": "x86-Debug-MinGW-JPEG-PNG" , "description": "MinG-W32 (Debug)", "inherits": [ "base", "x86", "Debug", "GNUC", "VCPKG", "MinGW32", "JPEG_PNG" ] },
{ "name": "x86-Release-MinGW-JPEG-PNG", "description": "MinG-W32 (Release)", "inherits": [ "base", "x86", "Release", "GNUC", "VCPKG", "MinGW32", "JPEG_PNG" ] },
{ "name": "x64-Debug-Linux", "description": "WSL Linux x64 (Debug)", "inherits": [ "base", "x64", "Debug", "VCPKG", "JPEG_PNG" ] },
{ "name": "x64-Release-Linux", "description": "WSL Linux x64 (Release)", "inherits": [ "base", "x64", "Release", "VCPKG", "JPEG_PNG" ] },
{ "name": "arm64-Debug-Linux", "description": "WSL Linux ARM64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "VCPKG", "JPEG_PNG" ] },
{ "name": "arm64-Release-Linux", "description": "WSL Linux ARM64 (Release)", "inherits": [ "base", "ARM64", "Release", "VCPKG", "JPEG_PNG" ] },
{ "name": "x64-Debug-ICC" , "description": "Intel Classic Compiler (Debug) with DX12", "inherits": [ "base", "x64", "Debug", "Intel" ] },
{ "name": "x64-Release-ICC" , "description": "Intel Classic Compiler (Release) with DX12", "inherits": [ "base", "x64", "Release", "Intel" ] },
{ "name": "x64-Debug-ICX" , "description": "Intel oneAPI Compiler (Debug) with DX12", "inherits": [ "base", "x64", "Debug", "IntelLLVM" ] },
{ "name": "x64-Release-ICX" , "description": "Intel oneAPI Compiler (Release) with DX12", "inherits": [ "base", "x64", "Release", "IntelLLVM" ] },
{ "name": "x64-Analyze" , "description": "MSVC for x64 (Debug) with DX12 using /analyze", "inherits": [ "base", "x64", "Debug", "MSVC", "Analyze" ] },
{ "name": "x64-Coverage" , "description": "MSVC for x64 (Debug) with DX12 w/ Code Coverage", "inherits": [ "base", "x64", "Debug", "MSVC", "Coverage" ] },
{ "name": "x64-Coverage-Clang", "description": "Clang/LLVM for x64 (Debug) with DX12 w/ Code Coverage", "inherits": [ "base", "x64", "Debug", "Clang", "Coverage" ] },
{ "name": "x64-Fuzzing" , "description": "MSVC for x64 (Release) with ASan", "inherits": [ "base", "x64", "Release", "MSVC", "Fuzzing" ] }
],
"testPresets": [
{ "name": "x64-Debug" , "configurePreset": "x64-Debug" },
{ "name": "x64-Release" , "configurePreset": "x64-Release" },
{ "name": "x86-Debug" , "configurePreset": "x86-Debug" },
{ "name": "x86-Release" , "configurePreset": "x86-Release" },
{ "name": "arm64-Debug" , "configurePreset": "arm64-Debug" },
{ "name": "arm64-Release" , "configurePreset": "arm64-Release" },
{ "name": "arm64ec-Debug" , "configurePreset": "arm64ec-Debug" },
{ "name": "arm64ec-Release", "configurePreset": "arm64ec-Release" },
{ "name": "x64-Debug-VCPKG" , "configurePreset": "x64-Debug-VCPKG" },
{ "name": "x64-Release-VCPKG" , "configurePreset": "x64-Release-VCPKG" },
{ "name": "x86-Debug-VCPKG" , "configurePreset": "x86-Debug-VCPKG" },
{ "name": "x86-Release-VCPKG" , "configurePreset": "x86-Release-VCPKG" },
{ "name": "arm64-Debug-VCPKG" , "configurePreset": "arm64-Debug-VCPKG" },
{ "name": "arm64-Release-VCPKG" , "configurePreset": "arm64-Release-VCPKG" },
{ "name": "arm64ec-Debug-VCPKG" , "configurePreset": "arm64ec-Debug-VCPKG" },
{ "name": "arm64ec-Release-VCPKG", "configurePreset": "arm64ec-Release-VCPKG" },
{ "name": "x64-Debug-Clang" , "configurePreset": "x64-Debug-Clang" },
{ "name": "x64-Release-Clang" , "configurePreset": "x64-Release-Clang" },
{ "name": "x86-Debug-Clang" , "configurePreset": "x86-Debug-Clang" },
{ "name": "x86-Release-Clang" , "configurePreset": "x86-Release-Clang" },
{ "name": "arm64-Debug-Clang" , "configurePreset": "arm64-Debug-Clang" },
{ "name": "arm64-Release-Clang", "configurePreset": "arm64-Release-Clang" },
{ "name": "x64-Debug-GDKX" , "configurePreset": "x64-Debug-GDKX" },
{ "name": "x64-Release-GDKX" , "configurePreset": "x64-Release-GDKX" },
{ "name": "x64-Debug-GDKX-S" , "configurePreset": "x64-Debug-GDKX-S" },
{ "name": "x64-Release-GDKX-S" , "configurePreset": "x64-Release-GDKX-S" },
{ "name": "x64-Debug-MinGW" , "configurePreset": "x64-Debug-MinGW" },
{ "name": "x64-Release-MinGW" , "configurePreset": "x64-Release-MinGW" },
{ "name": "x86-Debug-MinGW" , "configurePreset": "x86-Debug-MinGW" },
{ "name": "x86-Release-MinGW" , "configurePreset": "x86-Release-MinGW" },
{ "name": "x64-Debug-ICC" , "configurePreset": "x64-Debug-ICC" },
{ "name": "x64-Release-ICC" , "configurePreset": "x64-Release-ICC"},
{ "name": "x64-Debug-ICX" , "configurePreset": "x64-Debug-ICX" },
{ "name": "x64-Release-ICX" , "configurePreset": "x64-Release-ICX"},
{ "name": "x64-Debug-JPEG-PNG" , "configurePreset": "x64-Debug-JPEG-PNG" },
{ "name": "x64-Release-JPEG-PNG", "configurePreset": "x64-Release-JPEG-PNG"}
]
}

10
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,10 @@
# Microsoft Open Source Code of Conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
Resources:
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support)

375
Common/CmdLineHelpers.h Normal file
View File

@ -0,0 +1,375 @@
//--------------------------------------------------------------------------------------
// File: CmdLineHelpers.h
//
// Command-line tool shared functions
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//--------------------------------------------------------------------------------------
#pragma once
#if __cplusplus < 201703L
#error Requires C++17 (and /Zc:__cplusplus with MSVC)
#endif
#include <algorithm>
#include <cstdio>
#include <cwchar>
#include <filesystem>
#include <fstream>
#include <list>
#include <memory>
#include <set>
#include <string>
#ifndef TOOL_VERSION
#error Define TOOL_VERSION before including this header
#endif
namespace Helpers
{
struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } };
using ScopedHandle = std::unique_ptr<void, handle_closer>;
inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
struct find_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } };
using ScopedFindHandle = std::unique_ptr<void, find_closer>;
#ifdef _PREFAST_
#pragma prefast(disable : 26018, "Only used with static internal arrays")
#endif
struct SConversion
{
std::wstring szSrc;
std::wstring szFolder;
};
template<typename T>
struct SValue
{
const wchar_t* name;
T value;
};
template<typename T>
T LookupByName(const wchar_t _In_z_ *pName, const SValue<T> *pArray)
{
while (pArray->name)
{
if (!_wcsicmp(pName, pArray->name))
return pArray->value;
pArray++;
}
return static_cast<T>(0);
}
template<typename T>
const wchar_t* LookupByValue(T value, const SValue<T> *pArray)
{
while (pArray->name)
{
if (value == pArray->value)
return pArray->name;
pArray++;
}
return L"";
}
void PrintFormat(DXGI_FORMAT Format, const SValue<DXGI_FORMAT>* pFormatList)
{
for (auto pFormat = pFormatList; pFormat->name; pFormat++)
{
if (pFormat->value == Format)
{
wprintf(L"%ls", pFormat->name);
return;
}
}
wprintf(L"*UNKNOWN*");
}
void PrintFormat(DXGI_FORMAT Format, const SValue<DXGI_FORMAT>* pFormatList1, const SValue<DXGI_FORMAT>* pFormatList2)
{
for (auto pFormat = pFormatList1; pFormat->name; pFormat++)
{
if (pFormat->value == Format)
{
wprintf(L"%ls", pFormat->name);
return;
}
}
for (auto pFormat = pFormatList2; pFormat->name; pFormat++)
{
if (pFormat->value == Format)
{
wprintf(L"%ls", pFormat->name);
return;
}
}
wprintf(L"*UNKNOWN*");
}
template<typename T>
void PrintList(size_t cch, const SValue<T> *pValue)
{
while (pValue->name)
{
const size_t cchName = wcslen(pValue->name);
if (cch + cchName + 2 >= 80)
{
wprintf(L"\n ");
cch = 6;
}
wprintf(L"%ls ", pValue->name);
cch += cchName + 2;
pValue++;
}
wprintf(L"\n");
}
void PrintLogo(bool versionOnly, _In_z_ const wchar_t* name, _In_z_ const wchar_t* desc)
{
wchar_t version[32] = {};
wchar_t appName[_MAX_PATH] = {};
if (GetModuleFileNameW(nullptr, appName, _MAX_PATH))
{
const DWORD size = GetFileVersionInfoSizeW(appName, nullptr);
if (size > 0)
{
auto verInfo = std::make_unique<uint8_t[]>(size);
if (GetFileVersionInfoW(appName, 0, size, verInfo.get()))
{
LPVOID lpstr = nullptr;
UINT strLen = 0;
if (VerQueryValueW(verInfo.get(), L"\\StringFileInfo\\040904B0\\ProductVersion", &lpstr, &strLen))
{
wcsncpy_s(version, reinterpret_cast<const wchar_t*>(lpstr), strLen);
}
}
}
}
if (!*version || wcscmp(version, L"1.0.0.0") == 0)
{
swprintf_s(version, L"%03d (library)", TOOL_VERSION);
}
if (versionOnly)
{
wprintf(L"%ls version %ls\n", name, version);
}
else
{
wprintf(L"%ls Version %ls\n", desc, version);
wprintf(L"Copyright (C) Microsoft Corp.\n");
#ifdef _DEBUG
wprintf(L"*** Debug build ***\n");
#endif
wprintf(L"\n");
}
}
void SearchForFiles(const std::filesystem::path& path, std::list<SConversion>& files, bool recursive, _In_opt_z_ const wchar_t* folder)
{
// Process files
WIN32_FIND_DATAW findData = {};
ScopedFindHandle hFile(safe_handle(FindFirstFileExW(path.c_str(),
FindExInfoBasic, &findData,
FindExSearchNameMatch, nullptr,
FIND_FIRST_EX_LARGE_FETCH)));
if (hFile)
{
for (;;)
{
if (!(findData.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY)))
{
SConversion conv = {};
conv.szSrc = path.parent_path().append(findData.cFileName).native();
if (folder)
{
conv.szFolder = folder;
}
files.push_back(conv);
}
if (!FindNextFileW(hFile.get(), &findData))
break;
}
}
// Process directories
if (recursive)
{
auto searchDir = path.parent_path().append(L"*");
hFile.reset(safe_handle(FindFirstFileExW(searchDir.c_str(),
FindExInfoBasic, &findData,
FindExSearchLimitToDirectories, nullptr,
FIND_FIRST_EX_LARGE_FETCH)));
if (!hFile)
return;
for (;;)
{
if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if (findData.cFileName[0] != L'.')
{
auto subfolder = (folder)
? (std::wstring(folder) + std::wstring(findData.cFileName) + std::filesystem::path::preferred_separator)
: (std::wstring(findData.cFileName) + std::filesystem::path::preferred_separator);
auto subdir = path.parent_path().append(findData.cFileName).append(path.filename().c_str());
SearchForFiles(subdir, files, recursive, subfolder.c_str());
}
}
if (!FindNextFileW(hFile.get(), &findData))
break;
}
}
}
void ProcessFileList(std::wifstream& inFile, std::list<SConversion>& files)
{
std::list<SConversion> flist;
std::set<std::wstring> excludes;
for (;;)
{
std::wstring fname;
std::getline(inFile, fname);
if (!inFile)
break;
if (fname[0] == L'#')
{
// Comment
}
else if (fname[0] == L'-')
{
if (flist.empty())
{
wprintf(L"WARNING: Ignoring the line '%ls' in -flist\n", fname.c_str());
}
else
{
std::filesystem::path path(fname.c_str() + 1);
auto& npath = path.make_preferred();
if (wcspbrk(fname.c_str(), L"?*") != nullptr)
{
std::list<SConversion> removeFiles;
SearchForFiles(npath, removeFiles, false, nullptr);
for (auto& it : removeFiles)
{
std::wstring name = it.szSrc;
std::transform(name.begin(), name.end(), name.begin(), towlower);
excludes.insert(name);
}
}
else
{
std::wstring name = npath.c_str();
std::transform(name.begin(), name.end(), name.begin(), towlower);
excludes.insert(name);
}
}
}
else if (wcspbrk(fname.c_str(), L"?*") != nullptr)
{
std::filesystem::path path(fname.c_str());
SearchForFiles(path.make_preferred(), flist, false, nullptr);
}
else
{
SConversion conv = {};
std::filesystem::path path(fname.c_str());
conv.szSrc = path.make_preferred().native();
flist.push_back(conv);
}
}
inFile.close();
if (!excludes.empty())
{
// Remove any excluded files
for (auto it = flist.begin(); it != flist.end();)
{
std::wstring name = it->szSrc;
std::transform(name.begin(), name.end(), name.begin(), towlower);
auto item = it;
++it;
if (excludes.find(name) != excludes.end())
{
flist.erase(item);
}
}
}
if (flist.empty())
{
wprintf(L"WARNING: No file names found in -flist\n");
}
else
{
files.splice(files.end(), flist);
}
}
const wchar_t* GetErrorDesc(HRESULT hr)
{
static wchar_t desc[1024] = {};
LPWSTR errorText = nullptr;
const DWORD result = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER,
nullptr, static_cast<DWORD>(hr),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast<LPWSTR>(&errorText), 0, nullptr);
*desc = 0;
if (result > 0 && errorText)
{
swprintf_s(desc, L": %ls", errorText);
size_t len = wcslen(desc);
if (len >= 1)
{
desc[len - 1] = 0;
}
if (errorText)
LocalFree(errorText);
for (wchar_t* ptr = desc; *ptr != 0; ++ptr)
{
if (*ptr == L'\r' || *ptr == L'\n')
{
*ptr = L' ';
}
}
}
return desc;
}
}

File diff suppressed because it is too large Load Diff

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

21
Common/settings.manifest Normal file
View File

@ -0,0 +1,21 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 / Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<asmv3:application>
<asmv3:windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws2:longPathAware>true</ws2:longPathAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

View File

@ -18,6 +18,7 @@
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <memory>
#include <new>
@ -53,21 +54,23 @@ using namespace DirectX;
//
// See DDS.h in the 'Texconv' sample and the 'DirectXTex' library
//--------------------------------------------------------------------------------------
namespace
{
#pragma pack(push,1)
constexpr uint32_t DDS_MAGIC = 0x20534444; // "DDS "
constexpr uint32_t DDS_MAGIC = 0x20534444; // "DDS "
struct DDS_PIXELFORMAT
{
uint32_t size;
uint32_t flags;
uint32_t fourCC;
uint32_t RGBBitCount;
uint32_t RBitMask;
uint32_t GBitMask;
uint32_t BBitMask;
uint32_t ABitMask;
};
struct DDS_PIXELFORMAT
{
uint32_t size;
uint32_t flags;
uint32_t fourCC;
uint32_t RGBBitCount;
uint32_t RBitMask;
uint32_t GBitMask;
uint32_t BBitMask;
uint32_t ABitMask;
};
#define DDS_FOURCC 0x00000004 // DDPF_FOURCC
#define DDS_RGB 0x00000040 // DDPF_RGB
@ -87,68 +90,73 @@ struct DDS_PIXELFORMAT
#define DDS_CUBEMAP_NEGATIVEZ 0x00008200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ
#define DDS_CUBEMAP_ALLFACES ( DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX |\
DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
#define DDS_CUBEMAP 0x00000200 // DDSCAPS2_CUBEMAP
enum DDS_MISC_FLAGS2
{
DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L,
};
enum DDS_MISC_FLAGS2
{
DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L,
};
struct DDS_HEADER
{
uint32_t size;
uint32_t flags;
uint32_t height;
uint32_t width;
uint32_t pitchOrLinearSize;
uint32_t depth; // only if DDS_HEADER_FLAGS_VOLUME is set in flags
uint32_t mipMapCount;
uint32_t reserved1[11];
DDS_PIXELFORMAT ddspf;
uint32_t caps;
uint32_t caps2;
uint32_t caps3;
uint32_t caps4;
uint32_t reserved2;
};
struct DDS_HEADER
{
uint32_t size;
uint32_t flags;
uint32_t height;
uint32_t width;
uint32_t pitchOrLinearSize;
uint32_t depth; // only if DDS_HEADER_FLAGS_VOLUME is set in flags
uint32_t mipMapCount;
uint32_t reserved1[11];
DDS_PIXELFORMAT ddspf;
uint32_t caps;
uint32_t caps2;
uint32_t caps3;
uint32_t caps4;
uint32_t reserved2;
};
struct DDS_HEADER_DXT10
{
DXGI_FORMAT dxgiFormat;
uint32_t resourceDimension;
uint32_t miscFlag; // see D3D11_RESOURCE_MISC_FLAG
uint32_t arraySize;
uint32_t miscFlags2;
};
struct DDS_HEADER_DXT10
{
DXGI_FORMAT dxgiFormat;
uint32_t resourceDimension;
uint32_t miscFlag; // see D3D11_RESOURCE_MISC_FLAG
uint32_t arraySize;
uint32_t miscFlags2;
};
#pragma pack(pop)
//--------------------------------------------------------------------------------------
namespace
{
static_assert(sizeof(DDS_PIXELFORMAT) == 32, "DDS pixel format size mismatch");
static_assert(sizeof(DDS_HEADER) == 124, "DDS Header size mismatch");
static_assert(sizeof(DDS_HEADER_DXT10) == 20, "DDS DX10 Extended Header size mismatch");
constexpr size_t DDS_MIN_HEADER_SIZE = sizeof(uint32_t) + sizeof(DDS_HEADER);
constexpr size_t DDS_DX10_HEADER_SIZE = sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10);
static_assert(DDS_DX10_HEADER_SIZE > DDS_MIN_HEADER_SIZE, "DDS DX10 Header should be larger than standard header");
//--------------------------------------------------------------------------------------
struct handle_closer { void operator()(HANDLE h) noexcept { if (h) CloseHandle(h); } };
using ScopedHandle = std::unique_ptr<void, handle_closer>;
inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
#if defined(_DEBUG) || defined(PROFILE)
#if defined(_DEBUG) || defined(PROFILE)
template<UINT TNameLength>
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_ const char(&name)[TNameLength]) noexcept
{
resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, name);
}
#else
#else
template<UINT TNameLength>
inline void SetDebugObjectName(_In_ ID3D11DeviceChild*, _In_ const char(&)[TNameLength]) noexcept
{
}
#endif
{}
#endif
//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
HRESULT LoadTextureDataFromMemory(
_In_reads_(ddsDataSize) const uint8_t* ddsData,
size_t ddsDataSize,
@ -168,13 +176,13 @@ namespace
return E_FAIL;
}
if (ddsDataSize < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
if (ddsDataSize < DDS_MIN_HEADER_SIZE)
{
return E_FAIL;
}
// DDS files always start with the same magic number ("DDS ")
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
if (dwMagicNumber != DDS_MAGIC)
{
return E_FAIL;
@ -195,7 +203,7 @@ namespace
(MAKEFOURCC('D', 'X', '1', '0') == hdr->ddspf.fourCC))
{
// Must be long enough for both headers and magic value
if (ddsDataSize < (sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10)))
if (ddsDataSize < DDS_DX10_HEADER_SIZE)
{
return E_FAIL;
}
@ -205,8 +213,7 @@ namespace
// setup the pointers in the process request
*header = hdr;
auto offset = sizeof(uint32_t)
+ sizeof(DDS_HEADER)
auto offset = DDS_MIN_HEADER_SIZE
+ (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0u);
*bitData = ddsData + offset;
*bitSize = ddsDataSize - offset;
@ -231,20 +238,10 @@ namespace
*bitSize = 0;
// open the file
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(
fileName,
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
#else
ScopedHandle hFile(safe_handle(CreateFileW(
fileName,
GENERIC_READ, FILE_SHARE_READ,
nullptr,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
nullptr)));
#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@ -264,7 +261,7 @@ namespace
}
// Need at least enough data to fill the header and magic number to be a valid DDS
if (fileInfo.EndOfFile.LowPart < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
if (fileInfo.EndOfFile.LowPart < DDS_MIN_HEADER_SIZE)
{
return E_FAIL;
}
@ -296,7 +293,7 @@ namespace
}
// DDS files always start with the same magic number ("DDS ")
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
if (dwMagicNumber != DDS_MAGIC)
{
ddsData.reset();
@ -319,7 +316,7 @@ namespace
(MAKEFOURCC('D', 'X', '1', '0') == hdr->ddspf.fourCC))
{
// Must be long enough for both headers and magic value
if (fileInfo.EndOfFile.LowPart < (sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10)))
if (fileInfo.EndOfFile.LowPart < DDS_DX10_HEADER_SIZE)
{
ddsData.reset();
return E_FAIL;
@ -330,7 +327,7 @@ namespace
// setup the pointers in the process request
*header = hdr;
auto offset = sizeof(uint32_t) + sizeof(DDS_HEADER)
auto offset = DDS_MIN_HEADER_SIZE
+ (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0u);
*bitData = ddsData.get() + offset;
*bitSize = fileInfo.EndOfFile.LowPart - offset;
@ -494,7 +491,7 @@ namespace
_In_ size_t width,
_In_ size_t height,
_In_ DXGI_FORMAT fmt,
size_t* outNumBytes,
_Out_opt_ size_t* outNumBytes,
_Out_opt_ size_t* outRowBytes,
_Out_opt_ size_t* outNumRows) noexcept
{
@ -508,6 +505,9 @@ namespace
size_t bpe = 0;
switch (fmt)
{
case DXGI_FORMAT_UNKNOWN:
return E_INVALIDARG;
case DXGI_FORMAT_BC1_TYPELESS:
case DXGI_FORMAT_BC1_UNORM:
case DXGI_FORMAT_BC1_UNORM_SRGB:
@ -552,12 +552,31 @@ namespace
case DXGI_FORMAT_NV12:
case DXGI_FORMAT_420_OPAQUE:
if ((height % 2) != 0)
{
// Requires a height alignment of 2.
return E_INVALIDARG;
}
planar = true;
bpe = 2;
break;
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
case DXGI_FORMAT_P208:
planar = true;
bpe = 2;
break;
#endif
case DXGI_FORMAT_P010:
case DXGI_FORMAT_P016:
if ((height % 2) != 0)
{
// Requires a height alignment of 2.
return E_INVALIDARG;
}
planar = true;
bpe = 4;
break;
@ -736,6 +755,9 @@ namespace
// No 3:3:2 or paletted DXGI formats aka D3DFMT_R3G3B2, D3DFMT_P8
break;
default:
return DXGI_FORMAT_UNKNOWN;
}
}
else if (ddpf.flags & DDS_LUMINANCE)
@ -766,6 +788,9 @@ namespace
return DXGI_FORMAT_R8G8_UNORM; // Some DDS writers assume the bitcount should be 8 instead of 16
}
break;
default:
return DXGI_FORMAT_UNKNOWN;
}
}
else if (ddpf.flags & DDS_ALPHA)
@ -798,6 +823,9 @@ namespace
return DXGI_FORMAT_R8G8_SNORM; // D3DX10/11 writes this out as DX10 extension
}
break;
default:
return DXGI_FORMAT_UNKNOWN;
}
// No DXGI format maps to DDPF_BUMPLUMINANCE aka D3DFMT_L6V5U5, D3DFMT_X8L8V8U8
@ -898,6 +926,9 @@ namespace
return DXGI_FORMAT_R32G32B32A32_FLOAT;
// No DXGI format maps to D3DFMT_CxV8U8
default:
return DXGI_FORMAT_UNKNOWN;
}
}
@ -1302,6 +1333,9 @@ namespace
}
}
break;
default:
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
return hr;
@ -1353,6 +1387,34 @@ namespace
switch (d3d10ext->dxgiFormat)
{
case DXGI_FORMAT_NV12:
case DXGI_FORMAT_P010:
case DXGI_FORMAT_P016:
case DXGI_FORMAT_420_OPAQUE:
if ((d3d10ext->resourceDimension != D3D11_RESOURCE_DIMENSION_TEXTURE2D)
|| (width % 2) != 0 || (height % 2) != 0)
{
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
break;
case DXGI_FORMAT_YUY2:
case DXGI_FORMAT_Y210:
case DXGI_FORMAT_Y216:
case DXGI_FORMAT_P208:
if ((width % 2) != 0)
{
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
break;
case DXGI_FORMAT_NV11:
if ((width % 4) != 0)
{
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
break;
case DXGI_FORMAT_AI44:
case DXGI_FORMAT_IA44:
case DXGI_FORMAT_P8:
@ -1688,7 +1750,7 @@ namespace
if (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC)
{
auto d3d10ext = reinterpret_cast<const DDS_HEADER_DXT10*>(reinterpret_cast<const uint8_t*>(header) + sizeof(DDS_HEADER));
auto const mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
const auto mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
switch (mode)
{
case DDS_ALPHA_MODE_STRAIGHT:
@ -1733,29 +1795,19 @@ namespace
);
if (result > 0)
{
const char* pstrName = strrchr(strFileA, '\\');
if (!pstrName)
{
pstrName = strFileA;
}
else
{
pstrName++;
}
if (texture && *texture)
{
(*texture)->SetPrivateData(WKPDID_D3DDebugObjectName,
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
pstrName
static_cast<UINT>(result),
strFileA
);
}
if (textureView && *textureView)
{
(*textureView)->SetPrivateData(WKPDID_D3DDebugObjectName,
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
pstrName
static_cast<UINT>(result),
strFileA
);
}
}

View File

@ -51,6 +51,7 @@ namespace DirectX
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec"
#pragma clang diagnostic ignored "-Wextra-semi-stmt"
#endif
DEFINE_ENUM_FLAG_OPERATORS(DDS_LOADER_FLAGS);

View File

@ -18,6 +18,7 @@
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <memory>
#include <new>
@ -81,21 +82,23 @@ using namespace DirectX;
//
// See DDS.h in the 'Texconv' sample and the 'DirectXTex' library
//--------------------------------------------------------------------------------------
namespace
{
#pragma pack(push,1)
constexpr uint32_t DDS_MAGIC = 0x20534444; // "DDS "
constexpr uint32_t DDS_MAGIC = 0x20534444; // "DDS "
struct DDS_PIXELFORMAT
{
uint32_t size;
uint32_t flags;
uint32_t fourCC;
uint32_t RGBBitCount;
uint32_t RBitMask;
uint32_t GBitMask;
uint32_t BBitMask;
uint32_t ABitMask;
};
struct DDS_PIXELFORMAT
{
uint32_t size;
uint32_t flags;
uint32_t fourCC;
uint32_t RGBBitCount;
uint32_t RBitMask;
uint32_t GBitMask;
uint32_t BBitMask;
uint32_t ABitMask;
};
#define DDS_FOURCC 0x00000004 // DDPF_FOURCC
#define DDS_RGB 0x00000040 // DDPF_RGB
@ -115,48 +118,54 @@ struct DDS_PIXELFORMAT
#define DDS_CUBEMAP_NEGATIVEZ 0x00008200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ
#define DDS_CUBEMAP_ALLFACES ( DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX |\
DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
#define DDS_CUBEMAP 0x00000200 // DDSCAPS2_CUBEMAP
enum DDS_MISC_FLAGS2
{
DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L,
};
enum DDS_MISC_FLAGS2
{
DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L,
};
struct DDS_HEADER
{
uint32_t size;
uint32_t flags;
uint32_t height;
uint32_t width;
uint32_t pitchOrLinearSize;
uint32_t depth; // only if DDS_HEADER_FLAGS_VOLUME is set in flags
uint32_t mipMapCount;
uint32_t reserved1[11];
DDS_PIXELFORMAT ddspf;
uint32_t caps;
uint32_t caps2;
uint32_t caps3;
uint32_t caps4;
uint32_t reserved2;
};
struct DDS_HEADER
{
uint32_t size;
uint32_t flags;
uint32_t height;
uint32_t width;
uint32_t pitchOrLinearSize;
uint32_t depth; // only if DDS_HEADER_FLAGS_VOLUME is set in flags
uint32_t mipMapCount;
uint32_t reserved1[11];
DDS_PIXELFORMAT ddspf;
uint32_t caps;
uint32_t caps2;
uint32_t caps3;
uint32_t caps4;
uint32_t reserved2;
};
struct DDS_HEADER_DXT10
{
DXGI_FORMAT dxgiFormat;
uint32_t resourceDimension;
uint32_t miscFlag; // see D3D11_RESOURCE_MISC_FLAG
uint32_t arraySize;
uint32_t miscFlags2;
};
struct DDS_HEADER_DXT10
{
DXGI_FORMAT dxgiFormat;
uint32_t resourceDimension;
uint32_t miscFlag; // see D3D11_RESOURCE_MISC_FLAG
uint32_t arraySize;
uint32_t miscFlags2;
};
#pragma pack(pop)
//--------------------------------------------------------------------------------------
namespace
{
static_assert(sizeof(DDS_PIXELFORMAT) == 32, "DDS pixel format size mismatch");
static_assert(sizeof(DDS_HEADER) == 124, "DDS Header size mismatch");
static_assert(sizeof(DDS_HEADER_DXT10) == 20, "DDS DX10 Extended Header size mismatch");
constexpr size_t DDS_MIN_HEADER_SIZE = sizeof(uint32_t) + sizeof(DDS_HEADER);
constexpr size_t DDS_DX10_HEADER_SIZE = sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10);
static_assert(DDS_DX10_HEADER_SIZE > DDS_MIN_HEADER_SIZE, "DDS DX10 Header should be larger than standard header");
//--------------------------------------------------------------------------------------
#ifdef _WIN32
struct handle_closer { void operator()(HANDLE h) noexcept { if (h) CloseHandle(h); } };
@ -165,18 +174,17 @@ namespace
inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
#endif
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
template<UINT TNameLength>
inline void SetDebugObjectName(_In_ ID3D12DeviceChild* resource, _In_z_ const wchar_t(&name)[TNameLength]) noexcept
{
resource->SetName(name);
}
#else
#else
template<UINT TNameLength>
inline void SetDebugObjectName(_In_ ID3D12DeviceChild*, _In_z_ const wchar_t(&)[TNameLength]) noexcept
{
}
#endif
{}
#endif
inline uint32_t CountMips(uint32_t width, uint32_t height) noexcept
{
@ -214,13 +222,13 @@ namespace
return E_FAIL;
}
if (ddsDataSize < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
if (ddsDataSize < DDS_MIN_HEADER_SIZE)
{
return E_FAIL;
}
// DDS files always start with the same magic number ("DDS ")
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
if (dwMagicNumber != DDS_MAGIC)
{
return E_FAIL;
@ -241,7 +249,7 @@ namespace
(MAKEFOURCC('D', 'X', '1', '0') == hdr->ddspf.fourCC))
{
// Must be long enough for both headers and magic value
if (ddsDataSize < (sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10)))
if (ddsDataSize < DDS_DX10_HEADER_SIZE)
{
return E_FAIL;
}
@ -251,8 +259,7 @@ namespace
// setup the pointers in the process request
*header = hdr;
auto offset = sizeof(uint32_t)
+ sizeof(DDS_HEADER)
auto offset = DDS_MIN_HEADER_SIZE
+ (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0u);
*bitData = ddsData + offset;
*bitSize = ddsDataSize - offset;
@ -302,7 +309,7 @@ namespace
}
// Need at least enough data to fill the header and magic number to be a valid DDS
if (fileInfo.EndOfFile.LowPart < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
if (fileInfo.EndOfFile.LowPart < DDS_MIN_HEADER_SIZE)
{
return E_FAIL;
}
@ -345,7 +352,7 @@ namespace
return E_FAIL;
// Need at least enough data to fill the header and magic number to be a valid DDS
if (fileLen < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
if (fileLen < DDS_MIN_HEADER_SIZE)
return E_FAIL;
ddsData.reset(new (std::nothrow) uint8_t[size_t(fileLen)]);
@ -372,7 +379,7 @@ namespace
#endif
// DDS files always start with the same magic number ("DDS ")
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
if (dwMagicNumber != DDS_MAGIC)
{
ddsData.reset();
@ -395,7 +402,7 @@ namespace
(MAKEFOURCC('D', 'X', '1', '0') == hdr->ddspf.fourCC))
{
// Must be long enough for both headers and magic value
if (len < (sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10)))
if (len < DDS_DX10_HEADER_SIZE)
{
ddsData.reset();
return E_FAIL;
@ -406,7 +413,7 @@ namespace
// setup the pointers in the process request
*header = hdr;
auto offset = sizeof(uint32_t) + sizeof(DDS_HEADER)
auto offset = DDS_MIN_HEADER_SIZE
+ (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0u);
*bitData = ddsData.get() + offset;
*bitSize = len - offset;
@ -573,7 +580,7 @@ namespace
_In_ size_t width,
_In_ size_t height,
_In_ DXGI_FORMAT fmt,
size_t* outNumBytes,
_Out_opt_ size_t* outNumBytes,
_Out_opt_ size_t* outRowBytes,
_Out_opt_ size_t* outNumRows) noexcept
{
@ -587,6 +594,9 @@ namespace
size_t bpe = 0;
switch (fmt)
{
case DXGI_FORMAT_UNKNOWN:
return E_INVALIDARG;
case DXGI_FORMAT_BC1_TYPELESS:
case DXGI_FORMAT_BC1_UNORM:
case DXGI_FORMAT_BC1_UNORM_SRGB:
@ -631,6 +641,15 @@ namespace
case DXGI_FORMAT_NV12:
case DXGI_FORMAT_420_OPAQUE:
if ((height % 2) != 0)
{
// Requires a height alignment of 2.
return E_INVALIDARG;
}
planar = true;
bpe = 2;
break;
case DXGI_FORMAT_P208:
planar = true;
bpe = 2;
@ -638,6 +657,11 @@ namespace
case DXGI_FORMAT_P010:
case DXGI_FORMAT_P016:
if ((height % 2) != 0)
{
// Requires a height alignment of 2.
return E_INVALIDARG;
}
planar = true;
bpe = 4;
break;
@ -816,6 +840,9 @@ namespace
// No 3:3:2 or paletted DXGI formats aka D3DFMT_R3G3B2, D3DFMT_P8
break;
default:
return DXGI_FORMAT_UNKNOWN;
}
}
else if (ddpf.flags & DDS_LUMINANCE)
@ -846,6 +873,9 @@ namespace
return DXGI_FORMAT_R8G8_UNORM; // Some DDS writers assume the bitcount should be 8 instead of 16
}
break;
default:
return DXGI_FORMAT_UNKNOWN;
}
}
else if (ddpf.flags & DDS_ALPHA)
@ -878,6 +908,9 @@ namespace
return DXGI_FORMAT_R8G8_SNORM; // D3DX10/11 writes this out as DX10 extension
}
break;
default:
return DXGI_FORMAT_UNKNOWN;
}
// No DXGI format maps to DDPF_BUMPLUMINANCE aka D3DFMT_L6V5U5, D3DFMT_X8L8V8U8
@ -978,6 +1011,9 @@ namespace
return DXGI_FORMAT_R32G32B32A32_FLOAT;
// No DXGI format maps to D3DFMT_CxV8U8
default:
return DXGI_FORMAT_UNKNOWN;
}
}
@ -1113,6 +1149,9 @@ namespace
res.SlicePitch = res.RowPitch * static_cast<LONG>(height);
}
break;
default:
break;
}
}
@ -1269,7 +1308,7 @@ namespace
&defaultHeapProperties,
D3D12_HEAP_FLAG_NONE,
&desc,
D3D12_RESOURCE_STATE_COPY_DEST,
D3D12_RESOURCE_STATE_COMMON,
nullptr,
IID_ID3D12Resource, reinterpret_cast<void**>(texture));
if (SUCCEEDED(hr))
@ -1325,12 +1364,48 @@ namespace
switch (d3d10ext->dxgiFormat)
{
case DXGI_FORMAT_NV12:
case DXGI_FORMAT_P010:
case DXGI_FORMAT_P016:
case DXGI_FORMAT_420_OPAQUE:
if ((d3d10ext->resourceDimension != D3D12_RESOURCE_DIMENSION_TEXTURE2D)
|| (width % 2) != 0 || (height % 2) != 0)
{
return HRESULT_E_NOT_SUPPORTED;
}
break;
case DXGI_FORMAT_YUY2:
case DXGI_FORMAT_Y210:
case DXGI_FORMAT_Y216:
case DXGI_FORMAT_P208:
if ((width % 2) != 0)
{
return HRESULT_E_NOT_SUPPORTED;
}
break;
case DXGI_FORMAT_NV11:
if ((width % 4) != 0)
{
return HRESULT_E_NOT_SUPPORTED;
}
break;
case DXGI_FORMAT_AI44:
case DXGI_FORMAT_IA44:
case DXGI_FORMAT_P8:
case DXGI_FORMAT_A8P8:
return HRESULT_E_NOT_SUPPORTED;
case DXGI_FORMAT_V208:
if ((d3d10ext->resourceDimension != D3D12_RESOURCE_DIMENSION_TEXTURE2D)
|| (height % 2) != 0)
{
return HRESULT_E_NOT_SUPPORTED;
}
break;
default:
if (BitsPerPixel(d3d10ext->dxgiFormat) == 0)
{
@ -1547,7 +1622,7 @@ namespace
if (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC)
{
auto d3d10ext = reinterpret_cast<const DDS_HEADER_DXT10*>(reinterpret_cast<const uint8_t*>(header) + sizeof(DDS_HEADER));
auto const mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
const auto mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
switch (mode)
{
case DDS_ALPHA_MODE_STRAIGHT:

View File

@ -68,6 +68,7 @@ namespace DirectX
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec"
#pragma clang diagnostic ignored "-Wextra-semi-stmt"
#endif
DEFINE_ENUM_FLAG_OPERATORS(DDS_LOADER_FLAGS);

View File

@ -20,6 +20,7 @@
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <memory>
#include <new>
@ -57,21 +58,23 @@ using Microsoft::WRL::ComPtr;
//
// See DDS.h in the 'Texconv' sample and the 'DirectXTex' library
//--------------------------------------------------------------------------------------
namespace
{
#pragma pack(push,1)
constexpr uint32_t DDS_MAGIC = 0x20534444; // "DDS "
constexpr uint32_t DDS_MAGIC = 0x20534444; // "DDS "
struct DDS_PIXELFORMAT
{
uint32_t size;
uint32_t flags;
uint32_t fourCC;
uint32_t RGBBitCount;
uint32_t RBitMask;
uint32_t GBitMask;
uint32_t BBitMask;
uint32_t ABitMask;
};
struct DDS_PIXELFORMAT
{
uint32_t size;
uint32_t flags;
uint32_t fourCC;
uint32_t RGBBitCount;
uint32_t RBitMask;
uint32_t GBitMask;
uint32_t BBitMask;
uint32_t ABitMask;
};
#define DDS_FOURCC 0x00000004 // DDPF_FOURCC
#define DDS_RGB 0x00000040 // DDPF_RGB
@ -90,34 +93,37 @@ struct DDS_PIXELFORMAT
#define DDS_CUBEMAP_NEGATIVEZ 0x00008200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ
#define DDS_CUBEMAP_ALLFACES ( DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX |\
DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
#define DDS_CUBEMAP 0x00000200 // DDSCAPS2_CUBEMAP
struct DDS_HEADER
{
uint32_t size;
uint32_t flags;
uint32_t height;
uint32_t width;
uint32_t pitchOrLinearSize;
uint32_t depth; // only if DDS_HEADER_FLAGS_VOLUME is set in flags
uint32_t mipMapCount;
uint32_t reserved1[11];
DDS_PIXELFORMAT ddspf;
uint32_t caps;
uint32_t caps2;
uint32_t caps3;
uint32_t caps4;
uint32_t reserved2;
};
struct DDS_HEADER
{
uint32_t size;
uint32_t flags;
uint32_t height;
uint32_t width;
uint32_t pitchOrLinearSize;
uint32_t depth; // only if DDS_HEADER_FLAGS_VOLUME is set in flags
uint32_t mipMapCount;
uint32_t reserved1[11];
DDS_PIXELFORMAT ddspf;
uint32_t caps;
uint32_t caps2;
uint32_t caps3;
uint32_t caps4;
uint32_t reserved2;
};
#pragma pack(pop)
//--------------------------------------------------------------------------------------
namespace
{
static_assert(sizeof(DDS_PIXELFORMAT) == 32, "DDS pixel format size mismatch");
static_assert(sizeof(DDS_HEADER) == 124, "DDS Header size mismatch");
constexpr size_t DDS_DX9_HEADER_SIZE = sizeof(uint32_t) + sizeof(DDS_HEADER);
//--------------------------------------------------------------------------------------
struct handle_closer { void operator()(HANDLE h) noexcept { if (h) CloseHandle(h); } };
using ScopedHandle = std::unique_ptr<void, handle_closer>;
@ -144,13 +150,13 @@ namespace
return E_FAIL;
}
if (ddsDataSize < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
if (ddsDataSize < DDS_DX9_HEADER_SIZE)
{
return E_FAIL;
}
// DDS files always start with the same magic number ("DDS ")
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
if (dwMagicNumber != DDS_MAGIC)
{
return E_FAIL;
@ -175,9 +181,8 @@ namespace
// setup the pointers in the process request
*header = hdr;
auto offset = sizeof(uint32_t) + sizeof(DDS_HEADER);
*bitData = ddsData + offset;
*bitSize = ddsDataSize - offset;
*bitData = ddsData + DDS_DX9_HEADER_SIZE;
*bitSize = ddsDataSize - DDS_DX9_HEADER_SIZE;
return S_OK;
}
@ -199,22 +204,10 @@ namespace
*bitSize = 0;
// open the file
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(fileName,
GENERIC_READ,
FILE_SHARE_READ,
OPEN_EXISTING,
ScopedHandle hFile(safe_handle(CreateFile2(
fileName,
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
#else
ScopedHandle hFile(safe_handle(CreateFileW(fileName,
GENERIC_READ,
FILE_SHARE_READ,
nullptr,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
nullptr)));
#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@ -234,7 +227,7 @@ namespace
}
// Need at least enough data to fill the header and magic number to be a valid DDS
if (fileInfo.EndOfFile.LowPart < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
if (fileInfo.EndOfFile.LowPart < DDS_DX9_HEADER_SIZE)
{
return E_FAIL;
}
@ -266,7 +259,7 @@ namespace
}
// DDS files always start with the same magic number ("DDS ")
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
if (dwMagicNumber != DDS_MAGIC)
{
ddsData.reset();
@ -294,9 +287,8 @@ namespace
// setup the pointers in the process request
*header = hdr;
auto offset = sizeof(uint32_t) + sizeof(DDS_HEADER);
*bitData = ddsData.get() + offset;
*bitSize = fileInfo.EndOfFile.LowPart - offset;
*bitData = ddsData.get() + DDS_DX9_HEADER_SIZE;
*bitSize = fileInfo.EndOfFile.LowPart - DDS_DX9_HEADER_SIZE;
return S_OK;
}
@ -412,7 +404,7 @@ namespace
_In_ size_t width,
_In_ size_t height,
_In_ D3DFORMAT fmt,
size_t* outNumBytes,
_Out_opt_ size_t* outNumBytes,
_Out_opt_ size_t* outRowBytes,
_Out_opt_ size_t* outNumRows) noexcept
{
@ -425,6 +417,9 @@ namespace
size_t bpe = 0;
switch (static_cast<int>(fmt))
{
case D3DFMT_UNKNOWN:
return E_INVALIDARG;
case D3DFMT_DXT1:
bc = true;
bpe = 8;
@ -620,6 +615,9 @@ namespace
// Paletted texture formats are typically not supported on modern video cards aka D3DFMT_P8, D3DFMT_A8P8
break;
default:
return D3DFMT_UNKNOWN;
}
}
else if (ddpf.flags & DDS_LUMINANCE)
@ -651,6 +649,9 @@ namespace
return D3DFMT_A8L8; // Some DDS writers assume the bitcount should be 8 instead of 16
}
break;
default:
return D3DFMT_UNKNOWN;
}
}
else if (ddpf.flags & DDS_ALPHA)
@ -685,6 +686,9 @@ namespace
return D3DFMT_V8U8;
}
break;
default:
return D3DFMT_UNKNOWN;
}
}
else if (ddpf.flags & DDS_BUMPLUMINANCE)
@ -704,6 +708,9 @@ namespace
return D3DFMT_L6V5U5;
}
break;
default:
return D3DFMT_UNKNOWN;
}
}
else if (ddpf.flags & DDS_FOURCC)
@ -760,6 +767,9 @@ namespace
case D3DFMT_A32B32G32R32F:
case D3DFMT_CxV8U8:
return static_cast<D3DFORMAT>(ddpf.fourCC);
default:
return D3DFMT_UNKNOWN;
}
}

View File

@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_MAIN_ICON ICON "directx.ico"
IDI_MAIN_ICON ICON "..\\Common\\directx.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////

View File

@ -135,7 +135,7 @@
<FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
@ -146,6 +146,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LargeAddressAware>true</LargeAddressAware>
<AdditionalOptions>/CETCOMPAT %(AdditionalOptions)</AdditionalOptions>
</Link>
<Manifest>
<EnableDPIAwareness>false</EnableDPIAwareness>
@ -158,7 +159,7 @@
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
@ -168,6 +169,7 @@
<AdditionalDependencies>d3d11.lib;ole32.lib;windowscodecs.lib;uuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalOptions>/CETCOMPAT %(AdditionalOptions)</AdditionalOptions>
</Link>
<Manifest>
<EnableDPIAwareness>false</EnableDPIAwareness>
@ -180,7 +182,7 @@
<FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ControlFlowGuard>Guard</ControlFlowGuard>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
@ -194,6 +196,7 @@
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LargeAddressAware>true</LargeAddressAware>
<AdditionalOptions>/CETCOMPAT %(AdditionalOptions)</AdditionalOptions>
</Link>
<Manifest>
<EnableDPIAwareness>false</EnableDPIAwareness>
@ -205,7 +208,7 @@
<Optimization>MaxSpeed</Optimization>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ControlFlowGuard>Guard</ControlFlowGuard>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
@ -218,6 +221,7 @@
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<AdditionalOptions>/CETCOMPAT %(AdditionalOptions)</AdditionalOptions>
</Link>
<Manifest>
<EnableDPIAwareness>false</EnableDPIAwareness>
@ -230,7 +234,7 @@
<FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ControlFlowGuard>Guard</ControlFlowGuard>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
@ -244,6 +248,7 @@
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LargeAddressAware>true</LargeAddressAware>
<AdditionalOptions>/CETCOMPAT %(AdditionalOptions)</AdditionalOptions>
</Link>
<Manifest>
<EnableDPIAwareness>false</EnableDPIAwareness>
@ -255,7 +260,7 @@
<Optimization>MaxSpeed</Optimization>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ControlFlowGuard>Guard</ControlFlowGuard>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
@ -268,6 +273,7 @@
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<AdditionalOptions>/CETCOMPAT %(AdditionalOptions)</AdditionalOptions>
</Link>
<Manifest>
<EnableDPIAwareness>false</EnableDPIAwareness>
@ -285,7 +291,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="ddsview.fx" />
<None Include="ddsview.hlsl" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
@ -294,10 +300,13 @@
<_ATGFXCPath>$(WindowsSDK_ExecutablePath_x64.Split(';')[0])</_ATGFXCPath>
<_ATGFXCPath>$(_ATGFXCPath.Replace("x64",""))</_ATGFXCPath>
<_ATGFXCPath Condition="'$(_ATGFXCPath)' != '' and !HasTrailingSlash('$(_ATGFXCPath)')">$(_ATGFXCPath)\</_ATGFXCPath>
<_ATGFXCVer>$([System.Text.RegularExpressions.Regex]::Match($(_ATGFXCPath), `10\.0\.\d+\.0`))</_ATGFXCVer>
<_ATGFXCVer Condition="'$(_ATGFXCVer)' != '' and !HasTrailingSlash('$(_ATGFXCVer)')">$(_ATGFXCVer)\</_ATGFXCVer>
</PropertyGroup>
<Exec Condition="!Exists('Shaders/ddsview_vs.inc')" WorkingDirectory="$(ProjectDir)" Command="hlsl" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath)" />
<Exec Condition="!Exists('Shaders/ddsview_vs.inc')" WorkingDirectory="$(ProjectDir)" Command="hlsl" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);WindowsSDKVersion=$(_ATGFXCVer);CompileShadersOutput=$(ProjectDir)\Shaders" LogStandardErrorAsError="true" />
<PropertyGroup>
<_ATGFXCPath />
<_ATGFXCVer />
</PropertyGroup>
</Target>
<Target Name="ATGDeleteShaders" AfterTargets="Clean">

View File

@ -15,6 +15,6 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="ddsview.fx" />
<None Include="ddsview.hlsl" />
</ItemGroup>
</Project>

View File

@ -135,7 +135,7 @@
<FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -159,7 +159,7 @@
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
@ -182,7 +182,7 @@
<FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ControlFlowGuard>Guard</ControlFlowGuard>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
@ -208,7 +208,7 @@
<Optimization>MaxSpeed</Optimization>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ControlFlowGuard>Guard</ControlFlowGuard>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
@ -234,7 +234,7 @@
<FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ControlFlowGuard>Guard</ControlFlowGuard>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
@ -260,7 +260,7 @@
<Optimization>MaxSpeed</Optimization>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ControlFlowGuard>Guard</ControlFlowGuard>
<ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck>
@ -291,7 +291,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="ddsview.fx" />
<None Include="ddsview.hlsl" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
@ -300,10 +300,13 @@
<_ATGFXCPath>$(WindowsSDK_ExecutablePath_x64.Split(';')[0])</_ATGFXCPath>
<_ATGFXCPath>$(_ATGFXCPath.Replace("x64",""))</_ATGFXCPath>
<_ATGFXCPath Condition="'$(_ATGFXCPath)' != '' and !HasTrailingSlash('$(_ATGFXCPath)')">$(_ATGFXCPath)\</_ATGFXCPath>
<_ATGFXCVer>$([System.Text.RegularExpressions.Regex]::Match($(_ATGFXCPath), `10\.0\.\d+\.0`))</_ATGFXCVer>
<_ATGFXCVer Condition="'$(_ATGFXCVer)' != '' and !HasTrailingSlash('$(_ATGFXCVer)')">$(_ATGFXCVer)\</_ATGFXCVer>
</PropertyGroup>
<Exec Condition="!Exists('Shaders/ddsview_vs.inc')" WorkingDirectory="$(ProjectDir)" Command="hlsl" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath)" />
<Exec Condition="!Exists('Shaders/ddsview_vs.inc')" WorkingDirectory="$(ProjectDir)" Command="hlsl" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);WindowsSDKVersion=$(_ATGFXCVer);CompileShadersOutput=$(ProjectDir)\Shaders" LogStandardErrorAsError="true" />
<PropertyGroup>
<_ATGFXCPath />
<_ATGFXCVer />
</PropertyGroup>
</Target>
<Target Name="ATGDeleteShaders" AfterTargets="Clean">

View File

@ -15,6 +15,6 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="ddsview.fx" />
<None Include="ddsview.hlsl" />
</ItemGroup>
</Project>

View File

@ -25,10 +25,14 @@
#include <DirectXMath.h>
#ifdef _MSC_VER
#pragma warning(disable : 4619 4616 26812)
#endif
#include "DirectXTex.h"
#include <shellapi.h>
using namespace DirectX;
//--------------------------------------------------------------------------------------
@ -69,21 +73,21 @@ namespace
HWND g_hWnd = nullptr;
D3D_DRIVER_TYPE g_driverType = D3D_DRIVER_TYPE_NULL;
D3D_FEATURE_LEVEL g_featureLevel = D3D_FEATURE_LEVEL_11_0;
ID3D11Device* g_pd3dDevice = nullptr;
ID3D11DeviceContext* g_pImmediateContext = nullptr;
IDXGISwapChain* g_pSwapChain = nullptr;
ID3D11RenderTargetView* g_pRenderTargetView = nullptr;
ID3D11Texture2D* g_pDepthStencil = nullptr;
ID3D11DepthStencilView* g_pDepthStencilView = nullptr;
ID3D11VertexShader* g_pVertexShader = nullptr;
ID3D11PixelShader* g_pPixelShader = nullptr;
ID3D11InputLayout* g_pVertexLayout = nullptr;
ID3D11Buffer* g_pVertexBuffer = nullptr;
ID3D11Buffer* g_pIndexBuffer = nullptr;
ID3D11Buffer* g_pCBArrayControl = nullptr;
ID3D11ShaderResourceView* g_pSRV = nullptr;
ID3D11BlendState* g_AlphaBlendState = nullptr;
ID3D11SamplerState* g_pSamplerLinear = nullptr;
ID3D11Device* g_pd3dDevice = nullptr;
ID3D11DeviceContext* g_pImmediateContext = nullptr;
IDXGISwapChain* g_pSwapChain = nullptr;
ID3D11RenderTargetView* g_pRenderTargetView = nullptr;
ID3D11Texture2D* g_pDepthStencil = nullptr;
ID3D11DepthStencilView* g_pDepthStencilView = nullptr;
ID3D11VertexShader* g_pVertexShader = nullptr;
ID3D11PixelShader* g_pPixelShader = nullptr;
ID3D11InputLayout* g_pVertexLayout = nullptr;
ID3D11Buffer* g_pVertexBuffer = nullptr;
ID3D11Buffer* g_pIndexBuffer = nullptr;
ID3D11Buffer* g_pCBArrayControl = nullptr;
ID3D11ShaderResourceView* g_pSRV = nullptr;
ID3D11BlendState* g_AlphaBlendState = nullptr;
ID3D11SamplerState* g_pSamplerLinear = nullptr;
UINT g_iCurrentIndex = 0;
UINT g_iMaxIndex = 1;
@ -101,38 +105,68 @@ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
void Render();
//--------------------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning( suppress : 6262 )
#endif
int WINAPI wWinMain(
_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE /*hPrevInstance*/,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
static const wchar_t* c_usage = L"Usage: ddsview [-forcesrgb] <filename>";
if (!*lpCmdLine)
{
MessageBoxW(nullptr, L"Usage: ddsview <filename>", g_szAppName, MB_OK | MB_ICONEXCLAMATION);
MessageBoxW(nullptr, c_usage, g_szAppName, MB_OK | MB_ICONEXCLAMATION);
return 0;
}
int argc = 0;
auto argList = CommandLineToArgvW(lpCmdLine, &argc);
const wchar_t* filename = nullptr;
bool forceSRGB = false;
for(int i = 0; i < argc; ++i)
{
if (*argList[i] == '-' || *argList[i] == '/')
{
if (_wcsicmp(argList[i]+1, L"forcesrgb") == 0)
{
forceSRGB = true;
}
}
else if (!filename)
{
filename = argList[i];
}
}
if (!filename)
{
MessageBoxW(nullptr, c_usage, g_szAppName, MB_OK | MB_ICONEXCLAMATION);
return 1;
}
TexMetadata mdata;
HRESULT hr = GetMetadataFromDDSFile(lpCmdLine, DDS_FLAGS_NONE, mdata);
HRESULT hr = GetMetadataFromDDSFile(filename, DDS_FLAGS_NONE, mdata);
if (FAILED(hr))
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"Failed to open texture file\n\nFilename = %ls\nHRESULT %08X", lpCmdLine, static_cast<unsigned int>(hr));
swprintf_s(buff, L"Failed to open texture file\n\nFilename = %ls\nHRESULT %08X", filename, static_cast<unsigned int>(hr));
MessageBoxW(nullptr, buff, g_szAppName, MB_OK | MB_ICONEXCLAMATION);
return 0;
return 1;
}
if (FAILED(InitWindow(hInstance, nCmdShow, mdata)))
return 0;
return 1;
SetWindowTextW(g_hWnd, lpCmdLine);
SetWindowTextW(g_hWnd, filename);
if (FAILED(InitDevice(mdata)))
{
CleanupDevice();
return 0;
return 1;
}
if (mdata.dimension == TEX_DIMENSION_TEXTURE3D)
@ -140,9 +174,9 @@ int WINAPI wWinMain(
if (mdata.arraySize > 1)
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"Arrays of volume textures are not supported\n\nFilename = %ls\nArray size %zu", lpCmdLine, mdata.arraySize);
swprintf_s(buff, L"Arrays of volume textures are not supported\n\nFilename = %ls\nArray size %zu", filename, mdata.arraySize);
MessageBoxW(nullptr, buff, g_szAppName, MB_OK | MB_ICONEXCLAMATION);
return 0;
return 1;
}
g_iMaxIndex = static_cast<UINT>(mdata.depth);
@ -152,9 +186,9 @@ int WINAPI wWinMain(
if (g_featureLevel < D3D_FEATURE_LEVEL_10_0)
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"Texture arrays require DirectX 10 hardware or later\n\nFilename = %ls\nArray size %zu", lpCmdLine, mdata.arraySize);
swprintf_s(buff, L"Texture arrays require DirectX 10 hardware or later\n\nFilename = %ls\nArray size %zu", filename, mdata.arraySize);
MessageBoxW(nullptr, buff, g_szAppName, MB_OK | MB_ICONEXCLAMATION);
return 0;
return 1;
}
g_iMaxIndex = static_cast<UINT>(mdata.arraySize);
@ -171,9 +205,9 @@ int WINAPI wWinMain(
if (g_featureLevel < D3D_FEATURE_LEVEL_10_0)
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"BC4/BC5 requires DirectX 10 hardware or later\n\nFilename = %ls\nDXGI Format %d\nFeature Level %d", lpCmdLine, mdata.format, g_featureLevel);
swprintf_s(buff, L"BC4/BC5 requires DirectX 10 hardware or later\n\nFilename = %ls\nDXGI Format %d\nFeature Level %d", filename, mdata.format, g_featureLevel);
MessageBoxW(nullptr, buff, g_szAppName, MB_OK | MB_ICONEXCLAMATION);
return 0;
return 1;
}
break;
@ -186,9 +220,9 @@ int WINAPI wWinMain(
if (g_featureLevel < D3D_FEATURE_LEVEL_11_0)
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"BC6H/BC7 requires DirectX 11 hardware or later\n\nFilename = %ls\nDXGI Format %d\nFeature Level %d", lpCmdLine, mdata.format, g_featureLevel);
swprintf_s(buff, L"BC6H/BC7 requires DirectX 11 hardware or later\n\nFilename = %ls\nDXGI Format %d\nFeature Level %d", filename, mdata.format, g_featureLevel);
MessageBoxW(nullptr, buff, g_szAppName, MB_OK | MB_ICONEXCLAMATION);
return 0;
return 1;
}
break;
@ -200,34 +234,40 @@ int WINAPI wWinMain(
if (FAILED(hr) || !(flags & required))
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"Format not supported by this DirectX hardware\n\nFilename = %ls\nDXGI Format %d\nFeature Level %d\nHRESULT = %08X", lpCmdLine, mdata.format, g_featureLevel, static_cast<unsigned int>(hr));
swprintf_s(buff, L"Format not supported by this DirectX hardware\n\nFilename = %ls\nDXGI Format %d\nFeature Level %d\nHRESULT = %08X", filename, mdata.format, g_featureLevel, static_cast<unsigned int>(hr));
MessageBoxW(nullptr, buff, g_szAppName, MB_OK | MB_ICONEXCLAMATION);
return 0;
return 1;
}
}
break;
}
ScratchImage image;
hr = LoadFromDDSFile(lpCmdLine, DDS_FLAGS_NONE, &mdata, image);
hr = LoadFromDDSFile(filename, DDS_FLAGS_NONE, &mdata, image);
if (FAILED(hr))
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"Failed to load texture file\n\nFilename = %ls\nHRESULT %08X", lpCmdLine, static_cast<unsigned int>(hr));
swprintf_s(buff, L"Failed to load texture file\n\nFilename = %ls\nHRESULT %08X", filename, static_cast<unsigned int>(hr));
MessageBoxW(nullptr, buff, g_szAppName, MB_OK | MB_ICONEXCLAMATION);
return 0;
return 1;
}
// Special case to make sure Texture cubes remain arrays
mdata.miscFlags &= ~TEX_MISC_TEXTURECUBE;
if (forceSRGB)
{
mdata.format = MakeSRGB(mdata.format);
image.OverrideFormat(mdata.format);
}
hr = CreateShaderResourceView(g_pd3dDevice, image.GetImages(), image.GetImageCount(), mdata, &g_pSRV);
if (FAILED(hr))
{
wchar_t buff[2048] = {};
swprintf_s(buff, L"Failed creating texture from file\n\nFilename = %ls\nHRESULT = %08X", lpCmdLine, static_cast<unsigned int>(hr));
swprintf_s(buff, L"Failed creating texture from file\n\nFilename = %ls\nHRESULT = %08X", filename, static_cast<unsigned int>(hr));
MessageBoxW(nullptr, buff, g_szAppName, MB_OK | MB_ICONEXCLAMATION);
return 0;
return 1;
}
// Main message loop

View File

@ -5,16 +5,25 @@ rem Licensed under the MIT License.
setlocal
set error=0
if %PROCESSOR_ARCHITECTURE%.==ARM64. (set FXCARCH=arm64) else (if %PROCESSOR_ARCHITECTURE%.==AMD64. (set FXCARCH=x64) else (set FXCARCH=x86))
set FXCOPTS=/nologo /WX /Ges /Qstrip_reflect /Qstrip_debug
set PCFXC="%WindowsSdkVerBinPath%x86\fxc.exe"
if defined LegacyShaderCompiler goto fxcviaenv
set PCFXC="%WindowsSdkVerBinPath%%FXCARCH%\fxc.exe"
if exist %PCFXC% goto continue
set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\x86\fxc.exe"
set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\%FXCARCH%\fxc.exe"
if exist %PCFXC% goto continue
set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\x86\fxc.exe"
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=Shaders
@ -23,45 +32,50 @@ set StrTrim=%StrTrim: ##=%
set CompileShadersOutput=%StrTrim:##=%
@if not exist "%CompileShadersOutput%" mkdir "%CompileShadersOutput%"
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EVS /Tvs_4_1 /Fh%CompileShadersOutput%\ddsview_vs.inc
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EVS /Tvs_4_1 /Fh%CompileShadersOutput%\ddsview_vs.inc
echo %FXC%
%FXC%
@if ERRORLEVEL 1 goto error
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_1D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1D.inc
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_1D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1D.inc
echo %FXC%
%FXC%
@if ERRORLEVEL 1 goto error
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_1DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1Darray.inc
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_1DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1Darray.inc
echo %FXC%
%FXC%
@if ERRORLEVEL 1 goto error
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_2D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2D.inc
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_2D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2D.inc
echo %FXC%
%FXC%
@if ERRORLEVEL 1 goto error
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_2DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2Darray.inc
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_2DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2Darray.inc
echo %FXC%
%FXC%
@if ERRORLEVEL 1 goto error
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_3D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps3D.inc
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_3D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps3D.inc
echo %FXC%
%FXC%
@if ERRORLEVEL 1 goto error
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_Cube /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_psCube.inc
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_Cube /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_psCube.inc
echo %FXC%
%FXC%
@if ERRORLEVEL 1 goto error
@echo --- Shaders built ok ---
@goto end
endlocal
exit /b 0
:error
@echo --- ERROR: Shader build failed ---
exit /b 1
:end
:needfxc
echo ERROR: CompileShaders requires FXC.EXE
exit /b 1
:end

View File

@ -203,7 +203,7 @@ namespace
}
// Use Newton's Method to find local minima of sum-of-squares error.
auto const fSteps = static_cast<float>(cSteps - 1);
const auto fSteps = static_cast<float>(cSteps - 1);
for (size_t iIteration = 0; iIteration < 8; iIteration++)
{
@ -1032,8 +1032,8 @@ void DirectX::D3DXEncodeBC3(uint8_t *pBC, const XMVECTOR *pColor, uint32_t flags
float fAlphaA, fAlphaB;
OptimizeAlpha<false>(&fAlphaA, &fAlphaB, fAlpha, uSteps);
auto const bAlphaA = static_cast<uint8_t>(static_cast<int32_t>(fAlphaA * 255.0f + 0.5f));
auto const bAlphaB = static_cast<uint8_t>(static_cast<int32_t>(fAlphaB * 255.0f + 0.5f));
const auto bAlphaA = static_cast<uint8_t>(static_cast<int32_t>(fAlphaA * 255.0f + 0.5f));
const auto bAlphaB = static_cast<uint8_t>(static_cast<int32_t>(fAlphaB * 255.0f + 0.5f));
fAlphaA = static_cast<float>(bAlphaA) * (1.0f / 255.0f);
fAlphaB = static_cast<float>(bAlphaB) * (1.0f / 255.0f);
@ -1084,7 +1084,7 @@ void DirectX::D3DXEncodeBC3(uint8_t *pBC, const XMVECTOR *pColor, uint32_t flags
}
// Encode alpha bitmap
auto const fSteps = static_cast<float>(uSteps - 1);
const auto fSteps = static_cast<float>(uSteps - 1);
const float fScale = (fStep[0] != fStep[1]) ? (fSteps / (fStep[1] - fStep[0])) : 0.0f;
if (flags & BC_FLAGS_DITHER_A)

View File

@ -61,6 +61,12 @@ namespace DirectX
HDRColorA() = default;
HDRColorA(float _r, float _g, float _b, float _a) noexcept : r(_r), g(_g), b(_b), a(_a) {}
HDRColorA(HDRColorA const&) = default;
HDRColorA& operator= (const HDRColorA&) = default;
HDRColorA(HDRColorA&&) = default;
HDRColorA& operator= (HDRColorA&&) = default;
// binary operators
HDRColorA operator + (const HDRColorA& c) const noexcept
{
@ -224,7 +230,7 @@ namespace DirectX
}
// Use Newton's Method to find local minima of sum-of-squares error.
auto const fSteps = static_cast<float>(cSteps - 1);
const auto fSteps = static_cast<float>(cSteps - 1);
for (size_t iIteration = 0; iIteration < 8; iIteration++)
{

View File

@ -339,6 +339,12 @@ namespace DirectX
LDRColorA() = default;
LDRColorA(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a) noexcept : r(_r), g(_g), b(_b), a(_a) {}
LDRColorA(LDRColorA const&) = default;
LDRColorA& operator= (const LDRColorA&) = default;
LDRColorA(LDRColorA&&) = default;
LDRColorA& operator= (LDRColorA&&) = default;
const uint8_t& operator [] (_In_range_(0, 3) size_t uElement) const noexcept
{
switch (uElement)
@ -449,10 +455,15 @@ namespace
int r, g, b;
int pad;
public:
INTColor() = default;
INTColor(int nr, int ng, int nb) noexcept : r(nr), g(ng), b(nb), pad(0) {}
INTColor(INTColor const&) = default;
INTColor& operator= (const INTColor&) = default;
INTColor(INTColor&&) = default;
INTColor& operator= (INTColor&&) = default;
INTColor& operator += (_In_ const INTColor& c) noexcept
{
r += c.r;
@ -582,7 +593,7 @@ namespace
assert(uStartBit < 128);
_Analysis_assume_(uStartBit < 128);
const size_t uIndex = uStartBit >> 3;
auto const ret = static_cast<uint8_t>((m_uBits[uIndex] >> (uStartBit - (uIndex << 3))) & 0x01);
const auto ret = static_cast<uint8_t>((m_uBits[uIndex] >> (uStartBit - (uIndex << 3))) & 0x01);
uStartBit++;
return ret;
}
@ -1057,37 +1068,37 @@ const D3DX_BC6H::ModeInfo D3DX_BC6H::ms_aInfo[D3DX_BC6H::c_NumModes] =
const int D3DX_BC6H::ms_aModeToInfo[D3DX_BC6H::c_NumModeInfo] =
{
0, // Mode 1 - 0x00
1, // Mode 2 - 0x01
2, // Mode 3 - 0x02
0, // Mode 1 - 0x00
1, // Mode 2 - 0x01
2, // Mode 3 - 0x02
10, // Mode 11 - 0x03
-1, // Invalid - 0x04
-1, // Invalid - 0x05
3, // Mode 4 - 0x06
3, // Mode 4 - 0x06
11, // Mode 12 - 0x07
-1, // Invalid - 0x08
-1, // Invalid - 0x09
4, // Mode 5 - 0x0a
4, // Mode 5 - 0x0a
12, // Mode 13 - 0x0b
-1, // Invalid - 0x0c
-1, // Invalid - 0x0d
5, // Mode 6 - 0x0e
5, // Mode 6 - 0x0e
13, // Mode 14 - 0x0f
-1, // Invalid - 0x10
-1, // Invalid - 0x11
6, // Mode 7 - 0x12
6, // Mode 7 - 0x12
-1, // Reserved - 0x13
-1, // Invalid - 0x14
-1, // Invalid - 0x15
7, // Mode 8 - 0x16
7, // Mode 8 - 0x16
-1, // Reserved - 0x17
-1, // Invalid - 0x18
-1, // Invalid - 0x19
8, // Mode 9 - 0x1a
8, // Mode 9 - 0x1a
-1, // Reserved - 0x1b
-1, // Invalid - 0x1c
-1, // Invalid - 0x1d
9, // Mode 10 - 0x1e
9, // Mode 10 - 0x1e
-1, // Resreved - 0x1f
};
@ -1184,7 +1195,7 @@ namespace
//-------------------------------------------------------------------------------------
float OptimizeRGB(
void OptimizeRGB(
_In_reads_(NUM_PIXELS_PER_BLOCK) const HDRColorA* const pPoints,
_Out_ HDRColorA* pX,
_Out_ HDRColorA* pY,
@ -1192,7 +1203,6 @@ namespace
size_t cPixels,
_In_reads_(cPixels) const size_t* pIndex) noexcept
{
constexpr float fError = FLT_MAX;
const float *pC = (3 == cSteps) ? pC3 : pC4;
const float *pD = (3 == cSteps) ? pD3 : pD4;
@ -1223,7 +1233,7 @@ namespace
{
pX->r = X.r; pX->g = X.g; pX->b = X.b;
pY->r = Y.r; pY->g = Y.g; pY->b = Y.b;
return 0.0f;
return;
}
// Try all four axis directions, to determine which diagonal best fits data
@ -1276,11 +1286,11 @@ namespace
{
pX->r = X.r; pX->g = X.g; pX->b = X.b;
pY->r = Y.r; pY->g = Y.g; pY->b = Y.b;
return 0.0f;
return;
}
// Use Newton's Method to find local minima of sum-of-squares error.
auto const fSteps = static_cast<float>(cSteps - 1);
const auto fSteps = static_cast<float>(cSteps - 1);
for (size_t iIteration = 0; iIteration < 8; iIteration++)
{
@ -1375,12 +1385,11 @@ namespace
pX->r = X.r; pX->g = X.g; pX->b = X.b;
pY->r = Y.r; pY->g = Y.g; pY->b = Y.b;
return fError;
}
//-------------------------------------------------------------------------------------
float OptimizeRGBA(
void OptimizeRGBA(
_In_reads_(NUM_PIXELS_PER_BLOCK) const HDRColorA* const pPoints,
_Out_ HDRColorA* pX,
_Out_ HDRColorA* pY,
@ -1388,7 +1397,6 @@ namespace
size_t cPixels,
_In_reads_(cPixels) const size_t* pIndex) noexcept
{
constexpr float fError = FLT_MAX;
const float *pC = (3 == cSteps) ? pC3 : pC4;
const float *pD = (3 == cSteps) ? pD3 : pD4;
@ -1417,7 +1425,7 @@ namespace
{
*pX = X;
*pY = Y;
return 0.0f;
return;
}
// Try all four axis directions, to determine which diagonal best fits data
@ -1468,13 +1476,13 @@ namespace
{
*pX = X;
*pY = Y;
return 0.0f;
return;
}
// Use Newton's Method to find local minima of sum-of-squares error.
const auto fSteps = static_cast<float>(cSteps - 1u);
for (size_t iIteration = 0; iIteration < 8 && fError > 0.0f; iIteration++)
for (size_t iIteration = 0; iIteration < 8; iIteration++)
{
// Calculate new steps
HDRColorA pSteps[BC7_MAX_INDICES];
@ -1544,7 +1552,6 @@ namespace
*pX = X;
*pY = Y;
return fError;
}
@ -1696,7 +1703,7 @@ void D3DX_BC6H::Decode(bool bSigned, HDRColorA* pOut) const noexcept
case BZ: aEndPts[1].B.b |= 1 << uint32_t(desc[uCurBit].m_uBit); break;
default:
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC6H: Invalid header bits encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -1740,7 +1747,7 @@ void D3DX_BC6H::Decode(bool bSigned, HDRColorA* pOut) const noexcept
const size_t uNumBits = IsFixUpOffset(info.uPartitions, uShape, i) ? info.uIndexPrec - 1u : info.uIndexPrec;
if (uStartBit + uNumBits > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC6H: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -1750,7 +1757,7 @@ void D3DX_BC6H::Decode(bool bSigned, HDRColorA* pOut) const noexcept
if (uIndex >= ((info.uPartitions > 0) ? 8 : 16))
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC6H: Invalid index encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -1785,7 +1792,7 @@ void D3DX_BC6H::Decode(bool bSigned, HDRColorA* pOut) const noexcept
}
else
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
const char* warnstr = "BC6H: Invalid mode encountered during decoding\n";
switch (uMode)
{
@ -1793,6 +1800,7 @@ void D3DX_BC6H::Decode(bool bSigned, HDRColorA* pOut) const noexcept
case 0x17: warnstr = "BC6H: Reserved mode 10111 encountered during decoding\n"; break;
case 0x1B: warnstr = "BC6H: Reserved mode 11011 encountered during decoding\n"; break;
case 0x1F: warnstr = "BC6H: Reserved mode 11111 encountered during decoding\n"; break;
default: break;
}
OutputDebugStringA(warnstr);
#endif
@ -2040,7 +2048,7 @@ float D3DX_BC6H::MapColorsQuantized(const EncodeParams* pEP, const INTColor aCol
_Analysis_assume_(pEP->uMode < c_NumModes);
const uint8_t uIndexPrec = ms_aInfo[pEP->uMode].uIndexPrec;
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
INTColor aPalette[BC6H_MAX_INDICES];
GeneratePaletteQuantized(pEP, endPts, aPalette);
@ -2256,7 +2264,7 @@ void D3DX_BC6H::AssignIndices(const EncodeParams* pEP, const INTEndPntPair aEndP
_Analysis_assume_(pEP->uMode < c_NumModes);
const uint8_t uPartitions = ms_aInfo[pEP->uMode].uPartitions;
auto const uNumIndices = static_cast<const uint8_t>(1u << ms_aInfo[pEP->uMode].uIndexPrec);
const auto uNumIndices = static_cast<const uint8_t>(1u << ms_aInfo[pEP->uMode].uIndexPrec);
assert(uPartitions < BC6H_MAX_REGIONS && pEP->uShape < BC6H_MAX_SHAPES);
_Analysis_assume_(uPartitions < BC6H_MAX_REGIONS && pEP->uShape < BC6H_MAX_SHAPES);
@ -2429,7 +2437,7 @@ void D3DX_BC6H::GeneratePaletteUnquantized(const EncodeParams* pEP, size_t uRegi
const INTEndPntPair& endPts = pEP->aUnqEndPts[pEP->uShape][uRegion];
const uint8_t uIndexPrec = ms_aInfo[pEP->uMode].uIndexPrec;
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
assert(uNumIndices > 0);
_Analysis_assume_(uNumIndices > 0);
@ -2465,7 +2473,7 @@ float D3DX_BC6H::MapColors(const EncodeParams* pEP, size_t uRegion, size_t np, c
_Analysis_assume_(pEP->uMode < c_NumModes);
const uint8_t uIndexPrec = ms_aInfo[pEP->uMode].uIndexPrec;
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
INTColor aPalette[BC6H_MAX_INDICES];
GeneratePaletteUnquantized(pEP, uRegion, aPalette);
@ -2569,7 +2577,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
assert(uPartitions < BC7_MAX_REGIONS);
_Analysis_assume_(uPartitions < BC7_MAX_REGIONS);
auto const uNumEndPts = static_cast<const uint8_t>((unsigned(uPartitions) + 1u) << 1);
const auto uNumEndPts = static_cast<const uint8_t>((unsigned(uPartitions) + 1u) << 1);
const uint8_t uIndexPrec = ms_aInfo[uMode].uIndexPrec;
const uint8_t uIndexPrec2 = ms_aInfo[uMode].uIndexPrec2;
size_t i;
@ -2596,7 +2604,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
{
if (uStartBit + RGBAPrec.r > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2611,7 +2619,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
{
if (uStartBit + RGBAPrec.g > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2626,7 +2634,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
{
if (uStartBit + RGBAPrec.b > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2641,7 +2649,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
{
if (uStartBit + RGBAPrec.a > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2658,7 +2666,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
{
if (uStartBit > 127)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2685,7 +2693,14 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
for (i = 0; i < uNumEndPts; i++)
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
c[i] = Unquantize(c[i], RGBAPrecWithP);
#ifdef __GNUC_
#pragma GCC diagnostic pop
#endif
}
uint8_t w1[NUM_PIXELS_PER_BLOCK], w2[NUM_PIXELS_PER_BLOCK];
@ -2696,7 +2711,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
const size_t uNumBits = IsFixUpOffset(ms_aInfo[uMode].uPartitions, uShape, i) ? uIndexPrec - 1u : uIndexPrec;
if (uStartBit + uNumBits > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2713,7 +2728,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
const size_t uNumBits = i ? uIndexPrec2 : uIndexPrec2 - 1u;
if (uStartBit + uNumBits > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2748,6 +2763,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
case 1: std::swap(outPixel.r, outPixel.a); break;
case 2: std::swap(outPixel.g, outPixel.a); break;
case 3: std::swap(outPixel.b, outPixel.a); break;
default: break;
}
pOut[i] = HDRColorA(outPixel);
@ -2755,7 +2771,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
}
else
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Reserved mode 8 encountered during decoding\n");
#endif
// Per the BC7 format spec, we must return transparent black
@ -2823,6 +2839,7 @@ void D3DX_BC7::Encode(uint32_t flags, const HDRColorA* const pIn) noexcept
case 1: for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; i++) std::swap(EP.aLDRPixels[i].r, EP.aLDRPixels[i].a); break;
case 2: for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; i++) std::swap(EP.aLDRPixels[i].g, EP.aLDRPixels[i].a); break;
case 3: for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; i++) std::swap(EP.aLDRPixels[i].b, EP.aLDRPixels[i].a); break;
default: break;
}
for (size_t im = 0; im < uNumIdxMode && fMSEBest > 0; ++im)
@ -2863,6 +2880,7 @@ void D3DX_BC7::Encode(uint32_t flags, const HDRColorA* const pIn) noexcept
case 1: for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; i++) std::swap(EP.aLDRPixels[i].r, EP.aLDRPixels[i].a); break;
case 2: for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; i++) std::swap(EP.aLDRPixels[i].g, EP.aLDRPixels[i].a); break;
case 3: for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; i++) std::swap(EP.aLDRPixels[i].b, EP.aLDRPixels[i].a); break;
default: break;
}
}
}
@ -3133,8 +3151,8 @@ void D3DX_BC7::AssignIndices(const EncodeParams* pEP, size_t uShape, size_t uInd
const uint8_t uIndexPrec = uIndexMode ? ms_aInfo[pEP->uMode].uIndexPrec2 : ms_aInfo[pEP->uMode].uIndexPrec;
const uint8_t uIndexPrec2 = uIndexMode ? ms_aInfo[pEP->uMode].uIndexPrec : ms_aInfo[pEP->uMode].uIndexPrec2;
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
auto const uNumIndices2 = static_cast<const uint8_t>(1u << uIndexPrec2);
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
const auto uNumIndices2 = static_cast<const uint8_t>(1u << uIndexPrec2);
assert((uNumIndices <= BC7_MAX_INDICES) && (uNumIndices2 <= BC7_MAX_INDICES));
_Analysis_assume_((uNumIndices <= BC7_MAX_INDICES) && (uNumIndices2 <= BC7_MAX_INDICES));
@ -3403,8 +3421,15 @@ float D3DX_BC7::Refine(const EncodeParams* pEP, size_t uShape, size_t uRotation,
for (size_t p = 0; p <= uPartitions; p++)
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
aOrgEndPts[p].A = Quantize(aEndPts[p].A, ms_aInfo[pEP->uMode].RGBAPrecWithP);
aOrgEndPts[p].B = Quantize(aEndPts[p].B, ms_aInfo[pEP->uMode].RGBAPrecWithP);
#ifdef __GNUC_
#pragma GCC diagnostic pop
#endif
}
LDREndPntPair newEndPts1[BC7_MAX_REGIONS];
@ -3480,8 +3505,8 @@ float D3DX_BC7::RoughMSE(EncodeParams* pEP, size_t uShape, size_t uIndexMode) no
const uint8_t uIndexPrec = uIndexMode ? ms_aInfo[pEP->uMode].uIndexPrec2 : ms_aInfo[pEP->uMode].uIndexPrec;
const uint8_t uIndexPrec2 = uIndexMode ? ms_aInfo[pEP->uMode].uIndexPrec : ms_aInfo[pEP->uMode].uIndexPrec2;
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
auto const uNumIndices2 = static_cast<const uint8_t>(1u << uIndexPrec2);
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
const auto uNumIndices2 = static_cast<const uint8_t>(1u << uIndexPrec2);
size_t auPixIdx[NUM_PIXELS_PER_BLOCK];
LDRColorA aPalette[BC7_MAX_REGIONS][BC7_MAX_INDICES];

View File

@ -20,13 +20,27 @@ using Microsoft::WRL::ComPtr;
namespace
{
#include "BC7Encode_EncodeBlockCS.inc"
#include "BC7Encode_TryMode02CS.inc"
#include "BC7Encode_TryMode137CS.inc"
#include "BC7Encode_TryMode456CS.inc"
#include "BC6HEncode_EncodeBlockCS.inc"
#include "BC6HEncode_TryModeG10CS.inc"
#include "BC6HEncode_TryModeLE10CS.inc"
namespace cs5
{
#include "BC7Encode_EncodeBlockCS.inc"
#include "BC7Encode_TryMode02CS.inc"
#include "BC7Encode_TryMode137CS.inc"
#include "BC7Encode_TryMode456CS.inc"
#include "BC6HEncode_EncodeBlockCS.inc"
#include "BC6HEncode_TryModeG10CS.inc"
#include "BC6HEncode_TryModeLE10CS.inc"
}
namespace cs4
{
#include "BC7Encode_EncodeBlockCS_cs40.inc"
#include "BC7Encode_TryMode02CS_cs40.inc"
#include "BC7Encode_TryMode137CS_cs40.inc"
#include "BC7Encode_TryMode456CS_cs40.inc"
#include "BC6HEncode_EncodeBlockCS_cs40.inc"
#include "BC6HEncode_TryModeG10CS_cs40.inc"
#include "BC6HEncode_TryModeLE10CS_cs40.inc"
}
struct BufferBC6HBC7
{
@ -87,8 +101,7 @@ GPUCompressBC::GPUCompressBC() noexcept :
m_bc7_mode137(false),
m_width(0),
m_height(0)
{
}
{}
//-------------------------------------------------------------------------------------
@ -132,39 +145,53 @@ HRESULT GPUCompressBC::Initialize(ID3D11Device* pDevice)
//--- Create compute shader library: BC6H -----------------------------------------
// Modes 11-14
HRESULT hr = pDevice->CreateComputeShader(BC6HEncode_TryModeG10CS, sizeof(BC6HEncode_TryModeG10CS), nullptr, m_BC6H_tryModeG10CS.ReleaseAndGetAddressOf());
auto blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC6HEncode_TryModeG10CS : cs4::BC6HEncode_TryModeG10CS;
auto blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC6HEncode_TryModeG10CS) : sizeof(cs4::BC6HEncode_TryModeG10CS);
HRESULT hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC6H_tryModeG10CS.ReleaseAndGetAddressOf());
if (FAILED(hr))
return hr;
// Modes 1-10
hr = pDevice->CreateComputeShader(BC6HEncode_TryModeLE10CS, sizeof(BC6HEncode_TryModeLE10CS), nullptr, m_BC6H_tryModeLE10CS.ReleaseAndGetAddressOf());
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC6HEncode_TryModeLE10CS : cs4::BC6HEncode_TryModeLE10CS;
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC6HEncode_TryModeLE10CS) : sizeof(cs4::BC6HEncode_TryModeLE10CS);
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC6H_tryModeLE10CS.ReleaseAndGetAddressOf());
if (FAILED(hr))
return hr;
// Encode
hr = pDevice->CreateComputeShader(BC6HEncode_EncodeBlockCS, sizeof(BC6HEncode_EncodeBlockCS), nullptr, m_BC6H_encodeBlockCS.ReleaseAndGetAddressOf());
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC6HEncode_EncodeBlockCS : cs4::BC6HEncode_EncodeBlockCS;
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC6HEncode_EncodeBlockCS) : sizeof(cs4::BC6HEncode_EncodeBlockCS);
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC6H_encodeBlockCS.ReleaseAndGetAddressOf());
if (FAILED(hr))
return hr;
//--- Create compute shader library: BC7 ------------------------------------------
// Modes 4, 5, 6
hr = pDevice->CreateComputeShader(BC7Encode_TryMode456CS, sizeof(BC7Encode_TryMode456CS), nullptr, m_BC7_tryMode456CS.ReleaseAndGetAddressOf());
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC7Encode_TryMode456CS : cs4::BC7Encode_TryMode456CS;
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC7Encode_TryMode456CS) : sizeof(cs4::BC7Encode_TryMode456CS);
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC7_tryMode456CS.ReleaseAndGetAddressOf());
if (FAILED(hr))
return hr;
// Modes 1, 3, 7
hr = pDevice->CreateComputeShader(BC7Encode_TryMode137CS, sizeof(BC7Encode_TryMode137CS), nullptr, m_BC7_tryMode137CS.ReleaseAndGetAddressOf());
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC7Encode_TryMode137CS : cs4::BC7Encode_TryMode137CS;
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC7Encode_TryMode137CS) : sizeof(cs4::BC7Encode_TryMode137CS);
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC7_tryMode137CS.ReleaseAndGetAddressOf());
if (FAILED(hr))
return hr;
// Modes 0, 2
hr = pDevice->CreateComputeShader(BC7Encode_TryMode02CS, sizeof(BC7Encode_TryMode02CS), nullptr, m_BC7_tryMode02CS.ReleaseAndGetAddressOf());
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC7Encode_TryMode02CS : cs4::BC7Encode_TryMode02CS;
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC7Encode_TryMode02CS) : sizeof(cs4::BC7Encode_TryMode02CS);
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC7_tryMode02CS.ReleaseAndGetAddressOf());
if (FAILED(hr))
return hr;
// Encode
hr = pDevice->CreateComputeShader(BC7Encode_EncodeBlockCS, sizeof(BC7Encode_EncodeBlockCS), nullptr, m_BC7_encodeBlockCS.ReleaseAndGetAddressOf());
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC7Encode_EncodeBlockCS : cs4::BC7Encode_EncodeBlockCS;
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC7Encode_EncodeBlockCS) : sizeof(cs4::BC7Encode_EncodeBlockCS);
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC7_encodeBlockCS.ReleaseAndGetAddressOf());
if (FAILED(hr))
return hr;
@ -236,7 +263,7 @@ HRESULT GPUCompressBC::Prepare(size_t width, size_t height, uint32_t flags, DXGI
if (sizeInBytes >= UINT32_MAX)
return HRESULT_E_ARITHMETIC_OVERFLOW;
auto const bufferSize = static_cast<size_t>(sizeInBytes);
const auto bufferSize = static_cast<size_t>(sizeInBytes);
{
D3D11_BUFFER_DESC desc = {};
@ -352,7 +379,6 @@ HRESULT GPUCompressBC::Compress(const Image& srcImage, const Image& destImage)
|| srcImage.height != destImage.height
|| srcImage.width != m_width
|| srcImage.height != m_height
|| srcImage.format != m_srcformat
|| destImage.format != m_bcformat)
{
return E_UNEXPECTED;
@ -432,7 +458,7 @@ HRESULT GPUCompressBC::Compress(const Image& srcImage, const Image& destImage)
const size_t xblocks = std::max<size_t>(1, (m_width + 3) >> 2);
const size_t yblocks = std::max<size_t>(1, (m_height + 3) >> 2);
auto const num_total_blocks = static_cast<UINT>(xblocks * yblocks);
const auto num_total_blocks = static_cast<UINT>(xblocks * yblocks);
UINT num_blocks = num_total_blocks;
UINT start_block_id = 0;
while (num_blocks > 0)

View File

@ -17,6 +17,12 @@ namespace DirectX
public:
GPUCompressBC() noexcept;
GPUCompressBC(GPUCompressBC&&) = default;
GPUCompressBC& operator= (GPUCompressBC&&) = default;
GPUCompressBC(GPUCompressBC const&) = delete;
GPUCompressBC& operator= (GPUCompressBC const&) = delete;
HRESULT Initialize(_In_ ID3D11Device* pDevice);
HRESULT Prepare(size_t width, size_t height, uint32_t flags, DXGI_FORMAT format, float alphaWeight);

View File

@ -39,17 +39,18 @@ namespace DirectX
uint32_t ABitMask;
};
#define DDS_FOURCC 0x00000004 // DDPF_FOURCC
#define DDS_RGB 0x00000040 // DDPF_RGB
#define DDS_RGBA 0x00000041 // DDPF_RGB | DDPF_ALPHAPIXELS
#define DDS_LUMINANCE 0x00020000 // DDPF_LUMINANCE
#define DDS_LUMINANCEA 0x00020001 // DDPF_LUMINANCE | DDPF_ALPHAPIXELS
#define DDS_ALPHAPIXELS 0x00000001 // DDPF_ALPHAPIXELS
#define DDS_ALPHA 0x00000002 // DDPF_ALPHA
#define DDS_PAL8 0x00000020 // DDPF_PALETTEINDEXED8
#define DDS_PAL8A 0x00000021 // DDPF_PALETTEINDEXED8 | DDPF_ALPHAPIXELS
#define DDS_BUMPDUDV 0x00080000 // DDPF_BUMPDUDV
// DDS_BUMPLUMINANCE 0x00040000
#define DDS_FOURCC 0x00000004 // DDPF_FOURCC
#define DDS_RGB 0x00000040 // DDPF_RGB
#define DDS_RGBA 0x00000041 // DDPF_RGB | DDPF_ALPHAPIXELS
#define DDS_LUMINANCE 0x00020000 // DDPF_LUMINANCE
#define DDS_LUMINANCEA 0x00020001 // DDPF_LUMINANCE | DDPF_ALPHAPIXELS
#define DDS_ALPHAPIXELS 0x00000001 // DDPF_ALPHAPIXELS
#define DDS_ALPHA 0x00000002 // DDPF_ALPHA
#define DDS_PAL8 0x00000020 // DDPF_PALETTEINDEXED8
#define DDS_PAL8A 0x00000021 // DDPF_PALETTEINDEXED8 | DDPF_ALPHAPIXELS
#define DDS_BUMPLUMINANCE 0x00040000 // DDPF_BUMPLUMINANCE
#define DDS_BUMPDUDV 0x00080000 // DDPF_BUMPDUDV
#define DDS_BUMPDUDVA 0x00080001 // DDPF_BUMPDUDV | DDPF_ALPHAPIXELS
#ifndef MAKEFOURCC
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
@ -187,10 +188,13 @@ namespace DirectX
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A2B10G10R10 =
{ sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 32, 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 };
// We do not support the following legacy Direct3D 9 formats:
// DDSPF_A2W10V10U10 = { sizeof(DDS_PIXELFORMAT), DDS_BUMPDUDV, 0, 32, 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 };
// DDSPF_L6V5U5 = { sizeof(DDS_PIXELFORMAT), DDS_BUMPLUMINANCE, 0, 16, 0x001f, 0x03e0, 0xfc00, 0 };
// DDSPF_X8L8V8U8 = { sizeof(DDS_PIXELFORMAT), DDS_BUMPLUMINANCE, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0 };
// The following legacy Direct3D 9 formats use 'mixed' signed & unsigned channels so requires special handling
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A2W10V10U10 =
{ sizeof(DDS_PIXELFORMAT), DDS_BUMPDUDVA, 0, 32, 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 };
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_L6V5U5 =
{ sizeof(DDS_PIXELFORMAT), DDS_BUMPLUMINANCE, 0, 16, 0x001f, 0x03e0, 0xfc00, 0 };
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_X8L8V8U8 =
{ sizeof(DDS_PIXELFORMAT), DDS_BUMPLUMINANCE, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0 };
// This indicates the DDS_HEADER_DXT10 extension is present (the format is in dxgiFormat)
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_DX10 =
@ -217,8 +221,8 @@ namespace DirectX
#define DDS_CUBEMAP_NEGATIVEZ 0x00008200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ
#define DDS_CUBEMAP_ALLFACES ( DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX |\
DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
#define DDS_CUBEMAP 0x00000200 // DDSCAPS2_CUBEMAP
@ -284,7 +288,43 @@ namespace DirectX
#pragma pack(pop)
static_assert(sizeof(DDS_PIXELFORMAT) == 32, "DDS pixel format size mismatch");
static_assert(sizeof(DDS_HEADER) == 124, "DDS Header size mismatch");
static_assert(sizeof(DDS_HEADER_DXT10) == 20, "DDS DX10 Extended Header size mismatch");
constexpr size_t DDS_MIN_HEADER_SIZE = sizeof(uint32_t) + sizeof(DDS_HEADER);
constexpr size_t DDS_DX10_HEADER_SIZE = sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10);
static_assert(DDS_DX10_HEADER_SIZE > DDS_MIN_HEADER_SIZE, "DDS DX10 Header should be larger than standard header");
} // namespace
namespace Xbox
{
DDSGLOBALCONST DirectX::DDS_PIXELFORMAT DDSPF_XBOX =
{ sizeof(DirectX::DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('X','B','O','X'), 0, 0, 0, 0, 0 };
#pragma pack(push,1)
struct DDS_HEADER_XBOX
// Must match structure in XboxDDSTextureLoader module
{
DXGI_FORMAT dxgiFormat;
uint32_t resourceDimension;
uint32_t miscFlag; // see DDS_RESOURCE_MISC_FLAG
uint32_t arraySize;
uint32_t miscFlags2; // see DDS_MISC_FLAGS2
uint32_t tileMode; // see XG_TILE_MODE / XG_SWIZZLE_MODE
uint32_t baseAlignment;
uint32_t dataSize;
uint32_t xdkVer; // matching _XDK_VER / _GXDK_VER
};
#pragma pack(pop)
static_assert(sizeof(DDS_HEADER_XBOX) == 36, "DDS XBOX Header size mismatch");
static_assert(sizeof(DDS_HEADER_XBOX) > sizeof(DirectX::DDS_HEADER_DXT10), "DDS XBOX Header should be larger than DX10 header");
constexpr size_t DDS_XBOX_HEADER_SIZE = sizeof(uint32_t) + sizeof(DirectX::DDS_HEADER) + sizeof(DDS_HEADER_XBOX);
constexpr uint32_t XBOX_TILEMODE_SCARLETT = 0x1000000;
} // namespace

View File

@ -47,32 +47,49 @@ struct IWICImagingFactory;
struct IWICMetadataQueryReader;
#endif
#define DIRECTX_TEX_VERSION 196
#define DIRECTX_TEX_VERSION 208
#if defined(_WIN32) && defined(DIRECTX_TEX_EXPORT)
#ifdef __GNUC__
#define DIRECTX_TEX_API __attribute__ ((dllexport))
#else
#define DIRECTX_TEX_API __declspec(dllexport)
#endif
#elif defined(_WIN32) && defined(DIRECTX_TEX_IMPORT)
#ifdef __GNUC__
#define DIRECTX_TEX_API __attribute__ ((dllimport))
#else
#define DIRECTX_TEX_API __declspec(dllimport)
#endif
#else
#define DIRECTX_TEX_API
#endif
namespace DirectX
{
//---------------------------------------------------------------------------------
// DXGI Format Utilities
constexpr bool __cdecl IsValid(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsCompressed(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsPacked(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsVideo(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsPlanar(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsPalettized(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsDepthStencil(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsSRGB(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsBGR(_In_ DXGI_FORMAT fmt) noexcept;
bool __cdecl IsTypeless(_In_ DXGI_FORMAT fmt, _In_ bool partialTypeless = true) noexcept;
DIRECTX_TEX_API constexpr bool __cdecl IsValid(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API bool __cdecl IsCompressed(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API bool __cdecl IsPacked(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API bool __cdecl IsVideo(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API bool __cdecl IsPlanar(_In_ DXGI_FORMAT fmt, _In_ bool isd3d12 = false) noexcept;
DIRECTX_TEX_API bool __cdecl IsPalettized(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API bool __cdecl IsDepthStencil(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API bool __cdecl IsSRGB(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API bool __cdecl IsBGR(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API bool __cdecl IsTypeless(_In_ DXGI_FORMAT fmt, _In_ bool partialTypeless = true) noexcept;
bool __cdecl HasAlpha(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API bool __cdecl HasAlpha(_In_ DXGI_FORMAT fmt) noexcept;
size_t __cdecl BitsPerPixel(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API size_t __cdecl BitsPerPixel(_In_ DXGI_FORMAT fmt) noexcept;
size_t __cdecl BitsPerColor(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API size_t __cdecl BitsPerColor(_In_ DXGI_FORMAT fmt) noexcept;
enum FORMAT_TYPE
DIRECTX_TEX_API size_t __cdecl BytesPerBlock(_In_ DXGI_FORMAT fmt) noexcept;
enum FORMAT_TYPE : uint32_t
{
FORMAT_TYPE_TYPELESS,
FORMAT_TYPE_FLOAT,
@ -82,9 +99,9 @@ namespace DirectX
FORMAT_TYPE_SINT,
};
FORMAT_TYPE __cdecl FormatDataType(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API FORMAT_TYPE __cdecl FormatDataType(_In_ DXGI_FORMAT fmt) noexcept;
enum CP_FLAGS : unsigned long
enum CP_FLAGS : uint32_t
{
CP_FLAGS_NONE = 0x0,
// Normal operation
@ -115,23 +132,26 @@ namespace DirectX
CP_FLAGS_8BPP = 0x40000,
// Override with a legacy 8 bits-per-pixel format size
CP_FLAGS_LIMIT_4GB = 0x10000000,
// Don't allow pixel allocations in excess of 4GB (always true for 32-bit)
};
HRESULT __cdecl ComputePitch(
DIRECTX_TEX_API HRESULT __cdecl ComputePitch(
_In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height,
_Out_ size_t& rowPitch, _Out_ size_t& slicePitch, _In_ CP_FLAGS flags = CP_FLAGS_NONE) noexcept;
size_t __cdecl ComputeScanlines(_In_ DXGI_FORMAT fmt, _In_ size_t height) noexcept;
DIRECTX_TEX_API size_t __cdecl ComputeScanlines(_In_ DXGI_FORMAT fmt, _In_ size_t height) noexcept;
DXGI_FORMAT __cdecl MakeSRGB(_In_ DXGI_FORMAT fmt) noexcept;
DXGI_FORMAT __cdecl MakeLinear(_In_ DXGI_FORMAT fmt) noexcept;
DXGI_FORMAT __cdecl MakeTypeless(_In_ DXGI_FORMAT fmt) noexcept;
DXGI_FORMAT __cdecl MakeTypelessUNORM(_In_ DXGI_FORMAT fmt) noexcept;
DXGI_FORMAT __cdecl MakeTypelessFLOAT(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API DXGI_FORMAT __cdecl MakeSRGB(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API DXGI_FORMAT __cdecl MakeLinear(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API DXGI_FORMAT __cdecl MakeTypeless(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API DXGI_FORMAT __cdecl MakeTypelessUNORM(_In_ DXGI_FORMAT fmt) noexcept;
DIRECTX_TEX_API DXGI_FORMAT __cdecl MakeTypelessFLOAT(_In_ DXGI_FORMAT fmt) noexcept;
//---------------------------------------------------------------------------------
// Texture metadata
enum TEX_DIMENSION
enum TEX_DIMENSION : uint32_t
// Subset here matches D3D10_RESOURCE_DIMENSION and D3D11_RESOURCE_DIMENSION
{
TEX_DIMENSION_TEXTURE1D = 2,
@ -139,18 +159,18 @@ namespace DirectX
TEX_DIMENSION_TEXTURE3D = 4,
};
enum TEX_MISC_FLAG : unsigned long
enum TEX_MISC_FLAG : uint32_t
// Subset here matches D3D10_RESOURCE_MISC_FLAG and D3D11_RESOURCE_MISC_FLAG
{
TEX_MISC_TEXTURECUBE = 0x4L,
};
enum TEX_MISC_FLAG2 : unsigned long
enum TEX_MISC_FLAG2 : uint32_t
{
TEX_MISC2_ALPHA_MODE_MASK = 0x7L,
};
enum TEX_ALPHA_MODE
enum TEX_ALPHA_MODE : uint32_t
// Matches DDS_ALPHA_MODE, encoded in MISC_FLAGS2
{
TEX_ALPHA_MODE_UNKNOWN = 0,
@ -160,7 +180,7 @@ namespace DirectX
TEX_ALPHA_MODE_CUSTOM = 4,
};
struct TexMetadata
struct DIRECTX_TEX_API TexMetadata
{
size_t width;
size_t height; // Should be 1 for 1D textures
@ -172,7 +192,7 @@ namespace DirectX
DXGI_FORMAT format;
TEX_DIMENSION dimension;
size_t __cdecl ComputeIndex(_In_ size_t mip, _In_ size_t item, _In_ size_t slice) const noexcept;
size_t __cdecl ComputeIndex(size_t mip, size_t item, size_t slice) const noexcept;
// Returns size_t(-1) to indicate an out-of-range error
bool __cdecl IsCubemap() const noexcept { return (miscFlags & TEX_MISC_TEXTURECUBE) != 0; }
@ -185,9 +205,27 @@ namespace DirectX
bool __cdecl IsVolumemap() const noexcept { return (dimension == TEX_DIMENSION_TEXTURE3D); }
// Helper for dimension
uint32_t __cdecl CalculateSubresource(size_t mip, size_t item) const noexcept;
uint32_t __cdecl CalculateSubresource(size_t mip, size_t item, size_t plane) const noexcept;
// Returns size_t(-1) to indicate an out-of-range error
};
enum DDS_FLAGS : unsigned long
struct DIRECTX_TEX_API DDSMetaData
{
uint32_t size; // DDPIXELFORMAT.dwSize
uint32_t flags; // DDPIXELFORMAT.dwFlags
uint32_t fourCC; // DDPIXELFORMAT.dwFourCC
uint32_t RGBBitCount; // DDPIXELFORMAT.dwRGBBitCount/dwYUVBitCount/dwAlphaBitDepth/dwLuminanceBitCount/dwBumpBitCount
uint32_t RBitMask; // DDPIXELFORMAT.dwRBitMask/dwYBitMask/dwLuminanceBitMask/dwBumpDuBitMask
uint32_t GBitMask; // DDPIXELFORMAT.dwGBitMask/dwUBitMask/dwBumpDvBitMask
uint32_t BBitMask; // DDPIXELFORMAT.dwBBitMask/dwVBitMask/dwBumpLuminanceBitMask
uint32_t ABitMask; // DDPIXELFORMAT.dwRGBAlphaBitMask/dwYUVAlphaBitMask/dwLuminanceAlphaBitMask
bool __cdecl IsDX10() const noexcept { return (fourCC == 0x30315844); }
};
enum DDS_FLAGS : uint32_t
{
DDS_FLAGS_NONE = 0x0,
@ -212,6 +250,12 @@ namespace DirectX
DDS_FLAGS_BAD_DXTN_TAILS = 0x40,
// Some older DXTn DDS files incorrectly handle mipchain tails for blocks smaller than 4x4
DDS_FLAGS_PERMISSIVE = 0x80,
// Allow some file variants due to common bugs in the header written by various leagcy DDS writers
DDS_FLAGS_IGNORE_MIPS = 0x100,
// Allow some files to be read that have incorrect mipcount values in the header by only reading the top-level mip
DDS_FLAGS_FORCE_DX10_EXT = 0x10000,
// Always use the 'DX10' header extension for DDS writer (i.e. don't try to write DX9 compatible DDS files)
@ -221,11 +265,14 @@ namespace DirectX
DDS_FLAGS_FORCE_DX9_LEGACY = 0x40000,
// Force use of legacy header for DDS writer (will fail if unable to write as such)
DDS_FLAGS_FORCE_DXT5_RXGB = 0x80000,
// Force use of 'RXGB' instead of 'DXT5' for DDS write of BC3_UNORM data
DDS_FLAGS_ALLOW_LARGE_FILES = 0x1000000,
// Enables the loader to read large dimension .dds files (i.e. greater than known hardware requirements)
};
enum TGA_FLAGS : unsigned long
enum TGA_FLAGS : uint32_t
{
TGA_FLAGS_NONE = 0x0,
@ -248,7 +295,7 @@ namespace DirectX
// If no colorspace is specified in TGA 2.0 metadata, assume sRGB
};
enum WIC_FLAGS : unsigned long
enum WIC_FLAGS : uint32_t
{
WIC_FLAGS_NONE = 0x0,
@ -292,53 +339,92 @@ namespace DirectX
// Filtering mode to use for any required image resizing (only needed when loading arrays of differently sized images; defaults to Fant)
};
HRESULT __cdecl GetMetadataFromDDSMemory(
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_In_ DDS_FLAGS flags,
_Out_ TexMetadata& metadata) noexcept;
HRESULT __cdecl GetMetadataFromDDSFile(
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSFile(
_In_z_ const wchar_t* szFile,
_In_ DDS_FLAGS flags,
_Out_ TexMetadata& metadata) noexcept;
HRESULT __cdecl GetMetadataFromHDRMemory(
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSMemoryEx(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_In_ DDS_FLAGS flags,
_Out_ TexMetadata& metadata,
_Out_opt_ DDSMetaData* ddPixelFormat) noexcept;
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSFileEx(
_In_z_ const wchar_t* szFile,
_In_ DDS_FLAGS flags,
_Out_ TexMetadata& metadata,
_Out_opt_ DDSMetaData* ddPixelFormat) noexcept;
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromHDRMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_Out_ TexMetadata& metadata) noexcept;
HRESULT __cdecl GetMetadataFromHDRFile(
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromHDRFile(
_In_z_ const wchar_t* szFile,
_Out_ TexMetadata& metadata) noexcept;
HRESULT __cdecl GetMetadataFromTGAMemory(
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromTGAMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_In_ TGA_FLAGS flags,
_Out_ TexMetadata& metadata) noexcept;
HRESULT __cdecl GetMetadataFromTGAFile(
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromTGAFile(
_In_z_ const wchar_t* szFile,
_In_ TGA_FLAGS flags,
_Out_ TexMetadata& metadata) noexcept;
#ifdef _WIN32
HRESULT __cdecl GetMetadataFromWICMemory(
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromWICMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_In_ WIC_FLAGS flags,
_Out_ TexMetadata& metadata,
_In_opt_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
_In_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
HRESULT __cdecl GetMetadataFromWICFile(
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromWICFile(
_In_z_ const wchar_t* szFile,
_In_ WIC_FLAGS flags,
_Out_ TexMetadata& metadata,
_In_opt_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
_In_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
#endif
// Compatability helpers
HRESULT __cdecl GetMetadataFromTGAMemory(
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromTGAMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_Out_ TexMetadata& metadata) noexcept;
HRESULT __cdecl GetMetadataFromTGAFile(
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromTGAFile(
_In_z_ const wchar_t* szFile,
_Out_ TexMetadata& metadata) noexcept;
#ifdef __cpp_lib_byte
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSMemory(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_In_ DDS_FLAGS flags,
_Out_ TexMetadata& metadata) noexcept;
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSMemoryEx(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_In_ DDS_FLAGS flags,
_Out_ TexMetadata& metadata,
_Out_opt_ DDSMetaData* ddPixelFormat) noexcept;
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromHDRMemory(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_Out_ TexMetadata& metadata) noexcept;
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromTGAMemory(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_In_ TGA_FLAGS flags,
_Out_ TexMetadata& metadata) noexcept;
#ifdef _WIN32
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromWICMemory(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_In_ WIC_FLAGS flags,
_Out_ TexMetadata& metadata,
_In_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
#endif
#endif // __cpp_lib_byte
//---------------------------------------------------------------------------------
// Bitmap image container
struct Image
@ -351,13 +437,17 @@ namespace DirectX
uint8_t* pixels;
};
class ScratchImage
class DIRECTX_TEX_API ScratchImage
{
public:
ScratchImage() noexcept
: m_nimages(0), m_size(0), m_metadata{}, m_image(nullptr), m_memory(nullptr) {}
: m_nimages(0), m_size(0), m_metadata{}, m_image(nullptr), m_memory(nullptr)
{}
ScratchImage(ScratchImage&& moveFrom) noexcept
: m_nimages(0), m_size(0), m_metadata{}, m_image(nullptr), m_memory(nullptr) { *this = std::move(moveFrom); }
: m_nimages(0), m_size(0), m_metadata{}, m_image(nullptr), m_memory(nullptr)
{
*this = std::move(moveFrom);
}
~ScratchImage() { Release(); }
ScratchImage& __cdecl operator= (ScratchImage&& moveFrom) noexcept;
@ -402,7 +492,7 @@ namespace DirectX
//---------------------------------------------------------------------------------
// Memory blob (allocated buffer pointer is always 16-byte aligned)
class Blob
class DIRECTX_TEX_API Blob
{
public:
Blob() noexcept : m_buffer(nullptr), m_size(0) {}
@ -418,7 +508,10 @@ namespace DirectX
void __cdecl Release() noexcept;
void *__cdecl GetBufferPointer() const noexcept { return m_buffer; }
uint8_t* __cdecl GetBufferPointer() const noexcept { return m_buffer; }
const uint8_t* __cdecl GetConstBufferPointer() const noexcept { return m_buffer; }
size_t __cdecl GetBufferSize() const noexcept { return m_size; }
HRESULT __cdecl Resize(size_t size) noexcept;
@ -428,113 +521,199 @@ namespace DirectX
// Shorten size without reallocation
private:
void* m_buffer;
size_t m_size;
uint8_t* m_buffer;
size_t m_size;
};
//---------------------------------------------------------------------------------
// Tiling utilities
struct DIRECTX_TEX_API TileShape
{
size_t width;
size_t height;
size_t depth;
TileShape() = default;
#if defined(__d3d11_2_h__) || defined(__d3d11_x_h__)
TileShape(const D3D11_TILE_SHAPE& tile) :
width(tile.WidthInTexels),
height(tile.HeightInTexels),
depth(tile.DepthInTexels)
{}
void GetTileShape11(D3D11_TILE_SHAPE& tile) const
{
tile.WidthInTexels = static_cast<UINT>(width);
tile.HeightInTexels = static_cast<UINT>(height);
tile.DepthInTexels = static_cast<UINT>(depth);
}
#endif
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
TileShape(const D3D12_TILE_SHAPE& tile) :
width(tile.WidthInTexels),
height(tile.HeightInTexels),
depth(tile.DepthInTexels)
{}
void GetTileShape12(D3D12_TILE_SHAPE& tile) const
{
tile.WidthInTexels = static_cast<UINT>(width);
tile.HeightInTexels = static_cast<UINT>(height);
tile.DepthInTexels = static_cast<UINT>(depth);
}
#endif
};
DIRECTX_TEX_API HRESULT __cdecl ComputeTileShape(_In_ DXGI_FORMAT fmt, _In_ TEX_DIMENSION dimension,
_Out_ TileShape& tiling) noexcept;
//---------------------------------------------------------------------------------
// Image I/O
// DDS operations
HRESULT __cdecl LoadFromDDSMemory(
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_In_ DDS_FLAGS flags,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl LoadFromDDSFile(
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSFile(
_In_z_ const wchar_t* szFile,
_In_ DDS_FLAGS flags,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl SaveToDDSMemory(
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSMemoryEx(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_In_ DDS_FLAGS flags,
_Out_opt_ TexMetadata* metadata,
_Out_opt_ DDSMetaData* ddPixelFormat,
_Out_ ScratchImage& image) noexcept;
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSFileEx(
_In_z_ const wchar_t* szFile,
_In_ DDS_FLAGS flags,
_Out_opt_ TexMetadata* metadata,
_Out_opt_ DDSMetaData* ddPixelFormat,
_Out_ ScratchImage& image) noexcept;
DIRECTX_TEX_API HRESULT __cdecl SaveToDDSMemory(
_In_ const Image& image,
_In_ DDS_FLAGS flags,
_Out_ Blob& blob) noexcept;
HRESULT __cdecl SaveToDDSMemory(
DIRECTX_TEX_API HRESULT __cdecl SaveToDDSMemory(
_In_reads_(nimages) const Image* images, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ DDS_FLAGS flags,
_Out_ Blob& blob) noexcept;
HRESULT __cdecl SaveToDDSFile(_In_ const Image& image, _In_ DDS_FLAGS flags, _In_z_ const wchar_t* szFile) noexcept;
HRESULT __cdecl SaveToDDSFile(
DIRECTX_TEX_API HRESULT __cdecl SaveToDDSFile(_In_ const Image& image, _In_ DDS_FLAGS flags, _In_z_ const wchar_t* szFile) noexcept;
DIRECTX_TEX_API HRESULT __cdecl SaveToDDSFile(
_In_reads_(nimages) const Image* images, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ DDS_FLAGS flags, _In_z_ const wchar_t* szFile) noexcept;
// HDR operations
HRESULT __cdecl LoadFromHDRMemory(
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
DIRECTX_TEX_API HRESULT __cdecl LoadFromHDRMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl LoadFromHDRFile(
DIRECTX_TEX_API HRESULT __cdecl LoadFromHDRFile(
_In_z_ const wchar_t* szFile,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl SaveToHDRMemory(_In_ const Image& image, _Out_ Blob& blob) noexcept;
HRESULT __cdecl SaveToHDRFile(_In_ const Image& image, _In_z_ const wchar_t* szFile) noexcept;
DIRECTX_TEX_API HRESULT __cdecl SaveToHDRMemory(_In_ const Image& image, _Out_ Blob& blob) noexcept;
DIRECTX_TEX_API HRESULT __cdecl SaveToHDRFile(_In_ const Image& image, _In_z_ const wchar_t* szFile) noexcept;
// TGA operations
HRESULT __cdecl LoadFromTGAMemory(
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
DIRECTX_TEX_API HRESULT __cdecl LoadFromTGAMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_In_ TGA_FLAGS flags,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl LoadFromTGAFile(
DIRECTX_TEX_API HRESULT __cdecl LoadFromTGAFile(
_In_z_ const wchar_t* szFile,
_In_ TGA_FLAGS flags,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl SaveToTGAMemory(_In_ const Image& image,
DIRECTX_TEX_API HRESULT __cdecl SaveToTGAMemory(_In_ const Image& image,
_In_ TGA_FLAGS flags,
_Out_ Blob& blob, _In_opt_ const TexMetadata* metadata = nullptr) noexcept;
HRESULT __cdecl SaveToTGAFile(_In_ const Image& image,
DIRECTX_TEX_API HRESULT __cdecl SaveToTGAFile(_In_ const Image& image,
_In_ TGA_FLAGS flags,
_In_z_ const wchar_t* szFile, _In_opt_ const TexMetadata* metadata = nullptr) noexcept;
// WIC operations
#ifdef _WIN32
HRESULT __cdecl LoadFromWICMemory(
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
DIRECTX_TEX_API HRESULT __cdecl LoadFromWICMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_In_ WIC_FLAGS flags,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image,
_In_opt_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
HRESULT __cdecl LoadFromWICFile(
_In_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
DIRECTX_TEX_API HRESULT __cdecl LoadFromWICFile(
_In_z_ const wchar_t* szFile, _In_ WIC_FLAGS flags,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image,
_In_opt_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
_In_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
HRESULT __cdecl SaveToWICMemory(
DIRECTX_TEX_API HRESULT __cdecl SaveToWICMemory(
_In_ const Image& image, _In_ WIC_FLAGS flags, _In_ REFGUID guidContainerFormat,
_Out_ Blob& blob, _In_opt_ const GUID* targetFormat = nullptr,
_In_opt_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
HRESULT __cdecl SaveToWICMemory(
_In_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
DIRECTX_TEX_API HRESULT __cdecl SaveToWICMemory(
_In_count_(nimages) const Image* images, _In_ size_t nimages,
_In_ WIC_FLAGS flags, _In_ REFGUID guidContainerFormat,
_Out_ Blob& blob, _In_opt_ const GUID* targetFormat = nullptr,
_In_opt_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
_In_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
HRESULT __cdecl SaveToWICFile(
DIRECTX_TEX_API HRESULT __cdecl SaveToWICFile(
_In_ const Image& image, _In_ WIC_FLAGS flags, _In_ REFGUID guidContainerFormat,
_In_z_ const wchar_t* szFile, _In_opt_ const GUID* targetFormat = nullptr,
_In_opt_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
HRESULT __cdecl SaveToWICFile(
_In_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
DIRECTX_TEX_API HRESULT __cdecl SaveToWICFile(
_In_count_(nimages) const Image* images, _In_ size_t nimages,
_In_ WIC_FLAGS flags, _In_ REFGUID guidContainerFormat,
_In_z_ const wchar_t* szFile, _In_opt_ const GUID* targetFormat = nullptr,
_In_opt_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
_In_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
#endif // WIN32
// Compatability helpers
HRESULT __cdecl LoadFromTGAMemory(
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
DIRECTX_TEX_API HRESULT __cdecl LoadFromTGAMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl LoadFromTGAFile(
DIRECTX_TEX_API HRESULT __cdecl LoadFromTGAFile(
_In_z_ const wchar_t* szFile,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl SaveToTGAMemory(_In_ const Image& image, _Out_ Blob& blob, _In_opt_ const TexMetadata* metadata = nullptr) noexcept;
HRESULT __cdecl SaveToTGAFile(_In_ const Image& image, _In_z_ const wchar_t* szFile, _In_opt_ const TexMetadata* metadata = nullptr) noexcept;
DIRECTX_TEX_API HRESULT __cdecl SaveToTGAMemory(_In_ const Image& image, _Out_ Blob& blob, _In_opt_ const TexMetadata* metadata = nullptr) noexcept;
DIRECTX_TEX_API HRESULT __cdecl SaveToTGAFile(_In_ const Image& image, _In_z_ const wchar_t* szFile, _In_opt_ const TexMetadata* metadata = nullptr) noexcept;
#ifdef __cpp_lib_byte
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSMemory(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_In_ DDS_FLAGS flags,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSMemoryEx(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_In_ DDS_FLAGS flags,
_Out_opt_ TexMetadata* metadata,
_Out_opt_ DDSMetaData* ddPixelFormat,
_Out_ ScratchImage& image) noexcept;
DIRECTX_TEX_API HRESULT __cdecl LoadFromHDRMemory(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
DIRECTX_TEX_API HRESULT __cdecl LoadFromTGAMemory(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_In_ TGA_FLAGS flags,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
#ifdef _WIN32
DIRECTX_TEX_API HRESULT __cdecl LoadFromWICMemory(
_In_reads_bytes_(size) const std::byte* pSource, _In_ size_t size,
_In_ WIC_FLAGS flags,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image,
_In_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
#endif
#endif // __cpp_lib_byte
//---------------------------------------------------------------------------------
// Texture conversion, resizing, mipmap generation, and block compression
enum TEX_FR_FLAGS : unsigned long
enum TEX_FR_FLAGS : uint32_t
{
TEX_FR_ROTATE0 = 0x0,
TEX_FR_ROTATE90 = 0x1,
@ -545,14 +724,14 @@ namespace DirectX
};
#ifdef _WIN32
HRESULT __cdecl FlipRotate(_In_ const Image& srcImage, _In_ TEX_FR_FLAGS flags, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl FlipRotate(
DIRECTX_TEX_API HRESULT __cdecl FlipRotate(_In_ const Image& srcImage, _In_ TEX_FR_FLAGS flags, _Out_ ScratchImage& image) noexcept;
DIRECTX_TEX_API HRESULT __cdecl FlipRotate(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ TEX_FR_FLAGS flags, _Out_ ScratchImage& result) noexcept;
// Flip and/or rotate image
#endif
enum TEX_FILTER_FLAGS : unsigned long
enum TEX_FILTER_FLAGS : uint32_t
{
TEX_FILTER_DEFAULT = 0,
@ -575,8 +754,9 @@ namespace DirectX
TEX_FILTER_RGB_COPY_RED = 0x1000,
TEX_FILTER_RGB_COPY_GREEN = 0x2000,
TEX_FILTER_RGB_COPY_BLUE = 0x4000,
// When converting RGB to R, defaults to using grayscale. These flags indicate copying a specific channel instead
// When converting RGB to RG, defaults to copying RED | GREEN. These flags control which channels are selected instead.
TEX_FILTER_RGB_COPY_ALPHA = 0x8000,
// When converting RGB(A) to R, defaults to using grayscale. These flags indicate copying a specific channel instead
// When converting RGB(A) to RG, defaults to copying RED | GREEN. These flags control which channels are selected instead.
TEX_FILTER_DITHER = 0x10000,
// Use ordered 4x4 dithering for any required conversions
@ -605,15 +785,15 @@ namespace DirectX
// Forces use of the WIC path even when logic would have picked a non-WIC path when both are an option
};
constexpr unsigned long TEX_FILTER_DITHER_MASK = 0xF0000;
constexpr unsigned long TEX_FILTER_MODE_MASK = 0xF00000;
constexpr unsigned long TEX_FILTER_SRGB_MASK = 0xF000000;
constexpr uint32_t TEX_FILTER_DITHER_MASK = 0xF0000;
constexpr uint32_t TEX_FILTER_MODE_MASK = 0xF00000;
constexpr uint32_t TEX_FILTER_SRGB_MASK = 0xF000000;
HRESULT __cdecl Resize(
DIRECTX_TEX_API HRESULT __cdecl Resize(
_In_ const Image& srcImage, _In_ size_t width, _In_ size_t height,
_In_ TEX_FILTER_FLAGS filter,
_Out_ ScratchImage& image) noexcept;
HRESULT __cdecl Resize(
DIRECTX_TEX_API HRESULT __cdecl Resize(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ size_t width, _In_ size_t height, _In_ TEX_FILTER_FLAGS filter, _Out_ ScratchImage& result) noexcept;
// Resize the image to width x height. Defaults to Fant filtering.
@ -622,44 +802,59 @@ namespace DirectX
constexpr float TEX_THRESHOLD_DEFAULT = 0.5f;
// Default value for alpha threshold used when converting to 1-bit alpha
HRESULT __cdecl Convert(
struct ConvertOptions
{
TEX_FILTER_FLAGS filter;
float threshold;
};
DIRECTX_TEX_API HRESULT __cdecl Convert(
_In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ TEX_FILTER_FLAGS filter, _In_ float threshold,
_Out_ ScratchImage& image) noexcept;
HRESULT __cdecl Convert(
DIRECTX_TEX_API HRESULT __cdecl Convert(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ DXGI_FORMAT format, _In_ TEX_FILTER_FLAGS filter, _In_ float threshold, _Out_ ScratchImage& result) noexcept;
DIRECTX_TEX_API HRESULT __cdecl ConvertEx(
_In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ const ConvertOptions& options,
_Out_ ScratchImage& image,
_In_ std::function<bool __cdecl(size_t, size_t)> statusCallBack = nullptr);
DIRECTX_TEX_API HRESULT __cdecl ConvertEx(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ DXGI_FORMAT format, _In_ const ConvertOptions& options, _Out_ ScratchImage& result,
_In_ std::function<bool __cdecl(size_t, size_t)> statusCallBack = nullptr);
// Convert the image to a new format
HRESULT __cdecl ConvertToSinglePlane(_In_ const Image& srcImage, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl ConvertToSinglePlane(
DIRECTX_TEX_API HRESULT __cdecl ConvertToSinglePlane(_In_ const Image& srcImage, _Out_ ScratchImage& image) noexcept;
DIRECTX_TEX_API HRESULT __cdecl ConvertToSinglePlane(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_Out_ ScratchImage& image) noexcept;
// Converts the image from a planar format to an equivalent non-planar format
HRESULT __cdecl GenerateMipMaps(
DIRECTX_TEX_API HRESULT __cdecl GenerateMipMaps(
_In_ const Image& baseImage, _In_ TEX_FILTER_FLAGS filter, _In_ size_t levels,
_Inout_ ScratchImage& mipChain, _In_ bool allow1D = false) noexcept;
HRESULT __cdecl GenerateMipMaps(
DIRECTX_TEX_API HRESULT __cdecl GenerateMipMaps(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ TEX_FILTER_FLAGS filter, _In_ size_t levels, _Inout_ ScratchImage& mipChain);
// levels of '0' indicates a full mipchain, otherwise is generates that number of total levels (including the source base image)
// Defaults to Fant filtering which is equivalent to a box filter
HRESULT __cdecl GenerateMipMaps3D(
DIRECTX_TEX_API HRESULT __cdecl GenerateMipMaps3D(
_In_reads_(depth) const Image* baseImages, _In_ size_t depth, _In_ TEX_FILTER_FLAGS filter, _In_ size_t levels,
_Out_ ScratchImage& mipChain) noexcept;
HRESULT __cdecl GenerateMipMaps3D(
DIRECTX_TEX_API HRESULT __cdecl GenerateMipMaps3D(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ TEX_FILTER_FLAGS filter, _In_ size_t levels, _Out_ ScratchImage& mipChain);
// levels of '0' indicates a full mipchain, otherwise is generates that number of total levels (including the source base image)
// Defaults to Fant filtering which is equivalent to a box filter
HRESULT __cdecl ScaleMipMapsAlphaForCoverage(
DIRECTX_TEX_API HRESULT __cdecl ScaleMipMapsAlphaForCoverage(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, _In_ size_t item,
_In_ float alphaReference, _Inout_ ScratchImage& mipChain) noexcept;
enum TEX_PMALPHA_FLAGS : unsigned long
enum TEX_PMALPHA_FLAGS : uint32_t
{
TEX_PMALPHA_DEFAULT = 0,
@ -676,13 +871,13 @@ namespace DirectX
// if the output format type is IsSRGB(), then SRGB_OUT is on by default
};
HRESULT __cdecl PremultiplyAlpha(_In_ const Image& srcImage, _In_ TEX_PMALPHA_FLAGS flags, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl PremultiplyAlpha(
DIRECTX_TEX_API HRESULT __cdecl PremultiplyAlpha(_In_ const Image& srcImage, _In_ TEX_PMALPHA_FLAGS flags, _Out_ ScratchImage& image) noexcept;
DIRECTX_TEX_API HRESULT __cdecl PremultiplyAlpha(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ TEX_PMALPHA_FLAGS flags, _Out_ ScratchImage& result) noexcept;
// Converts to/from a premultiplied alpha version of the texture
enum TEX_COMPRESS_FLAGS : unsigned long
enum TEX_COMPRESS_FLAGS : uint32_t
{
TEX_COMPRESS_DEFAULT = 0,
@ -714,33 +909,61 @@ namespace DirectX
// Compress is free to use multithreading to improve performance (by default it does not use multithreading)
};
HRESULT __cdecl Compress(
constexpr float TEX_ALPHA_WEIGHT_DEFAULT = 1.0f;
// Default value for alpha weight used for GPU BC7 compression
struct CompressOptions
{
TEX_COMPRESS_FLAGS flags;
float threshold;
float alphaWeight;
};
DIRECTX_TEX_API HRESULT __cdecl Compress(
_In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ TEX_COMPRESS_FLAGS compress, _In_ float threshold,
_Out_ ScratchImage& cImage) noexcept;
HRESULT __cdecl Compress(
DIRECTX_TEX_API HRESULT __cdecl Compress(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ DXGI_FORMAT format, _In_ TEX_COMPRESS_FLAGS compress, _In_ float threshold, _Out_ ScratchImage& cImages) noexcept;
// Note that threshold is only used by BC1. TEX_THRESHOLD_DEFAULT is a typical value to use
DIRECTX_TEX_API HRESULT __cdecl CompressEx(
_In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ const CompressOptions& options,
_Out_ ScratchImage& cImage,
_In_ std::function<bool __cdecl(size_t, size_t)> statusCallBack = nullptr);
DIRECTX_TEX_API HRESULT __cdecl CompressEx(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ DXGI_FORMAT format, _In_ const CompressOptions& options, _Out_ ScratchImage& cImages,
_In_ std::function<bool __cdecl(size_t, size_t)> statusCallBack = nullptr);
#if defined(__d3d11_h__) || defined(__d3d11_x_h__)
HRESULT __cdecl Compress(
DIRECTX_TEX_API HRESULT __cdecl Compress(
_In_ ID3D11Device* pDevice, _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ TEX_COMPRESS_FLAGS compress,
_In_ float alphaWeight, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl Compress(
DIRECTX_TEX_API HRESULT __cdecl Compress(
_In_ ID3D11Device* pDevice, _In_ const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ DXGI_FORMAT format, _In_ TEX_COMPRESS_FLAGS compress, _In_ float alphaWeight, _Out_ ScratchImage& cImages) noexcept;
// DirectCompute-based compression (alphaWeight is only used by BC7. 1.0 is the typical value to use)
DIRECTX_TEX_API HRESULT __cdecl CompressEx(
_In_ ID3D11Device* pDevice, _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ const CompressOptions& options,
_Out_ ScratchImage& image,
_In_ std::function<bool __cdecl(size_t, size_t)> statusCallBack = nullptr);
DIRECTX_TEX_API HRESULT __cdecl CompressEx(
_In_ ID3D11Device* pDevice, _In_ const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ DXGI_FORMAT format, _In_ const CompressOptions& options, _Out_ ScratchImage& cImages,
_In_ std::function<bool __cdecl(size_t, size_t)> statusCallBack = nullptr);
#endif
HRESULT __cdecl Decompress(_In_ const Image& cImage, _In_ DXGI_FORMAT format, _Out_ ScratchImage& image) noexcept;
HRESULT __cdecl Decompress(
DIRECTX_TEX_API HRESULT __cdecl Decompress(_In_ const Image& cImage, _In_ DXGI_FORMAT format, _Out_ ScratchImage& image) noexcept;
DIRECTX_TEX_API HRESULT __cdecl Decompress(
_In_reads_(nimages) const Image* cImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ DXGI_FORMAT format, _Out_ ScratchImage& images) noexcept;
//---------------------------------------------------------------------------------
// Normal map operations
enum CNMAP_FLAGS : unsigned long
enum CNMAP_FLAGS : uint32_t
{
CNMAP_DEFAULT = 0,
@ -764,17 +987,17 @@ namespace DirectX
// Computes a crude occlusion term stored in the alpha channel
};
HRESULT __cdecl ComputeNormalMap(
DIRECTX_TEX_API HRESULT __cdecl ComputeNormalMap(
_In_ const Image& srcImage, _In_ CNMAP_FLAGS flags, _In_ float amplitude,
_In_ DXGI_FORMAT format, _Out_ ScratchImage& normalMap) noexcept;
HRESULT __cdecl ComputeNormalMap(
DIRECTX_TEX_API HRESULT __cdecl ComputeNormalMap(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ CNMAP_FLAGS flags, _In_ float amplitude, _In_ DXGI_FORMAT format, _Out_ ScratchImage& normalMaps) noexcept;
//---------------------------------------------------------------------------------
// Misc image operations
struct Rect
struct DIRECTX_TEX_API Rect
{
size_t x;
size_t y;
@ -785,11 +1008,11 @@ namespace DirectX
Rect(size_t _x, size_t _y, size_t _w, size_t _h) noexcept : x(_x), y(_y), w(_w), h(_h) {}
};
HRESULT __cdecl CopyRectangle(
DIRECTX_TEX_API HRESULT __cdecl CopyRectangle(
_In_ const Image& srcImage, _In_ const Rect& srcRect, _In_ const Image& dstImage,
_In_ TEX_FILTER_FLAGS filter, _In_ size_t xOffset, _In_ size_t yOffset) noexcept;
enum CMSE_FLAGS : unsigned long
enum CMSE_FLAGS : uint32_t
{
CMSE_DEFAULT = 0,
@ -808,21 +1031,21 @@ namespace DirectX
// Indicates that image should be scaled and biased before comparison (i.e. UNORM -> SNORM)
};
HRESULT __cdecl ComputeMSE(_In_ const Image& image1, _In_ const Image& image2, _Out_ float& mse, _Out_writes_opt_(4) float* mseV, _In_ CMSE_FLAGS flags = CMSE_DEFAULT) noexcept;
DIRECTX_TEX_API HRESULT __cdecl ComputeMSE(_In_ const Image& image1, _In_ const Image& image2, _Out_ float& mse, _Out_writes_opt_(4) float* mseV, _In_ CMSE_FLAGS flags = CMSE_DEFAULT) noexcept;
HRESULT __cdecl EvaluateImage(
DIRECTX_TEX_API HRESULT __cdecl EvaluateImage(
_In_ const Image& image,
_In_ std::function<void __cdecl(_In_reads_(width) const XMVECTOR* pixels, size_t width, size_t y)> pixelFunc);
HRESULT __cdecl EvaluateImage(
DIRECTX_TEX_API HRESULT __cdecl EvaluateImage(
_In_reads_(nimages) const Image* images, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ std::function<void __cdecl(_In_reads_(width) const XMVECTOR* pixels, size_t width, size_t y)> pixelFunc);
HRESULT __cdecl TransformImage(
DIRECTX_TEX_API HRESULT __cdecl TransformImage(
_In_ const Image& image,
_In_ std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels,
_In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
ScratchImage& result);
HRESULT __cdecl TransformImage(
DIRECTX_TEX_API HRESULT __cdecl TransformImage(
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ std::function<void __cdecl(_Out_writes_(width) XMVECTOR* outPixels,
_In_reads_(width) const XMVECTOR* inPixels, size_t width, size_t y)> pixelFunc,
@ -831,7 +1054,7 @@ namespace DirectX
//---------------------------------------------------------------------------------
// WIC utility code
#ifdef _WIN32
enum WICCodecs
enum WICCodecs : uint32_t
{
WIC_CODEC_BMP = 1, // Windows Bitmap (.bmp)
WIC_CODEC_JPEG, // Joint Photographic Experts Group (.jpg, .jpeg)
@ -843,19 +1066,31 @@ namespace DirectX
WIC_CODEC_HEIF, // High Efficiency Image File (.heif, .heic)
};
REFGUID __cdecl GetWICCodec(_In_ WICCodecs codec) noexcept;
DIRECTX_TEX_API REFGUID __cdecl GetWICCodec(_In_ WICCodecs codec) noexcept;
IWICImagingFactory* __cdecl GetWICFactory(bool& iswic2) noexcept;
void __cdecl SetWICFactory(_In_opt_ IWICImagingFactory* pWIC) noexcept;
DIRECTX_TEX_API IWICImagingFactory* __cdecl GetWICFactory(bool& iswic2) noexcept;
DIRECTX_TEX_API void __cdecl SetWICFactory(_In_opt_ IWICImagingFactory* pWIC) noexcept;
#endif
//---------------------------------------------------------------------------------
// DDS helper functions
HRESULT __cdecl EncodeDDSHeader(
DIRECTX_TEX_API HRESULT __cdecl EncodeDDSHeader(
_In_ const TexMetadata& metadata, DDS_FLAGS flags,
_Out_writes_bytes_to_opt_(maxsize, required) void* pDestination, _In_ size_t maxsize,
_Out_writes_bytes_to_opt_(maxsize, required) uint8_t* pDestination, _In_ size_t maxsize,
_Out_ size_t& required) noexcept;
#ifdef __cpp_lib_byte
DIRECTX_TEX_API HRESULT __cdecl EncodeDDSHeader(
_In_ const TexMetadata& metadata, DDS_FLAGS flags,
_Out_writes_bytes_to_opt_(maxsize, required) std::byte* pDestination, _In_ size_t maxsize,
_Out_ size_t& required) noexcept;
DIRECTX_TEX_API HRESULT __cdecl EncodeDDSHeader(
_In_ const TexMetadata& metadata, DDS_FLAGS flags,
_Reserved_ std::nullptr_t, _In_ size_t maxsize,
_Out_ size_t& required) noexcept;
#endif
//---------------------------------------------------------------------------------
// Direct3D interop
@ -868,48 +1103,48 @@ namespace DirectX
// Direct3D 11 functions
#if defined(__d3d11_h__) || defined(__d3d11_x_h__)
bool __cdecl IsSupportedTexture(_In_ ID3D11Device* pDevice, _In_ const TexMetadata& metadata) noexcept;
DIRECTX_TEX_API bool __cdecl IsSupportedTexture(_In_ ID3D11Device* pDevice, _In_ const TexMetadata& metadata) noexcept;
HRESULT __cdecl CreateTexture(
DIRECTX_TEX_API HRESULT __cdecl CreateTexture(
_In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_Outptr_ ID3D11Resource** ppResource) noexcept;
HRESULT __cdecl CreateShaderResourceView(
DIRECTX_TEX_API HRESULT __cdecl CreateShaderResourceView(
_In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_Outptr_ ID3D11ShaderResourceView** ppSRV) noexcept;
HRESULT __cdecl CreateTextureEx(
DIRECTX_TEX_API HRESULT __cdecl CreateTextureEx(
_In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ CREATETEX_FLAGS flags,
_Outptr_ ID3D11Resource** ppResource) noexcept;
HRESULT __cdecl CreateShaderResourceViewEx(
DIRECTX_TEX_API HRESULT __cdecl CreateShaderResourceViewEx(
_In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ CREATETEX_FLAGS flags,
_Outptr_ ID3D11ShaderResourceView** ppSRV) noexcept;
HRESULT __cdecl CaptureTexture(_In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource* pSource, _Out_ ScratchImage& result) noexcept;
DIRECTX_TEX_API HRESULT __cdecl CaptureTexture(_In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource* pSource, _Out_ ScratchImage& result) noexcept;
#endif
// Direct3D 12 functions
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
bool __cdecl IsSupportedTexture(_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata) noexcept;
DIRECTX_TEX_API bool __cdecl IsSupportedTexture(_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata) noexcept;
HRESULT __cdecl CreateTexture(
DIRECTX_TEX_API HRESULT __cdecl CreateTexture(
_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata,
_Outptr_ ID3D12Resource** ppResource) noexcept;
HRESULT __cdecl CreateTextureEx(
DIRECTX_TEX_API HRESULT __cdecl CreateTextureEx(
_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata,
_In_ D3D12_RESOURCE_FLAGS resFlags, _In_ CREATETEX_FLAGS flags,
_Outptr_ ID3D12Resource** ppResource) noexcept;
HRESULT __cdecl PrepareUpload(
DIRECTX_TEX_API HRESULT __cdecl PrepareUpload(
_In_ ID3D12Device* pDevice,
_In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
std::vector<D3D12_SUBRESOURCE_DATA>& subresources);
HRESULT __cdecl CaptureTexture(
DIRECTX_TEX_API HRESULT __cdecl CaptureTexture(
_In_ ID3D12CommandQueue* pCommandQueue, _In_ ID3D12Resource* pSource, _In_ bool isCubeMap,
_Out_ ScratchImage& result,
_In_ D3D12_RESOURCE_STATES beforeState = D3D12_RESOURCE_STATE_RENDER_TARGET,
@ -923,12 +1158,16 @@ namespace DirectX
#pragma clang diagnostic ignored "-Wswitch-enum"
#endif
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4619 4616 4061)
#endif
#include "DirectXTex.inl"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#ifdef __clang__
#pragma clang diagnostic pop

View File

@ -14,6 +14,12 @@
//=====================================================================================
// Bitmask flags enumerator operators
//=====================================================================================
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec"
#pragma clang diagnostic ignored "-Wextra-semi-stmt"
#endif
DEFINE_ENUM_FLAG_OPERATORS(CP_FLAGS);
DEFINE_ENUM_FLAG_OPERATORS(DDS_FLAGS);
DEFINE_ENUM_FLAG_OPERATORS(TGA_FLAGS);
@ -26,17 +32,21 @@ DEFINE_ENUM_FLAG_OPERATORS(CNMAP_FLAGS);
DEFINE_ENUM_FLAG_OPERATORS(CMSE_FLAGS);
DEFINE_ENUM_FLAG_OPERATORS(CREATETEX_FLAGS);
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// WIC_FILTER modes match TEX_FILTER modes
constexpr WIC_FLAGS operator|(WIC_FLAGS a, TEX_FILTER_FLAGS b) { return static_cast<WIC_FLAGS>(static_cast<unsigned long>(a) | static_cast<unsigned long>(b & TEX_FILTER_MODE_MASK)); }
constexpr WIC_FLAGS operator|(TEX_FILTER_FLAGS a, WIC_FLAGS b) { return static_cast<WIC_FLAGS>(static_cast<unsigned long>(a & TEX_FILTER_MODE_MASK) | static_cast<unsigned long>(b)); }
constexpr WIC_FLAGS operator|(WIC_FLAGS a, TEX_FILTER_FLAGS b) { return static_cast<WIC_FLAGS>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b & TEX_FILTER_MODE_MASK)); }
constexpr WIC_FLAGS operator|(TEX_FILTER_FLAGS a, WIC_FLAGS b) { return static_cast<WIC_FLAGS>(static_cast<uint32_t>(a & TEX_FILTER_MODE_MASK) | static_cast<uint32_t>(b)); }
// TEX_PMALPHA_SRGB match TEX_FILTER_SRGB
constexpr TEX_PMALPHA_FLAGS operator|(TEX_PMALPHA_FLAGS a, TEX_FILTER_FLAGS b) { return static_cast<TEX_PMALPHA_FLAGS>(static_cast<unsigned long>(a) | static_cast<unsigned long>(b & TEX_FILTER_SRGB_MASK)); }
constexpr TEX_PMALPHA_FLAGS operator|(TEX_FILTER_FLAGS a, TEX_PMALPHA_FLAGS b) { return static_cast<TEX_PMALPHA_FLAGS>(static_cast<unsigned long>(a & TEX_FILTER_SRGB_MASK) | static_cast<unsigned long>(b)); }
constexpr TEX_PMALPHA_FLAGS operator|(TEX_PMALPHA_FLAGS a, TEX_FILTER_FLAGS b) { return static_cast<TEX_PMALPHA_FLAGS>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b & TEX_FILTER_SRGB_MASK)); }
constexpr TEX_PMALPHA_FLAGS operator|(TEX_FILTER_FLAGS a, TEX_PMALPHA_FLAGS b) { return static_cast<TEX_PMALPHA_FLAGS>(static_cast<uint32_t>(a & TEX_FILTER_SRGB_MASK) | static_cast<uint32_t>(b)); }
// TEX_COMPRESS_SRGB match TEX_FILTER_SRGB
constexpr TEX_COMPRESS_FLAGS operator|(TEX_COMPRESS_FLAGS a, TEX_FILTER_FLAGS b) { return static_cast<TEX_COMPRESS_FLAGS>(static_cast<unsigned long>(a) | static_cast<unsigned long>(b & TEX_FILTER_SRGB_MASK)); }
constexpr TEX_COMPRESS_FLAGS operator|(TEX_FILTER_FLAGS a, TEX_COMPRESS_FLAGS b) { return static_cast<TEX_COMPRESS_FLAGS>(static_cast<unsigned long>(a & TEX_FILTER_SRGB_MASK) | static_cast<unsigned long>(b)); }
constexpr TEX_COMPRESS_FLAGS operator|(TEX_COMPRESS_FLAGS a, TEX_FILTER_FLAGS b) { return static_cast<TEX_COMPRESS_FLAGS>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b & TEX_FILTER_SRGB_MASK)); }
constexpr TEX_COMPRESS_FLAGS operator|(TEX_FILTER_FLAGS a, TEX_COMPRESS_FLAGS b) { return static_cast<TEX_COMPRESS_FLAGS>(static_cast<uint32_t>(a & TEX_FILTER_SRGB_MASK) | static_cast<uint32_t>(b)); }
//=====================================================================================
@ -46,7 +56,7 @@ constexpr TEX_COMPRESS_FLAGS operator|(TEX_FILTER_FLAGS a, TEX_COMPRESS_FLAGS b)
_Use_decl_annotations_
constexpr bool __cdecl IsValid(DXGI_FORMAT fmt) noexcept
{
return (static_cast<size_t>(fmt) >= 1 && static_cast<size_t>(fmt) <= 190);
return (static_cast<size_t>(fmt) >= 1 && static_cast<size_t>(fmt) <= 191);
}
_Use_decl_annotations_
@ -117,27 +127,6 @@ inline bool __cdecl IsSRGB(DXGI_FORMAT fmt) noexcept
}
}
_Use_decl_annotations_
inline bool __cdecl IsBGR(DXGI_FORMAT fmt) noexcept
{
switch (fmt)
{
case DXGI_FORMAT_B5G6R5_UNORM:
case DXGI_FORMAT_B5G5R5A1_UNORM:
case DXGI_FORMAT_B8G8R8A8_UNORM:
case DXGI_FORMAT_B8G8R8X8_UNORM:
case DXGI_FORMAT_B8G8R8A8_TYPELESS:
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
case DXGI_FORMAT_B8G8R8X8_TYPELESS:
case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
case DXGI_FORMAT_B4G4R4A4_UNORM:
return true;
default:
return false;
}
}
//=====================================================================================
// Image I/O
@ -177,7 +166,7 @@ inline HRESULT __cdecl SaveToDDSFile(const Image& image, DDS_FLAGS flags, const
// Compatability helpers
//=====================================================================================
_Use_decl_annotations_
inline HRESULT __cdecl GetMetadataFromTGAMemory(const void* pSource, size_t size, TexMetadata& metadata) noexcept
inline HRESULT __cdecl GetMetadataFromTGAMemory(const uint8_t* pSource, size_t size, TexMetadata& metadata) noexcept
{
return GetMetadataFromTGAMemory(pSource, size, TGA_FLAGS_NONE, metadata);
}
@ -189,7 +178,7 @@ inline HRESULT __cdecl GetMetadataFromTGAFile(const wchar_t* szFile, TexMetadata
}
_Use_decl_annotations_
inline HRESULT __cdecl LoadFromTGAMemory(const void* pSource, size_t size, TexMetadata* metadata, ScratchImage& image) noexcept
inline HRESULT __cdecl LoadFromTGAMemory(const uint8_t* pSource, size_t size, TexMetadata* metadata, ScratchImage& image) noexcept
{
return LoadFromTGAMemory(pSource, size, TGA_FLAGS_NONE, metadata, image);
}
@ -211,3 +200,85 @@ inline HRESULT __cdecl SaveToTGAFile(const Image& image, const wchar_t* szFile,
{
return SaveToTGAFile(image, TGA_FLAGS_NONE, szFile, metadata);
}
//=====================================================================================
// C++17 helpers
//=====================================================================================
#ifdef __cpp_lib_byte
_Use_decl_annotations_
inline HRESULT __cdecl GetMetadataFromDDSMemory(const std::byte* pSource, size_t size, DDS_FLAGS flags, TexMetadata& metadata) noexcept
{
return GetMetadataFromDDSMemory(reinterpret_cast<const uint8_t*>(pSource), size, flags, metadata);
}
_Use_decl_annotations_
inline HRESULT __cdecl LoadFromDDSMemory(const std::byte* pSource, size_t size, DDS_FLAGS flags, TexMetadata* metadata, ScratchImage& image) noexcept
{
return LoadFromDDSMemory(reinterpret_cast<const uint8_t*>(pSource), size, flags, metadata, image);
}
_Use_decl_annotations_
inline HRESULT __cdecl GetMetadataFromDDSMemoryEx(const std::byte* pSource, size_t size, DDS_FLAGS flags, TexMetadata& metadata, DDSMetaData* ddPixelFormat) noexcept
{
return GetMetadataFromDDSMemoryEx(reinterpret_cast<const uint8_t*>(pSource), size, flags, metadata, ddPixelFormat);
}
_Use_decl_annotations_
inline HRESULT __cdecl LoadFromDDSMemoryEx(const std::byte* pSource, size_t size, DDS_FLAGS flags, TexMetadata* metadata, DDSMetaData* ddPixelFormat, ScratchImage& image) noexcept
{
return LoadFromDDSMemoryEx(reinterpret_cast<const uint8_t*>(pSource), size, flags, metadata, ddPixelFormat, image);
}
_Use_decl_annotations_
inline HRESULT __cdecl GetMetadataFromHDRMemory(const std::byte* pSource, size_t size, TexMetadata& metadata) noexcept
{
return GetMetadataFromHDRMemory(reinterpret_cast<const uint8_t*>(pSource), size, metadata);
}
_Use_decl_annotations_
inline HRESULT __cdecl LoadFromHDRMemory(const std::byte* pSource, size_t size, TexMetadata* metadata, ScratchImage& image) noexcept
{
return LoadFromHDRMemory(reinterpret_cast<const uint8_t*>(pSource), size, metadata, image);
}
_Use_decl_annotations_
inline HRESULT __cdecl GetMetadataFromTGAMemory(const std::byte* pSource, size_t size, TGA_FLAGS flags, TexMetadata& metadata) noexcept
{
return GetMetadataFromTGAMemory(reinterpret_cast<const uint8_t*>(pSource), size, flags, metadata);
}
_Use_decl_annotations_
inline HRESULT __cdecl LoadFromTGAMemory(const std::byte* pSource, size_t size, TGA_FLAGS flags, TexMetadata* metadata, ScratchImage& image) noexcept
{
return LoadFromTGAMemory(reinterpret_cast<const uint8_t*>(pSource), size, flags, metadata, image);
}
_Use_decl_annotations_
inline HRESULT __cdecl EncodeDDSHeader(const TexMetadata& metadata, DDS_FLAGS flags, std::byte* pDestination, size_t maxsize, size_t& required) noexcept
{
return EncodeDDSHeader(metadata, flags, reinterpret_cast<uint8_t*>(pDestination), maxsize, required);
}
_Use_decl_annotations_
inline HRESULT __cdecl EncodeDDSHeader(const TexMetadata& metadata, DDS_FLAGS flags, std::nullptr_t, size_t maxsize, size_t& required) noexcept
{
return EncodeDDSHeader(metadata, flags, static_cast<uint8_t*>(nullptr), maxsize, required);
}
#ifdef _WIN32
_Use_decl_annotations_
inline HRESULT __cdecl GetMetadataFromWICMemory(const std::byte* pSource, size_t size, WIC_FLAGS flags, TexMetadata& metadata, std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR)
{
return GetMetadataFromWICMemory(reinterpret_cast<const uint8_t*>(pSource), size, flags, metadata, getMQR);
}
_Use_decl_annotations_
inline HRESULT __cdecl LoadFromWICMemory(const std::byte* pSource, size_t size, WIC_FLAGS flags, TexMetadata* metadata, ScratchImage& image, std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR)
{
return LoadFromWICMemory(reinterpret_cast<const uint8_t*>(pSource), size, flags, metadata, image, getMQR);
}
#endif // _WIN32
#endif // __cpp_lib_byte

View File

@ -74,7 +74,8 @@ namespace
const Image& result,
uint32_t bcflags,
TEX_FILTER_FLAGS srgb,
float threshold) noexcept
float threshold,
const std::function<bool __cdecl(size_t, size_t)>& statusCallback) noexcept
{
if (!image.pixels || !result.pixels)
return E_POINTER;
@ -111,6 +112,14 @@ namespace
const size_t rowPitch = image.rowPitch;
for (size_t h = 0; h < image.height; h += 4)
{
if (statusCallback)
{
if (!statusCallback(h, image.height))
{
return E_ABORT;
}
}
const uint8_t *sptr = pSrc;
uint8_t* dptr = pDest;
const size_t ph = std::min<size_t>(4, image.height - h);
@ -203,7 +212,8 @@ namespace
const Image& result,
uint32_t bcflags,
TEX_FILTER_FLAGS srgb,
float threshold) noexcept
float threshold,
const std::function<bool __cdecl(size_t, size_t)>& statusCallback) noexcept
{
if (!image.pixels || !result.pixels)
return E_POINTER;
@ -239,9 +249,22 @@ namespace
bool fail = false;
#pragma omp parallel for
size_t progress = 0;
bool abort = false;
const size_t progressTotal = std::max<size_t>(1, (image.height + 3) / 4);
#pragma omp parallel for shared(progress)
for (int nb = 0; nb < static_cast<int>(nBlocks); ++nb)
{
#pragma omp flush (abort)
if (abort)
{
// Short circuit the loop body if an abort is requested.
// OpenMP 2.0 does not support cancellation of a 'parallel for' loop.
continue;
}
const int nbWidth = std::max<int>(1, int((image.width + 3) / 4));
int y = nb / nbWidth;
@ -323,9 +346,29 @@ namespace
pfEncode(pDest, temp, bcflags);
else
D3DXEncodeBC1(pDest, temp, threshold, bcflags);
// Report progress when a new row is reached.
if (x == 0 && statusCallback)
{
#pragma omp atomic
progress += 4;
if (!statusCallback(progress, progressTotal))
{
abort = true;
#pragma omp flush (abort)
}
}
}
return (fail) ? E_FAIL : S_OK;
if (abort)
{
return E_ABORT;
}
else
{
return (fail) ? E_FAIL : S_OK;
}
}
#endif // _OPENMP
@ -592,6 +635,38 @@ HRESULT DirectX::Compress(
TEX_COMPRESS_FLAGS compress,
float threshold,
ScratchImage& image) noexcept
{
CompressOptions options = {};
options.flags = compress;
options.threshold = threshold;
return CompressEx(srcImage, format, options, image, nullptr);
}
_Use_decl_annotations_
HRESULT DirectX::Compress(
const Image* srcImages,
size_t nimages,
const TexMetadata& metadata,
DXGI_FORMAT format,
TEX_COMPRESS_FLAGS compress,
float threshold,
ScratchImage& cImages) noexcept
{
CompressOptions options = {};
options.flags = compress;
options.threshold = threshold;
return CompressEx(srcImages, nimages, metadata, format, options, cImages, nullptr);
}
_Use_decl_annotations_
HRESULT DirectX::CompressEx(
const Image& srcImage,
DXGI_FORMAT format,
const CompressOptions& options,
ScratchImage& image,
std::function<bool __cdecl(size_t, size_t)> statusCallback)
{
if (IsCompressed(srcImage.format) || !IsCompressed(format))
return E_INVALIDARG;
@ -612,35 +687,56 @@ HRESULT DirectX::Compress(
return E_POINTER;
}
if (statusCallback)
{
if (!statusCallback(0, img->height))
{
image.Release();
return E_ABORT;
}
}
// Compress single image
if (compress & TEX_COMPRESS_PARALLEL)
if (options.flags & TEX_COMPRESS_PARALLEL)
{
#ifndef _OPENMP
return E_NOTIMPL;
hr = E_NOTIMPL;
#else
hr = CompressBC_Parallel(srcImage, *img, GetBCFlags(compress), GetSRGBFlags(compress), threshold);
hr = CompressBC_Parallel(srcImage, *img, GetBCFlags(options.flags), GetSRGBFlags(options.flags), options.threshold, statusCallback);
#endif // _OPENMP
}
else
{
hr = CompressBC(srcImage, *img, GetBCFlags(compress), GetSRGBFlags(compress), threshold);
hr = CompressBC(srcImage, *img, GetBCFlags(options.flags), GetSRGBFlags(options.flags), options.threshold, statusCallback);
}
if (FAILED(hr))
{
image.Release();
return hr;
}
return hr;
if (statusCallback)
{
if (!statusCallback(img->height, img->height))
{
image.Release();
return E_ABORT;
}
}
return S_OK;
}
_Use_decl_annotations_
HRESULT DirectX::Compress(
HRESULT DirectX::CompressEx(
const Image* srcImages,
size_t nimages,
const TexMetadata& metadata,
DXGI_FORMAT format,
TEX_COMPRESS_FLAGS compress,
float threshold,
ScratchImage& cImages) noexcept
const CompressOptions& options,
ScratchImage& cImages,
std::function<bool __cdecl(size_t, size_t)> statusCallback)
{
if (!srcImages || !nimages)
return E_INVALIDARG;
@ -654,6 +750,19 @@ HRESULT DirectX::Compress(
cImages.Release();
if (statusCallback
&& nimages == 1
&& !metadata.IsVolumemap()
&& metadata.mipLevels == 1
&& metadata.arraySize == 1)
{
// If progress reporting is requested when compressing a single 1D or 2D image, call
// the CompressEx overload that takes a single image.
// This provides a better user experience as progress will be reported as the image
// is being processed, instead of after processing has been completed.
return CompressEx(srcImages[0], format, options, cImages, statusCallback);
}
TexMetadata mdata2 = metadata;
mdata2.format = format;
HRESULT hr = cImages.Initialize(mdata2);
@ -673,6 +782,15 @@ HRESULT DirectX::Compress(
return E_POINTER;
}
if (statusCallback)
{
if (!statusCallback(0, nimages))
{
cImages.Release();
return E_ABORT;
}
}
for (size_t index = 0; index < nimages; ++index)
{
assert(dest[index].format == format);
@ -685,33 +803,44 @@ HRESULT DirectX::Compress(
return E_FAIL;
}
if ((compress & TEX_COMPRESS_PARALLEL))
if (options.flags & TEX_COMPRESS_PARALLEL)
{
#ifndef _OPENMP
return E_NOTIMPL;
hr = E_NOTIMPL;
#else
if (compress & TEX_COMPRESS_PARALLEL)
{
hr = CompressBC_Parallel(src, dest[index], GetBCFlags(compress), GetSRGBFlags(compress), threshold);
if (FAILED(hr))
{
cImages.Release();
return hr;
}
}
hr = CompressBC_Parallel(src, dest[index], GetBCFlags(options.flags), GetSRGBFlags(options.flags), options.threshold, nullptr);
#endif // _OPENMP
}
else
{
hr = CompressBC(src, dest[index], GetBCFlags(compress), GetSRGBFlags(compress), threshold);
if (FAILED(hr))
hr = CompressBC(src, dest[index], GetBCFlags(options.flags), GetSRGBFlags(options.flags), options.threshold, nullptr);
}
if (FAILED(hr))
{
cImages.Release();
return hr;
}
if (statusCallback)
{
if (!statusCallback(index, nimages))
{
cImages.Release();
return hr;
return E_ABORT;
}
}
}
if (statusCallback)
{
if (!statusCallback(nimages, nimages))
{
cImages.Release();
return E_ABORT;
}
}
return S_OK;
}

View File

@ -154,9 +154,14 @@ namespace
assert(srcImage.pixels && destImage.pixels);
const DXGI_FORMAT format = gpubc->GetSourceFormat();
DXGI_FORMAT tformat = gpubc->GetSourceFormat();
if (compress & TEX_COMPRESS_SRGB_OUT)
{
tformat = MakeSRGB(tformat);
}
const DXGI_FORMAT sformat = (compress & TEX_COMPRESS_SRGB_IN) ? MakeSRGB(srcImage.format) : srcImage.format;
if (srcImage.format == format)
if (sformat == tformat)
{
// Input is already in our required source format
return gpubc->Compress(srcImage, destImage);
@ -167,9 +172,9 @@ namespace
ScratchImage image;
HRESULT hr = E_UNEXPECTED;
auto const srgb = GetSRGBFlags(compress);
const auto srgb = GetSRGBFlags(compress);
switch (format)
switch (tformat)
{
case DXGI_FORMAT_R8G8B8A8_UNORM:
hr = ConvertToRGBA32(srcImage, image, false, srgb);
@ -214,6 +219,40 @@ HRESULT DirectX::Compress(
TEX_COMPRESS_FLAGS compress,
float alphaWeight,
ScratchImage& image) noexcept
{
CompressOptions options = {};
options.flags = compress;
options.alphaWeight = alphaWeight;
return CompressEx(pDevice, srcImage, format, options, image, nullptr);
}
_Use_decl_annotations_
HRESULT DirectX::Compress(
ID3D11Device* pDevice,
const Image* srcImages,
size_t nimages,
const TexMetadata& metadata,
DXGI_FORMAT format,
TEX_COMPRESS_FLAGS compress,
float alphaWeight,
ScratchImage& cImages) noexcept
{
CompressOptions options = {};
options.flags = compress;
options.alphaWeight = alphaWeight;
return CompressEx(pDevice, srcImages, nimages, metadata, format, options, cImages);
}
_Use_decl_annotations_
HRESULT DirectX::CompressEx(
ID3D11Device* pDevice,
const Image& srcImage,
DXGI_FORMAT format,
const CompressOptions& options,
ScratchImage& image,
std::function<bool __cdecl(size_t, size_t)> statusCallback)
{
if (!pDevice || IsCompressed(srcImage.format) || !IsCompressed(format))
return E_INVALIDARG;
@ -222,6 +261,9 @@ HRESULT DirectX::Compress(
|| IsTypeless(srcImage.format) || IsPlanar(srcImage.format) || IsPalettized(srcImage.format))
return HRESULT_E_NOT_SUPPORTED;
if (!srcImage.pixels)
return E_POINTER;
// Setup GPU compressor
std::unique_ptr<GPUCompressBC> gpubc(new (std::nothrow) GPUCompressBC);
if (!gpubc)
@ -231,7 +273,7 @@ HRESULT DirectX::Compress(
if (FAILED(hr))
return hr;
hr = gpubc->Prepare(srcImage.width, srcImage.height, compress, format, alphaWeight);
hr = gpubc->Prepare(srcImage.width, srcImage.height, options.flags, format, options.alphaWeight);
if (FAILED(hr))
return hr;
@ -247,23 +289,45 @@ HRESULT DirectX::Compress(
return E_POINTER;
}
hr = GPUCompress(gpubc.get(), srcImage, *img, compress);
if (FAILED(hr))
image.Release();
if (statusCallback)
{
if (!statusCallback(0, 100))
{
image.Release();
return E_ABORT;
}
}
return hr;
hr = GPUCompress(gpubc.get(), srcImage, *img, options.flags);
if (FAILED(hr))
{
image.Release();
return hr;
}
if (statusCallback)
{
if (!statusCallback(100, 100))
{
image.Release();
return E_ABORT;
}
}
return S_OK;
}
_Use_decl_annotations_
HRESULT DirectX::Compress(
HRESULT DirectX::CompressEx(
ID3D11Device* pDevice,
const Image* srcImages,
size_t nimages,
const TexMetadata& metadata,
DXGI_FORMAT format,
TEX_COMPRESS_FLAGS compress,
float alphaWeight,
ScratchImage& cImages) noexcept
const CompressOptions& options,
ScratchImage& cImages,
std::function<bool __cdecl(size_t, size_t)> statusCallback)
{
if (!pDevice || !srcImages || !nimages)
return E_INVALIDARG;
@ -306,6 +370,15 @@ HRESULT DirectX::Compress(
return E_POINTER;
}
if (statusCallback)
{
if (!statusCallback(0, nimages))
{
cImages.Release();
return E_ABORT;
}
}
// Process images (ordered by size)
switch (metadata.dimension)
{
@ -314,10 +387,11 @@ HRESULT DirectX::Compress(
{
size_t w = metadata.width;
size_t h = metadata.height;
size_t progress = 0;
for (size_t level = 0; level < metadata.mipLevels; ++level)
{
hr = gpubc->Prepare(w, h, compress, format, alphaWeight);
hr = gpubc->Prepare(w, h, options.flags, format, options.alphaWeight);
if (FAILED(hr))
{
cImages.Release();
@ -343,12 +417,21 @@ HRESULT DirectX::Compress(
return E_FAIL;
}
hr = GPUCompress(gpubc.get(), src, dest[index], compress);
hr = GPUCompress(gpubc.get(), src, dest[index], options.flags);
if (FAILED(hr))
{
cImages.Release();
return hr;
}
if (statusCallback)
{
if (!statusCallback(progress++, nimages))
{
cImages.Release();
return E_ABORT;
}
}
}
if (h > 1)
@ -365,10 +448,11 @@ HRESULT DirectX::Compress(
size_t w = metadata.width;
size_t h = metadata.height;
size_t d = metadata.depth;
size_t progress = 0;
for (size_t level = 0; level < metadata.mipLevels; ++level)
{
hr = gpubc->Prepare(w, h, compress, format, alphaWeight);
hr = gpubc->Prepare(w, h, options.flags, format, options.alphaWeight);
if (FAILED(hr))
{
cImages.Release();
@ -394,12 +478,21 @@ HRESULT DirectX::Compress(
return E_FAIL;
}
hr = GPUCompress(gpubc.get(), src, dest[index], compress);
hr = GPUCompress(gpubc.get(), src, dest[index], options.flags);
if (FAILED(hr))
{
cImages.Release();
return hr;
}
if (statusCallback)
{
if (!statusCallback(progress++, nimages))
{
cImages.Release();
return E_ABORT;
}
}
}
if (h > 1)
@ -418,5 +511,14 @@ HRESULT DirectX::Compress(
return HRESULT_E_NOT_SUPPORTED;
}
if (statusCallback)
{
if (!statusCallback(nimages, nimages))
{
cImages.Release();
return E_ABORT;
}
}
return S_OK;
}

View File

@ -378,14 +378,24 @@ void DirectX::Internal::CopyScanline(
//-----------------------------------------------------------------------------
case DXGI_FORMAT_B5G5R5A1_UNORM:
case DXGI_FORMAT_B4G4R4A4_UNORM:
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
if (inSize >= 2 && outSize >= 2)
{
uint16_t alpha;
if (format == DXGI_FORMAT_B4G4R4A4_UNORM)
alpha = 0xF000;
else if (format == WIN11_DXGI_FORMAT_A4B4G4R4_UNORM)
alpha = 0x000F;
else
alpha = 0x8000;
if (pDestination == pSource)
{
auto dPtr = static_cast<uint16_t*>(pDestination);
for (size_t count = 0; count < (outSize - 1); count += 2)
{
*(dPtr++) |= 0x8000;
*(dPtr++) |= alpha;
}
}
else
@ -395,7 +405,7 @@ void DirectX::Internal::CopyScanline(
const size_t size = std::min<size_t>(outSize, inSize);
for (size_t count = 0; count < (size - 1); count += 2)
{
*(dPtr++) = uint16_t(*(sPtr++) | 0x8000);
*(dPtr++) = uint16_t(*(sPtr++) | alpha);
}
}
}
@ -406,30 +416,8 @@ void DirectX::Internal::CopyScanline(
memset(pDestination, 0xff, outSize);
return;
//-----------------------------------------------------------------------------
case DXGI_FORMAT_B4G4R4A4_UNORM:
if (inSize >= 2 && outSize >= 2)
{
if (pDestination == pSource)
{
auto dPtr = static_cast<uint16_t*>(pDestination);
for (size_t count = 0; count < (outSize - 1); count += 2)
{
*(dPtr++) |= 0xF000;
}
}
else
{
const uint16_t * __restrict sPtr = static_cast<const uint16_t*>(pSource);
uint16_t * __restrict dPtr = static_cast<uint16_t*>(pDestination);
const size_t size = std::min<size_t>(outSize, inSize);
for (size_t count = 0; count < (size - 1); count += 2)
{
*(dPtr++) = uint16_t(*(sPtr++) | 0xF000);
}
}
}
return;
default:
break;
}
}
@ -601,6 +589,9 @@ void DirectX::Internal::SwizzleScanline(
}
}
break;
default:
break;
}
// Fall-through case is to just use memcpy (assuming this is not an in-place operation)
@ -631,7 +622,7 @@ bool DirectX::Internal::ExpandScanline(
assert(IsValid(outFormat) && !IsPlanar(outFormat) && !IsPalettized(outFormat));
assert(IsValid(inFormat) && !IsPlanar(inFormat) && !IsPalettized(inFormat));
switch (inFormat)
switch (static_cast<int>(inFormat))
{
case DXGI_FORMAT_B5G6R5_UNORM:
if (outFormat != DXGI_FORMAT_R8G8B8A8_UNORM)
@ -707,6 +698,31 @@ bool DirectX::Internal::ExpandScanline(
}
return false;
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
if (outFormat != DXGI_FORMAT_R8G8B8A8_UNORM)
return false;
// DXGI_FORMAT_A4B4G4R4_UNORM -> DXGI_FORMAT_R8G8B8A8_UNORM
if (inSize >= 2 && outSize >= 4)
{
const uint16_t * __restrict sPtr = static_cast<const uint16_t*>(pSource);
uint32_t * __restrict dPtr = static_cast<uint32_t*>(pDestination);
for (size_t ocount = 0, icount = 0; ((icount < (inSize - 1)) && (ocount < (outSize - 3))); icount += 2, ocount += 4)
{
const uint16_t t = *(sPtr++);
uint32_t t1 = uint32_t(((t & 0xf000) >> 8) | ((t & 0xf000) >> 12));
uint32_t t2 = uint32_t((t & 0x0f00) | ((t & 0x0f00) << 4));
uint32_t t3 = uint32_t(((t & 0x00f0) << 16) | ((t & 0x00f0) << 12));
uint32_t ta = (tflags & TEXP_SCANLINE_SETALPHA) ? 0xff000000 : uint32_t(((t & 0x000f) << 28) | ((t & 0x000f) << 24));
*(dPtr++) = t1 | t2 | t3 | ta;
}
return true;
}
return false;
default:
return false;
}
@ -967,8 +983,8 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
auto sPtr = static_cast<const uint32_t*>(pSource);
for (size_t icount = 0; icount < (size - sizeof(uint32_t) + 1); icount += sizeof(uint32_t))
{
auto const d = static_cast<float>(*sPtr & 0xFFFFFF) / 16777215.f;
auto const s = static_cast<float>((*sPtr & 0xFF000000) >> 24);
const auto d = static_cast<float>(*sPtr & 0xFFFFFF) / 16777215.f;
const auto s = static_cast<float>((*sPtr & 0xFF000000) >> 24);
++sPtr;
if (dPtr >= ePtr) break;
*(dPtr++) = XMVectorSet(d, s, 0.f, 1.f);
@ -983,7 +999,7 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
auto sPtr = static_cast<const uint32_t*>(pSource);
for (size_t icount = 0; icount < (size - sizeof(uint32_t) + 1); icount += sizeof(uint32_t))
{
auto const r = static_cast<float>(*sPtr & 0xFFFFFF) / 16777215.f;
const auto r = static_cast<float>(*sPtr & 0xFFFFFF) / 16777215.f;
++sPtr;
if (dPtr >= ePtr) break;
*(dPtr++) = XMVectorSet(r, 0.f /* typeless component assumed zero */, 0.f, 1.f);
@ -998,7 +1014,7 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
auto sPtr = static_cast<const uint32_t*>(pSource);
for (size_t icount = 0; icount < (size - sizeof(uint32_t) + 1); icount += sizeof(uint32_t))
{
auto const g = static_cast<float>((*sPtr & 0xFF000000) >> 24);
const auto g = static_cast<float>((*sPtr & 0xFF000000) >> 24);
++sPtr;
if (dPtr >= ePtr) break;
*(dPtr++) = XMVectorSet(0.f /* typeless component assumed zero */, g, 0.f, 1.f);
@ -1328,9 +1344,9 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
// G = 1.1678Y' - 0.3929Cb' - 0.8152Cr'
// B = 1.1678Y' + 2.0232Cb'
auto const r = static_cast<int>((76533 * y + 104905 * v + 32768) >> 16);
auto const g = static_cast<int>((76533 * y - 25747 * u - 53425 * v + 32768) >> 16);
auto const b = static_cast<int>((76533 * y + 132590 * u + 32768) >> 16);
const auto r = static_cast<int>((76533 * y + 104905 * v + 32768) >> 16);
const auto g = static_cast<int>((76533 * y - 25747 * u - 53425 * v + 32768) >> 16);
const auto b = static_cast<int>((76533 * y + 132590 * u + 32768) >> 16);
if (dPtr >= ePtr) break;
*(dPtr++) = XMVectorSet(float(std::min<int>(std::max<int>(r, 0), 1023)) / 1023.f,
@ -1351,7 +1367,7 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
const int64_t u = int64_t(sPtr->x) - 32768;
const int64_t y = int64_t(sPtr->y) - 4096;
const int64_t v = int64_t(sPtr->z) - 32768;
auto const a = static_cast<int>(sPtr->w);
const auto a = static_cast<int>(sPtr->w);
++sPtr;
// http://msdn.microsoft.com/en-us/library/windows/desktop/bb970578.aspx
@ -1364,9 +1380,9 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
// G = 1.1689Y' - 0.3933Cb' - 0.8160Cr'
// B = 1.1689Y'+ 2.0251Cb'
auto const r = static_cast<int>((76607 * y + 105006 * v + 32768) >> 16);
auto const g = static_cast<int>((76607 * y - 25772 * u - 53477 * v + 32768) >> 16);
auto const b = static_cast<int>((76607 * y + 132718 * u + 32768) >> 16);
const auto r = static_cast<int>((76607 * y + 105006 * v + 32768) >> 16);
const auto g = static_cast<int>((76607 * y - 25772 * u - 53477 * v + 32768) >> 16);
const auto b = static_cast<int>((76607 * y + 132718 * u + 32768) >> 16);
if (dPtr >= ePtr) break;
*(dPtr++) = XMVectorSet(float(std::min<int>(std::max<int>(r, 0), 65535)) / 65535.f,
@ -1506,6 +1522,22 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
}
return false;
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
if (size >= sizeof(XMUNIBBLE4))
{
static const XMVECTORF32 s_Scale = { { { 1.f / 15.f, 1.f / 15.f, 1.f / 15.f, 1.f / 15.f } } };
const XMUNIBBLE4 * __restrict sPtr = static_cast<const XMUNIBBLE4*>(pSource);
for (size_t icount = 0; icount < (size - sizeof(XMUNIBBLE4) + 1); icount += sizeof(XMUNIBBLE4))
{
XMVECTOR v = XMLoadUNibble4(sPtr++);
v = XMVectorMultiply(v, s_Scale);
if (dPtr >= ePtr) break;
*(dPtr++) = XMVectorSwizzle<3, 2, 1, 0>(v);
}
return true;
}
return false;
case XBOX_DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT:
// Xbox One specific 7e3 format
if (size >= sizeof(XMUDECN4))
@ -2068,7 +2100,11 @@ bool DirectX::Internal::StoreScanline(
{
if (sPtr >= ePtr) break;
XMVECTOR v = XMVectorSwizzle<2, 1, 0, 3>(*sPtr++);
#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__
v = XMVectorMultiplyAdd(v, s_Scale, g_XMOneHalf);
#else
v = XMVectorMultiply(v, s_Scale);
#endif
XMStoreU565(dPtr++, v);
}
return true;
@ -2079,12 +2115,19 @@ bool DirectX::Internal::StoreScanline(
if (size >= sizeof(XMU555))
{
static const XMVECTORF32 s_Scale = { { { 31.f, 31.f, 31.f, 1.f } } };
#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__
static const XMVECTORF32 s_OneHalfXYZ = { { { 0.5f, 0.5f, 0.5f, 0.f } } };
#endif
XMU555 * __restrict dPtr = static_cast<XMU555*>(pDestination);
for (size_t icount = 0; icount < (size - sizeof(XMU555) + 1); icount += sizeof(XMU555))
{
if (sPtr >= ePtr) break;
XMVECTOR v = XMVectorSwizzle<2, 1, 0, 3>(*sPtr++);
#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__
v = XMVectorMultiplyAdd(v, s_Scale, s_OneHalfXYZ);
#else
v = XMVectorMultiply(v, s_Scale);
#endif
XMStoreU555(dPtr, v);
dPtr->w = (XMVectorGetW(v) > threshold) ? 1u : 0u;
++dPtr;
@ -2360,7 +2403,31 @@ bool DirectX::Internal::StoreScanline(
{
if (sPtr >= ePtr) break;
XMVECTOR v = XMVectorSwizzle<2, 1, 0, 3>(*sPtr++);
#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__
v = XMVectorMultiplyAdd(v, s_Scale, g_XMOneHalf);
#else
v = XMVectorMultiply(v, s_Scale);
#endif
XMStoreUNibble4(dPtr++, v);
}
return true;
}
return false;
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
if (size >= sizeof(XMUNIBBLE4))
{
static const XMVECTORF32 s_Scale = { { { 15.f, 15.f, 15.f, 15.f } } };
XMUNIBBLE4 * __restrict dPtr = static_cast<XMUNIBBLE4*>(pDestination);
for (size_t icount = 0; icount < (size - sizeof(XMUNIBBLE4) + 1); icount += sizeof(XMUNIBBLE4))
{
if (sPtr >= ePtr) break;
XMVECTOR v = XMVectorSwizzle<3, 2, 1, 0>(*sPtr++);
#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__
v = XMVectorMultiplyAdd(v, s_Scale, g_XMOneHalf);
#else
v = XMVectorMultiply(v, s_Scale);
#endif
XMStoreUNibble4(dPtr++, v);
}
return true;
@ -2436,8 +2503,11 @@ bool DirectX::Internal::StoreScanline(
for (size_t icount = 0; icount < (size - sizeof(uint8_t) + 1); icount += sizeof(uint8_t))
{
if (sPtr >= ePtr) break;
#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__
const XMVECTOR v = XMVectorMultiplyAdd(*sPtr++, s_Scale, g_XMOneHalf);
#else
const XMVECTOR v = XMVectorMultiply(*sPtr++, s_Scale);
#endif
XMUNIBBLE4 nibble;
XMStoreUNibble4(&nibble, v);
*dPtr = static_cast<uint8_t>(nibble.v);
@ -2742,7 +2812,7 @@ bool DirectX::Internal::StoreScanlineLinear(
assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
switch (format)
switch (static_cast<int>(format))
{
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
@ -2773,6 +2843,7 @@ bool DirectX::Internal::StoreScanlineLinear(
case DXGI_FORMAT_B8G8R8A8_UNORM:
case DXGI_FORMAT_B8G8R8X8_UNORM:
case DXGI_FORMAT_B4G4R4A4_UNORM:
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
break;
default:
@ -2813,7 +2884,7 @@ bool DirectX::Internal::LoadScanlineLinear(
DXGI_FORMAT format,
TEX_FILTER_FLAGS flags) noexcept
{
switch (format)
switch (static_cast<int>(format))
{
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
@ -2844,6 +2915,7 @@ bool DirectX::Internal::LoadScanlineLinear(
case DXGI_FORMAT_B8G8R8A8_UNORM:
case DXGI_FORMAT_B8G8R8X8_UNORM:
case DXGI_FORMAT_B4G4R4A4_UNORM:
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
break;
default:
@ -2969,6 +3041,7 @@ namespace
{ XBOX_DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT, 10, CONVF_FLOAT | CONVF_POS_ONLY | CONVF_R | CONVF_G | CONVF_B | CONVF_A },
{ XBOX_DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM,10, CONVF_SNORM | CONVF_R | CONVF_G | CONVF_B | CONVF_A },
{ XBOX_DXGI_FORMAT_R4G4_UNORM, 4, CONVF_UNORM | CONVF_R | CONVF_G },
{ WIN11_DXGI_FORMAT_A4B4G4R4_UNORM, 4, CONVF_UNORM | CONVF_BGR | CONVF_R | CONVF_G | CONVF_B | CONVF_A },
};
#pragma prefast( suppress : 25004, "Signature must match bsearch" );
@ -3213,8 +3286,8 @@ void DirectX::Internal::ConvertScanline(
{
// !CONVF_DEPTH -> CONVF_DEPTH
// RGB -> Depth (red channel)
switch (flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE))
// RGB -> Depth (red channel or other specified channel)
switch (flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE | TEX_FILTER_RGB_COPY_ALPHA))
{
case TEX_FILTER_RGB_COPY_GREEN:
{
@ -3240,6 +3313,18 @@ void DirectX::Internal::ConvertScanline(
}
break;
case TEX_FILTER_RGB_COPY_ALPHA:
{
XMVECTOR* ptr = pBuffer;
for (size_t i = 0; i < count; ++i)
{
const XMVECTOR v = *ptr;
const XMVECTOR v1 = XMVectorSplatW(v);
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1000);
}
}
break;
default:
if ((in->flags & CONVF_UNORM) && ((in->flags & CONVF_RGB_MASK) == (CONVF_R | CONVF_G | CONVF_B)))
{
@ -3507,6 +3592,7 @@ void DirectX::Internal::ConvertScanline(
if (((out->flags & CONVF_RGBA_MASK) == CONVF_A) && !(in->flags & CONVF_A))
{
// !CONVF_A -> A format
// We ignore TEX_FILTER_RGB_COPY_ALPHA since there's no input alpha channel.
switch (flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE))
{
case TEX_FILTER_RGB_COPY_GREEN:
@ -3602,8 +3688,8 @@ void DirectX::Internal::ConvertScanline(
{
if ((out->flags & CONVF_RGB_MASK) == CONVF_R)
{
// RGB format -> R format
switch (flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE))
// RGB(A) format -> R format
switch (flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE | TEX_FILTER_RGB_COPY_ALPHA))
{
case TEX_FILTER_RGB_COPY_GREEN:
{
@ -3629,6 +3715,18 @@ void DirectX::Internal::ConvertScanline(
}
break;
case TEX_FILTER_RGB_COPY_ALPHA:
{
XMVECTOR* ptr = pBuffer;
for (size_t i = 0; i < count; ++i)
{
const XMVECTOR v = *ptr;
const XMVECTOR v1 = XMVectorSplatW(v);
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1110);
}
}
break;
default:
if (in->flags & CONVF_UNORM)
{
@ -3657,37 +3755,83 @@ void DirectX::Internal::ConvertScanline(
}
else if ((out->flags & CONVF_RGB_MASK) == (CONVF_R | CONVF_G))
{
// RGB format -> RG format
switch (static_cast<int>(flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE)))
if ((flags & TEX_FILTER_RGB_COPY_ALPHA) && (in->flags & CONVF_A))
{
case (static_cast<int>(TEX_FILTER_RGB_COPY_RED) | static_cast<int>(TEX_FILTER_RGB_COPY_BLUE)):
// RGBA -> RG format
switch (static_cast<int>(flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE | TEX_FILTER_RGB_COPY_ALPHA)))
{
XMVECTOR* ptr = pBuffer;
for (size_t i = 0; i < count; ++i)
case (static_cast<int>(TEX_FILTER_RGB_COPY_RED) | static_cast<int>(TEX_FILTER_RGB_COPY_ALPHA)):
default:
{
const XMVECTOR v = *ptr;
const XMVECTOR v1 = XMVectorSwizzle<0, 2, 0, 2>(v);
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
XMVECTOR* ptr = pBuffer;
for (size_t i = 0; i < count; ++i)
{
const XMVECTOR v = *ptr;
const XMVECTOR v1 = XMVectorSwizzle<0, 3, 0, 3>(v);
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
}
}
}
break;
break;
case (static_cast<int>(TEX_FILTER_RGB_COPY_GREEN) | static_cast<int>(TEX_FILTER_RGB_COPY_BLUE)):
case (static_cast<int>(TEX_FILTER_RGB_COPY_GREEN) | static_cast<int>(TEX_FILTER_RGB_COPY_ALPHA)):
{
XMVECTOR* ptr = pBuffer;
for (size_t i = 0; i < count; ++i)
{
const XMVECTOR v = *ptr;
const XMVECTOR v1 = XMVectorSwizzle<1, 3, 1, 3>(v);
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
}
}
break;
case (static_cast<int>(TEX_FILTER_RGB_COPY_BLUE) | static_cast<int>(TEX_FILTER_RGB_COPY_ALPHA)):
{
XMVECTOR* ptr = pBuffer;
for (size_t i = 0; i < count; ++i)
{
const XMVECTOR v = *ptr;
const XMVECTOR v1 = XMVectorSwizzle<2, 3, 2, 3>(v);
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
}
}
break;
}
}
else
{
// RGB format -> RG format
switch (static_cast<int>(flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE)))
{
XMVECTOR* ptr = pBuffer;
for (size_t i = 0; i < count; ++i)
case (static_cast<int>(TEX_FILTER_RGB_COPY_RED) | static_cast<int>(TEX_FILTER_RGB_COPY_BLUE)):
{
const XMVECTOR v = *ptr;
const XMVECTOR v1 = XMVectorSwizzle<1, 2, 3, 0>(v);
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
XMVECTOR* ptr = pBuffer;
for (size_t i = 0; i < count; ++i)
{
const XMVECTOR v = *ptr;
const XMVECTOR v1 = XMVectorSwizzle<0, 2, 0, 2>(v);
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
}
}
}
break;
break;
case (static_cast<int>(TEX_FILTER_RGB_COPY_RED) | static_cast<int>(TEX_FILTER_RGB_COPY_GREEN)):
default:
// Leave data unchanged and the store will handle this...
break;
case (static_cast<int>(TEX_FILTER_RGB_COPY_GREEN) | static_cast<int>(TEX_FILTER_RGB_COPY_BLUE)):
{
XMVECTOR* ptr = pBuffer;
for (size_t i = 0; i < count; ++i)
{
const XMVECTOR v = *ptr;
const XMVECTOR v1 = XMVectorSwizzle<1, 2, 3, 0>(v);
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
}
}
break;
case (static_cast<int>(TEX_FILTER_RGB_COPY_RED) | static_cast<int>(TEX_FILTER_RGB_COPY_GREEN)):
default:
// Leave data unchanged and the store will handle this...
break;
}
}
}
}
@ -4310,6 +4454,56 @@ bool DirectX::Internal::StoreScanlineDither(
case DXGI_FORMAT_B4G4R4A4_UNORM:
STORE_SCANLINE(XMUNIBBLE4, g_Scale4pc, true, true, uint8_t, 0xF, y, true)
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
if (size >= sizeof(XMUNIBBLE4))
{
XMUNIBBLE4 * __restrict dest = static_cast<XMUNIBBLE4*>(pDestination);
for (size_t i = 0; i < count; ++i)
{
auto index = static_cast<ptrdiff_t>((y & 1) ? (count - i - 1) : i);
ptrdiff_t delta = (y & 1) ? -2 : 0;
XMVECTOR v = XMVectorSaturate(sPtr[index]);
v = XMVectorSwizzle<3, 2, 1, 0>(v);
v = XMVectorAdd(v, vError);
v = XMVectorMultiply(v, g_Scale4pc);
XMVECTOR target;
if (pDiffusionErrors)
{
target = XMVectorRound(v);
vError = XMVectorSubtract(v, target);
vError = XMVectorDivide(vError, g_Scale4pc);
// Distribute error to next scanline and next pixel
pDiffusionErrors[index - delta] = XMVectorMultiplyAdd(g_ErrorWeight3, vError, pDiffusionErrors[index - delta]);
pDiffusionErrors[index + 1] = XMVectorMultiplyAdd(g_ErrorWeight5, vError, pDiffusionErrors[index + 1]);
pDiffusionErrors[index + 2 + delta] = XMVectorMultiplyAdd(g_ErrorWeight1, vError, pDiffusionErrors[index + 2 + delta]);
vError = XMVectorMultiply(vError, g_ErrorWeight7);
}
else
{
// Applied ordered dither
target = XMVectorAdd(v, ordered[index & 3]);
target = XMVectorRound(target);
}
target = XMVectorClamp(target, g_XMZero, g_Scale4pc);
XMFLOAT4A tmp;
XMStoreFloat4A(&tmp, target);
auto dPtr = &dest[index];
if (dPtr >= ePtr) break;
dPtr->x = uint8_t(static_cast<uint8_t>(tmp.x) & 0xF);
dPtr->y = uint8_t(static_cast<uint8_t>(tmp.y) & 0xF);
dPtr->z = uint8_t(static_cast<uint8_t>(tmp.z) & 0xF);
dPtr->w = uint8_t(static_cast<uint8_t>(tmp.w) & 0xF);
}
return true;
}
return false;
case XBOX_DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM:
STORE_SCANLINE(XMXDECN4, g_Scale9pc, false, true, uint16_t, 0x3FF, y, false)
@ -4522,7 +4716,7 @@ namespace
filter &= ~(TEX_FILTER_SRGB_IN | TEX_FILTER_SRGB_OUT);
}
auto const wicsrgb = CheckWICColorSpace(pfGUID, targetGUID);
const auto wicsrgb = CheckWICColorSpace(pfGUID, targetGUID);
if (wicsrgb != (filter & (TEX_FILTER_SRGB_IN | TEX_FILTER_SRGB_OUT)))
{
@ -4610,7 +4804,8 @@ namespace
_In_ TEX_FILTER_FLAGS filter,
_In_ const Image& destImage,
_In_ float threshold,
size_t z) noexcept
size_t z,
const std::function<bool __cdecl(size_t, size_t)>& statusCallback) noexcept
{
assert(srcImage.width == destImage.width);
assert(srcImage.height == destImage.height);
@ -4634,6 +4829,14 @@ namespace
for (size_t h = 0; h < srcImage.height; ++h)
{
if (statusCallback)
{
if (!statusCallback(h, srcImage.height))
{
return E_ABORT;
}
}
if (!LoadScanline(scanline.get(), width, pSrc, srcImage.rowPitch, srcImage.format))
return E_FAIL;
@ -4657,6 +4860,14 @@ namespace
// Ordered dithering
for (size_t h = 0; h < srcImage.height; ++h)
{
if (statusCallback)
{
if (!statusCallback(h, srcImage.height))
{
return E_ABORT;
}
}
if (!LoadScanline(scanline.get(), width, pSrc, srcImage.rowPitch, srcImage.format))
return E_FAIL;
@ -4674,6 +4885,14 @@ namespace
// No dithering
for (size_t h = 0; h < srcImage.height; ++h)
{
if (statusCallback)
{
if (!statusCallback(h, srcImage.height))
{
return E_ABORT;
}
}
if (!LoadScanline(scanline.get(), width, pSrc, srcImage.rowPitch, srcImage.format))
return E_FAIL;
@ -4724,7 +4943,7 @@ namespace
{\
const size_t rowPitch = srcImage.rowPitch;\
\
auto const sourceE = reinterpret_cast<const srcType*>(pSrc + srcImage.slicePitch);\
const auto sourceE = reinterpret_cast<const srcType*>(pSrc + srcImage.slicePitch);\
auto pSrcUV = pSrc + (srcImage.height * rowPitch);\
\
for(size_t y = 0; y < srcImage.height; y+= 2)\
@ -4781,21 +5000,33 @@ namespace
{
case DXGI_FORMAT_NV12:
assert(destImage.format == DXGI_FORMAT_YUY2);
if ((srcImage.width % 2) != 0 || (srcImage.height % 2) != 0)
return E_INVALIDARG;
CONVERT_420_TO_422(uint8_t, XMUBYTEN4);
return S_OK;
case DXGI_FORMAT_P010:
assert(destImage.format == DXGI_FORMAT_Y210);
if ((srcImage.width % 2) != 0 || (srcImage.height % 2) != 0)
return E_INVALIDARG;
CONVERT_420_TO_422(uint16_t, XMUSHORTN4);
return S_OK;
case DXGI_FORMAT_P016:
assert(destImage.format == DXGI_FORMAT_Y216);
if ((srcImage.width % 2) != 0 || (srcImage.height % 2) != 0)
return E_INVALIDARG;
CONVERT_420_TO_422(uint16_t, XMUSHORTN4);
return S_OK;
case DXGI_FORMAT_NV11:
assert(destImage.format == DXGI_FORMAT_YUY2);
if ((srcImage.width % 4) != 0)
return E_INVALIDARG;
// Convert 4:1:1 to 4:2:2
{
const size_t rowPitch = srcImage.rowPitch;
@ -4861,6 +5092,21 @@ HRESULT DirectX::Convert(
TEX_FILTER_FLAGS filter,
float threshold,
ScratchImage& image) noexcept
{
ConvertOptions options = {};
options.filter = filter;
options.threshold = threshold;
return ConvertEx(srcImage, format, options, image, nullptr);
}
_Use_decl_annotations_
HRESULT DirectX::ConvertEx(
const Image& srcImage,
DXGI_FORMAT format,
const ConvertOptions& options,
ScratchImage& image,
std::function<bool __cdecl(size_t, size_t)> statusCallback)
{
if ((srcImage.format == format) || !IsValid(format))
return E_INVALIDARG;
@ -4888,14 +5134,23 @@ HRESULT DirectX::Convert(
return E_POINTER;
}
WICPixelFormatGUID pfGUID, targetGUID;
if (UseWICConversion(filter, srcImage.format, format, pfGUID, targetGUID))
if (statusCallback)
{
hr = ConvertUsingWIC(srcImage, pfGUID, targetGUID, filter, threshold, *rimage);
if (!statusCallback(0, rimage->height))
{
image.Release();
return E_ABORT;
}
}
WICPixelFormatGUID pfGUID, targetGUID;
if (UseWICConversion(options.filter, srcImage.format, format, pfGUID, targetGUID))
{
hr = ConvertUsingWIC(srcImage, pfGUID, targetGUID, options.filter, options.threshold, *rimage);
}
else
{
hr = ConvertCustom(srcImage, filter, *rimage, threshold, 0);
hr = ConvertCustom(srcImage, options.filter, *rimage, options.threshold, 0, statusCallback);
}
if (FAILED(hr))
@ -4904,6 +5159,15 @@ HRESULT DirectX::Convert(
return hr;
}
if (statusCallback)
{
if (!statusCallback(rimage->height, rimage->height))
{
image.Release();
return E_ABORT;
}
}
return S_OK;
}
@ -4920,6 +5184,23 @@ HRESULT DirectX::Convert(
TEX_FILTER_FLAGS filter,
float threshold,
ScratchImage& result) noexcept
{
ConvertOptions options = {};
options.filter = filter;
options.threshold = threshold;
return ConvertEx(srcImages, nimages, metadata, format, options, result, nullptr);
}
_Use_decl_annotations_
HRESULT DirectX::ConvertEx(
const Image* srcImages,
size_t nimages,
const TexMetadata& metadata,
DXGI_FORMAT format,
const ConvertOptions& options,
ScratchImage& result,
std::function<bool __cdecl(size_t, size_t)> statusCallback)
{
if (!srcImages || !nimages || (metadata.format == format) || !IsValid(format))
return E_INVALIDARG;
@ -4933,6 +5214,19 @@ HRESULT DirectX::Convert(
if ((metadata.width > UINT32_MAX) || (metadata.height > UINT32_MAX))
return E_INVALIDARG;
if (statusCallback
&& nimages == 1
&& !metadata.IsVolumemap()
&& metadata.mipLevels == 1
&& metadata.arraySize == 1)
{
// If progress reporting is requested when converting a single 1D or 2D image, call
// the ConvertEx overload that takes a single image.
// This provides a better user experience as progress will be reported as the image
// is being processed, instead of after processing has been completed.
return ConvertEx(srcImages[0], format, options, result, statusCallback);
}
TexMetadata mdata2 = metadata;
mdata2.format = format;
HRESULT hr = result.Initialize(mdata2);
@ -4952,8 +5246,17 @@ HRESULT DirectX::Convert(
return E_POINTER;
}
if (statusCallback)
{
if (!statusCallback(0, nimages))
{
result.Release();
return E_ABORT;
}
}
WICPixelFormatGUID pfGUID, targetGUID;
const bool usewic = !metadata.IsPMAlpha() && UseWICConversion(filter, metadata.format, format, pfGUID, targetGUID);
const bool usewic = !metadata.IsPMAlpha() && UseWICConversion(options.filter, metadata.format, format, pfGUID, targetGUID);
switch (metadata.dimension)
{
@ -4985,11 +5288,11 @@ HRESULT DirectX::Convert(
if (usewic)
{
hr = ConvertUsingWIC(src, pfGUID, targetGUID, filter, threshold, dst);
hr = ConvertUsingWIC(src, pfGUID, targetGUID, options.filter, options.threshold, dst);
}
else
{
hr = ConvertCustom(src, filter, dst, threshold, 0);
hr = ConvertCustom(src, options.filter, dst, options.threshold, 0, nullptr);
}
if (FAILED(hr))
@ -4997,6 +5300,15 @@ HRESULT DirectX::Convert(
result.Release();
return hr;
}
if (statusCallback)
{
if (!statusCallback(index, nimages))
{
result.Release();
return E_ABORT;
}
}
}
break;
@ -5038,11 +5350,11 @@ HRESULT DirectX::Convert(
if (usewic)
{
hr = ConvertUsingWIC(src, pfGUID, targetGUID, filter, threshold, dst);
hr = ConvertUsingWIC(src, pfGUID, targetGUID, options.filter, options.threshold, dst);
}
else
{
hr = ConvertCustom(src, filter, dst, threshold, slice);
hr = ConvertCustom(src, options.filter, dst, options.threshold, slice, nullptr);
}
if (FAILED(hr))
@ -5050,6 +5362,15 @@ HRESULT DirectX::Convert(
result.Release();
return hr;
}
if (statusCallback)
{
if (!statusCallback(index, nimages))
{
result.Release();
return E_ABORT;
}
}
}
if (d > 1)
@ -5063,6 +5384,15 @@ HRESULT DirectX::Convert(
return E_FAIL;
}
if (statusCallback)
{
if (!statusCallback(nimages, nimages))
{
result.Release();
return E_ABORT;
}
}
return S_OK;
}

View File

@ -219,7 +219,10 @@ bool DirectX::IsSupportedTexture(
if (!IsValid(fmt))
return false;
switch (fmt)
const size_t iWidth = metadata.width;
const size_t iHeight = metadata.height;
switch (static_cast<int>(fmt))
{
case DXGI_FORMAT_BC4_TYPELESS:
case DXGI_FORMAT_BC4_UNORM:
@ -241,6 +244,49 @@ bool DirectX::IsSupportedTexture(
return false;
break;
case DXGI_FORMAT_NV12:
case DXGI_FORMAT_P010:
case DXGI_FORMAT_P016:
case DXGI_FORMAT_420_OPAQUE:
if ((metadata.dimension != TEX_DIMENSION_TEXTURE2D)
|| (iWidth % 2) != 0 || (iHeight % 2) != 0)
{
return false;
}
break;
case DXGI_FORMAT_YUY2:
case DXGI_FORMAT_Y210:
case DXGI_FORMAT_Y216:
case WIN10_DXGI_FORMAT_P208:
if ((iWidth % 2) != 0)
{
return false;
}
break;
case DXGI_FORMAT_NV11:
if ((iWidth % 4) != 0)
{
return false;
}
break;
case DXGI_FORMAT_AI44:
case DXGI_FORMAT_IA44:
case DXGI_FORMAT_P8:
case DXGI_FORMAT_A8P8:
// Legacy video stream formats are not supported by Direct3D.
return false;
case WIN10_DXGI_FORMAT_V208:
if ((metadata.dimension != TEX_DIMENSION_TEXTURE2D)
|| (iHeight % 2) != 0)
{
return false;
}
break;
default:
break;
}
@ -251,8 +297,6 @@ bool DirectX::IsSupportedTexture(
// Validate array size, dimension, and width/height
const size_t arraySize = metadata.arraySize;
const size_t iWidth = metadata.width;
const size_t iHeight = metadata.height;
const size_t iDepth = metadata.depth;
// Most cases are known apriori based on feature level, but we use this for robustness to handle the few optional cases
@ -609,6 +653,9 @@ HRESULT DirectX::CreateTextureEx(
hr = pDevice->CreateTexture3D(&desc, initData.get(), reinterpret_cast<ID3D11Texture3D**>(ppResource));
}
break;
default:
return HRESULT_E_NOT_SUPPORTED;
}
return hr;

View File

@ -88,6 +88,9 @@ namespace
res.SlicePitch = res.RowPitch * static_cast<PT>(height);
}
break;
default:
break;
}
}
@ -121,14 +124,19 @@ namespace
_In_ ID3D12CommandQueue* pCommandQ,
_In_ ID3D12Resource* pSource,
const D3D12_RESOURCE_DESC& desc,
ComPtr<ID3D12Resource>& pStaging,
_COM_Outptr_ ID3D12Resource** pStaging,
std::unique_ptr<uint8_t[]>& layoutBuff,
UINT& numberOfPlanes,
UINT& numberOfResources,
D3D12_RESOURCE_STATES beforeState,
D3D12_RESOURCE_STATES afterState) noexcept
{
if (!pCommandQ || !pSource)
if (pStaging)
{
*pStaging = nullptr;
}
if (!pCommandQ || !pSource || !pStaging)
return E_INVALIDARG;
numberOfPlanes = D3D12GetFormatPlaneCount(device, desc.Format);
@ -170,7 +178,8 @@ namespace
if (SUCCEEDED(hr) && sourceHeapProperties.Type == D3D12_HEAP_TYPE_READBACK)
{
// Handle case where the source is already a staging texture we can use directly
pStaging = pSource;
*pStaging = pSource;
pSource->AddRef();
return S_OK;
}
@ -208,8 +217,11 @@ namespace
bufferDesc.SampleDesc.Count = 1;
ComPtr<ID3D12Resource> copySource(pSource);
D3D12_RESOURCE_STATES beforeStateSource = beforeState;
if (desc.SampleDesc.Count > 1)
{
TransitionResource(commandList.Get(), pSource, beforeState, D3D12_RESOURCE_STATE_RESOLVE_SOURCE);
// MSAA content must be resolved before being copied to a staging texture
auto descCopy = desc;
descCopy.SampleDesc.Count = 1;
@ -221,7 +233,7 @@ namespace
&defaultHeapProperties,
D3D12_HEAP_FLAG_NONE,
&descCopy,
D3D12_RESOURCE_STATE_COPY_DEST,
D3D12_RESOURCE_STATE_RESOLVE_DEST,
nullptr,
IID_GRAPHICS_PPV_ARGS(pTemp.GetAddressOf()));
if (FAILED(hr))
@ -258,6 +270,11 @@ namespace
}
copySource = pTemp;
beforeState = D3D12_RESOURCE_STATE_RESOLVE_DEST;
}
else
{
beforeStateSource = D3D12_RESOURCE_STATE_COPY_SOURCE;
}
// Create a staging texture
@ -267,25 +284,25 @@ namespace
&bufferDesc,
D3D12_RESOURCE_STATE_COPY_DEST,
nullptr,
IID_GRAPHICS_PPV_ARGS(pStaging.GetAddressOf()));
IID_GRAPHICS_PPV_ARGS(pStaging));
if (FAILED(hr))
return hr;
assert(pStaging);
assert(*pStaging);
// Transition the resource if necessary
TransitionResource(commandList.Get(), pSource, beforeState, D3D12_RESOURCE_STATE_COPY_SOURCE);
TransitionResource(commandList.Get(), copySource.Get(), beforeState, D3D12_RESOURCE_STATE_COPY_SOURCE);
// Get the copy target location
for (UINT j = 0; j < numberOfResources; ++j)
{
const CD3DX12_TEXTURE_COPY_LOCATION copyDest(pStaging.Get(), pLayout[j]);
const CD3DX12_TEXTURE_COPY_LOCATION copyDest(*pStaging, pLayout[j]);
const CD3DX12_TEXTURE_COPY_LOCATION copySrc(copySource.Get(), j);
commandList->CopyTextureRegion(&copyDest, 0, 0, 0, &copySrc, nullptr);
}
// Transition the resource to the next state
TransitionResource(commandList.Get(), pSource, D3D12_RESOURCE_STATE_COPY_SOURCE, afterState);
// Transition the source resource to the next state
TransitionResource(commandList.Get(), pSource, beforeStateSource, afterState);
hr = commandList->Close();
if (FAILED(hr))
@ -335,14 +352,64 @@ bool DirectX::IsSupportedTexture(
if (!IsValid(fmt))
return false;
const size_t iWidth = metadata.width;
const size_t iHeight = metadata.height;
switch (static_cast<int>(fmt))
{
case DXGI_FORMAT_NV12:
case DXGI_FORMAT_P010:
case DXGI_FORMAT_P016:
case DXGI_FORMAT_420_OPAQUE:
if ((metadata.dimension != TEX_DIMENSION_TEXTURE2D)
|| (iWidth % 2) != 0 || (iHeight % 2) != 0)
{
return false;
}
break;
case DXGI_FORMAT_YUY2:
case DXGI_FORMAT_Y210:
case DXGI_FORMAT_Y216:
case WIN10_DXGI_FORMAT_P208:
if ((iWidth % 2) != 0)
{
return false;
}
break;
case DXGI_FORMAT_NV11:
if ((iWidth % 4) != 0)
{
return false;
}
break;
case DXGI_FORMAT_AI44:
case DXGI_FORMAT_IA44:
case DXGI_FORMAT_P8:
case DXGI_FORMAT_A8P8:
// Legacy video stream formats are not supported by Direct3D.
return false;
case WIN10_DXGI_FORMAT_V208:
if ((metadata.dimension != TEX_DIMENSION_TEXTURE2D)
|| (iHeight % 2) != 0)
{
return false;
}
break;
default:
break;
}
// Validate miplevel count
if (metadata.mipLevels > D3D12_REQ_MIP_LEVELS)
return false;
// Validate array size, dimension, and width/height
const size_t arraySize = metadata.arraySize;
const size_t iWidth = metadata.width;
const size_t iHeight = metadata.height;
const size_t iDepth = metadata.depth;
// Most cases are known apriori based on feature level, but we use this for robustness to handle the few optional cases
@ -492,7 +559,11 @@ HRESULT DirectX::CreateTextureEx(
&defaultHeapProperties,
D3D12_HEAP_FLAG_NONE,
&desc,
#if (defined(_XBOX_ONE) && defined(_TITLE)) || defined(_GAMING_XBOX)
D3D12_RESOURCE_STATE_COPY_DEST,
#else
D3D12_RESOURCE_STATE_COMMON,
#endif
nullptr,
IID_GRAPHICS_PPV_ARGS(ppResource));
@ -667,10 +738,10 @@ HRESULT DirectX::CaptureTexture(
pCommandQueue->GetDevice(IID_GRAPHICS_PPV_ARGS(device.GetAddressOf()));
#if defined(_MSC_VER) || !defined(_WIN32)
auto const desc = pSource->GetDesc();
const auto desc = pSource->GetDesc();
#else
D3D12_RESOURCE_DESC tmpDesc;
auto const& desc = *pSource->GetDesc(&tmpDesc);
const auto& desc = *pSource->GetDesc(&tmpDesc);
#endif
ComPtr<ID3D12Resource> pStaging;
@ -680,7 +751,7 @@ HRESULT DirectX::CaptureTexture(
pCommandQueue,
pSource,
desc,
pStaging,
pStaging.GetAddressOf(),
layoutBuff,
numberOfPlanes,
numberOfResources,
@ -758,7 +829,7 @@ HRESULT DirectX::CaptureTexture(
return E_FAIL;
}
BYTE* pData;
BYTE* pData = nullptr;
hr = pStaging->Map(0, nullptr, reinterpret_cast<void**>(&pData));
if (FAILED(hr))
{

File diff suppressed because it is too large Load Diff

View File

@ -94,7 +94,7 @@ namespace
// Decodes HDR header
//-------------------------------------------------------------------------------------
HRESULT DecodeHDRHeader(
_In_reads_bytes_(size) const void* pSource,
_In_reads_bytes_(size) const uint8_t* pSource,
size_t size,
_Out_ TexMetadata& metadata,
size_t& offset,
@ -121,7 +121,7 @@ namespace
// Process first part of header
bool formatFound = false;
auto info = static_cast<const char*>(pSource);
auto info = reinterpret_cast<const char*>(pSource);
while (size > 0)
{
if (*info == '\n')
@ -163,7 +163,8 @@ namespace
formatFound = true;
const size_t len = FindEOL(info, size);
if (len == size_t(-1))
if (len == size_t(-1)
|| len < 1)
{
return E_FAIL;
}
@ -207,7 +208,8 @@ namespace
else
{
const size_t len = FindEOL(info, size);
if (len == size_t(-1))
if (len == size_t(-1)
|| len < 1)
{
return E_FAIL;
}
@ -247,6 +249,11 @@ namespace
return E_FAIL;
}
if (height > UINT16_MAX)
{
return HRESULT_E_NOT_SUPPORTED;
}
const char* ptr = orientation + 2;
while (*ptr != 0 && *ptr != '-' && *ptr != '+')
++ptr;
@ -279,6 +286,11 @@ namespace
return E_FAIL;
}
if (width > UINT16_MAX)
{
return HRESULT_E_NOT_SUPPORTED;
}
info += len + 1;
size -= len + 1;
@ -287,12 +299,18 @@ namespace
return HRESULT_E_INVALID_DATA;
}
uint64_t sizeBytes = uint64_t(width) * uint64_t(height) * sizeof(float) * 4;
if (sizeBytes > UINT32_MAX)
{
return HRESULT_E_ARITHMETIC_OVERFLOW;
}
if (size == 0)
{
return E_FAIL;
}
offset = size_t(info - static_cast<const char*>(pSource));
offset = size_t(info - reinterpret_cast<const char*>(pSource));
metadata.width = width;
metadata.height = height;
@ -582,7 +600,7 @@ namespace
// Obtain metadata from HDR file in memory/on disk
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT DirectX::GetMetadataFromHDRMemory(const void* pSource, size_t size, TexMetadata& metadata) noexcept
HRESULT DirectX::GetMetadataFromHDRMemory(const uint8_t* pSource, size_t size, TexMetadata& metadata) noexcept
{
if (!pSource || size == 0)
return E_INVALIDARG;
@ -599,12 +617,10 @@ HRESULT DirectX::GetMetadataFromHDRFile(const wchar_t* szFile, TexMetadata& meta
return E_INVALIDARG;
#ifdef _WIN32
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
#else
ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
#endif
ScopedHandle hFile(safe_handle(CreateFile2(
szFile,
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@ -659,9 +675,9 @@ HRESULT DirectX::GetMetadataFromHDRFile(const wchar_t* szFile, TexMetadata& meta
return HRESULT_FROM_WIN32(GetLastError());
}
auto const headerLen = static_cast<size_t>(bytesRead);
const auto headerLen = static_cast<size_t>(bytesRead);
#else
auto const headerLen = std::min<size_t>(sizeof(header), len);
const auto headerLen = std::min<size_t>(sizeof(header), len);
inFile.read(reinterpret_cast<char*>(header), headerLen);
if (!inFile)
@ -678,7 +694,7 @@ HRESULT DirectX::GetMetadataFromHDRFile(const wchar_t* szFile, TexMetadata& meta
// Load a HDR file in memory
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT DirectX::LoadFromHDRMemory(const void* pSource, size_t size, TexMetadata* metadata, ScratchImage& image) noexcept
HRESULT DirectX::LoadFromHDRMemory(const uint8_t* pSource, size_t size, TexMetadata* metadata, ScratchImage& image) noexcept
{
if (!pSource || size == 0)
return E_INVALIDARG;
@ -699,7 +715,7 @@ HRESULT DirectX::LoadFromHDRMemory(const void* pSource, size_t size, TexMetadata
if (remaining == 0)
return E_FAIL;
hr = image.Initialize2D(mdata.format, mdata.width, mdata.height, 1, 1);
hr = image.Initialize2D(mdata.format, mdata.width, mdata.height, 1, 1, CP_FLAGS_LIMIT_4GB);
if (FAILED(hr))
return hr;
@ -874,7 +890,7 @@ HRESULT DirectX::LoadFromHDRMemory(const void* pSource, size_t size, TexMetadata
for (size_t j = 0; j < image.GetPixelsSize(); j += 16)
{
auto const exponent = static_cast<int>(fdata[3]);
const auto exponent = static_cast<int>(fdata[3]);
fdata[0] = 1.0f / exposure*ldexpf((fdata[0] + 0.5f), exponent - (128 + 8));
fdata[1] = 1.0f / exposure*ldexpf((fdata[1] + 0.5f), exponent - (128 + 8));
fdata[2] = 1.0f / exposure*ldexpf((fdata[2] + 0.5f), exponent - (128 + 8));
@ -903,12 +919,10 @@ HRESULT DirectX::LoadFromHDRFile(const wchar_t* szFile, TexMetadata* metadata, S
image.Release();
#ifdef _WIN32
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
#else
ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
FILE_FLAG_SEQUENTIAL_SCAN, nullptr)));
#endif
ScopedHandle hFile(safe_handle(CreateFile2(
szFile,
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
nullptr)));
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@ -1027,7 +1041,7 @@ HRESULT DirectX::SaveToHDRMemory(const Image& image, Blob& blob) noexcept
return hr;
// Copy header
auto dPtr = static_cast<uint8_t*>(blob.GetBufferPointer());
auto dPtr = blob.GetBufferPointer();
assert(dPtr != nullptr);
memcpy(dPtr, header, headerLen);
dPtr += headerLen;
@ -1079,7 +1093,7 @@ HRESULT DirectX::SaveToHDRMemory(const Image& image, Blob& blob) noexcept
}
#endif
hr = blob.Trim(size_t(dPtr - static_cast<uint8_t*>(blob.GetBufferPointer())));
hr = blob.Trim(size_t(dPtr - blob.GetConstBufferPointer()));
if (FAILED(hr))
{
blob.Release();
@ -1126,13 +1140,9 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
// Create file and write header
#ifdef _WIN32
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(szFile,
ScopedHandle hFile(safe_handle(CreateFile2(
szFile,
GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
#else
ScopedHandle hFile(safe_handle(CreateFileW(szFile,
GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
@ -1164,9 +1174,9 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
// Write blob
#ifdef _WIN32
auto const bytesToWrite = static_cast<const DWORD>(blob.GetBufferSize());
const auto bytesToWrite = static_cast<const DWORD>(blob.GetBufferSize());
DWORD bytesWritten;
if (!WriteFile(hFile.get(), blob.GetBufferPointer(), bytesToWrite, &bytesWritten, nullptr))
if (!WriteFile(hFile.get(), blob.GetConstBufferPointer(), bytesToWrite, &bytesWritten, nullptr))
{
return HRESULT_FROM_WIN32(GetLastError());
}
@ -1176,7 +1186,7 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
return E_FAIL;
}
#else
outFile.write(reinterpret_cast<char*>(blob.GetBufferPointer()),
outFile.write(reinterpret_cast<const char*>(blob.GetConstBufferPointer()),
static_cast<std::streamsize>(blob.GetBufferSize()));
if (!outFile)
@ -1197,7 +1207,7 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
sprintf_s(header, g_Header, image.height, image.width);
#ifdef _WIN32
auto const headerLen = static_cast<DWORD>(strlen(header));
const auto headerLen = static_cast<DWORD>(strlen(header));
DWORD bytesWritten;
if (!WriteFile(hFile.get(), header, headerLen, &bytesWritten, nullptr))
@ -1298,3 +1308,36 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
return S_OK;
}
//--------------------------------------------------------------------------------------
// Adapters for /Zc:wchar_t- clients
#if defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED)
namespace DirectX
{
HRESULT __cdecl GetMetadataFromHDRFile(
_In_z_ const __wchar_t* szFile,
_Out_ TexMetadata& metadata) noexcept
{
return GetMetadataFromHDRFile(reinterpret_cast<const unsigned short*>(szFile), metadata);
}
HRESULT __cdecl LoadFromHDRFile(
_In_z_ const __wchar_t* szFile,
_Out_opt_ TexMetadata* metadata,
_Out_ ScratchImage& image) noexcept
{
return LoadFromHDRFile(reinterpret_cast<const unsigned short*>(szFile), metadata, image);
}
HRESULT __cdecl SaveToHDRFile(
_In_ const Image& image,
_In_z_ const __wchar_t* szFile) noexcept
{
return SaveToHDRFile(image, reinterpret_cast<const unsigned short*>(szFile));
}
}
#endif // !_NATIVE_WCHAR_T_DEFINED

View File

@ -31,7 +31,7 @@ namespace
// Determines number of image array entries and pixel size
//-------------------------------------------------------------------------------------
_Use_decl_annotations_
bool DirectX::Internal::DetermineImageArray(
HRESULT DirectX::Internal::DetermineImageArray(
const TexMetadata& metadata,
CP_FLAGS cpFlags,
size_t& nImages,
@ -56,10 +56,11 @@ bool DirectX::Internal::DetermineImageArray(
for (size_t level = 0; level < metadata.mipLevels; ++level)
{
size_t rowPitch, slicePitch;
if (FAILED(ComputePitch(metadata.format, w, h, rowPitch, slicePitch, cpFlags)))
HRESULT hr = ComputePitch(metadata.format, w, h, rowPitch, slicePitch, cpFlags);
if (FAILED(hr))
{
nImages = pixelSize = 0;
return false;
return hr;
}
totalPixelSize += uint64_t(slicePitch);
@ -83,10 +84,11 @@ bool DirectX::Internal::DetermineImageArray(
for (size_t level = 0; level < metadata.mipLevels; ++level)
{
size_t rowPitch, slicePitch;
if (FAILED(ComputePitch(metadata.format, w, h, rowPitch, slicePitch, cpFlags)))
HRESULT hr = ComputePitch(metadata.format, w, h, rowPitch, slicePitch, cpFlags);
if (FAILED(hr))
{
nImages = pixelSize = 0;
return false;
return hr;
}
for (size_t slice = 0; slice < d; ++slice)
@ -109,7 +111,7 @@ bool DirectX::Internal::DetermineImageArray(
default:
nImages = pixelSize = 0;
return false;
return E_INVALIDARG;
}
#if defined(_M_IX86) || defined(_M_ARM) || defined(_M_HYBRID_X86_ARM64)
@ -117,16 +119,22 @@ bool DirectX::Internal::DetermineImageArray(
if (totalPixelSize > UINT32_MAX)
{
nImages = pixelSize = 0;
return false;
return HRESULT_E_ARITHMETIC_OVERFLOW;
}
#else
static_assert(sizeof(size_t) == 8, "Not a 64-bit platform!");
if ((cpFlags & CP_FLAGS_LIMIT_4GB) && (totalPixelSize > UINT32_MAX))
{
nImages = pixelSize = 0;
return HRESULT_E_ARITHMETIC_OVERFLOW;
}
#endif
nImages = nimages;
pixelSize = static_cast<size_t>(totalPixelSize);
return true;
return S_OK;
}
@ -348,8 +356,9 @@ HRESULT ScratchImage::Initialize(const TexMetadata& mdata, CP_FLAGS flags) noexc
m_metadata.dimension = mdata.dimension;
size_t pixelSize, nimages;
if (!DetermineImageArray(m_metadata, flags, nimages, pixelSize))
return HRESULT_E_ARITHMETIC_OVERFLOW;
HRESULT hr = DetermineImageArray(m_metadata, flags, nimages, pixelSize);
if (FAILED(hr))
return hr;
m_image = new (std::nothrow) Image[nimages];
if (!m_image)
@ -364,7 +373,9 @@ HRESULT ScratchImage::Initialize(const TexMetadata& mdata, CP_FLAGS flags) noexc
Release();
return E_OUTOFMEMORY;
}
memset(m_memory, 0, pixelSize);
m_size = pixelSize;
if (!SetupImageArray(m_memory, pixelSize, m_metadata, flags, m_image, nimages))
{
Release();
@ -415,8 +426,9 @@ HRESULT ScratchImage::Initialize2D(DXGI_FORMAT fmt, size_t width, size_t height,
m_metadata.dimension = TEX_DIMENSION_TEXTURE2D;
size_t pixelSize, nimages;
if (!DetermineImageArray(m_metadata, flags, nimages, pixelSize))
return HRESULT_E_ARITHMETIC_OVERFLOW;
HRESULT hr = DetermineImageArray(m_metadata, flags, nimages, pixelSize);
if (FAILED(hr))
return hr;
m_image = new (std::nothrow) Image[nimages];
if (!m_image)
@ -431,7 +443,9 @@ HRESULT ScratchImage::Initialize2D(DXGI_FORMAT fmt, size_t width, size_t height,
Release();
return E_OUTOFMEMORY;
}
memset(m_memory, 0, pixelSize);
m_size = pixelSize;
if (!SetupImageArray(m_memory, pixelSize, m_metadata, flags, m_image, nimages))
{
Release();
@ -447,6 +461,9 @@ HRESULT ScratchImage::Initialize3D(DXGI_FORMAT fmt, size_t width, size_t height,
if (!IsValid(fmt) || !width || !height || !depth)
return E_INVALIDARG;
if (depth > INT16_MAX)
return E_INVALIDARG;
if (IsPalettized(fmt))
return HRESULT_E_NOT_SUPPORTED;
@ -466,8 +483,9 @@ HRESULT ScratchImage::Initialize3D(DXGI_FORMAT fmt, size_t width, size_t height,
m_metadata.dimension = TEX_DIMENSION_TEXTURE3D;
size_t pixelSize, nimages;
if (!DetermineImageArray(m_metadata, flags, nimages, pixelSize))
return HRESULT_E_ARITHMETIC_OVERFLOW;
HRESULT hr = DetermineImageArray(m_metadata, flags, nimages, pixelSize);
if (FAILED(hr))
return hr;
m_image = new (std::nothrow) Image[nimages];
if (!m_image)
@ -484,6 +502,7 @@ HRESULT ScratchImage::Initialize3D(DXGI_FORMAT fmt, size_t width, size_t height,
Release();
return E_OUTOFMEMORY;
}
memset(m_memory, 0, pixelSize);
m_size = pixelSize;
if (!SetupImageArray(m_memory, pixelSize, m_metadata, flags, m_image, nimages))
@ -633,6 +652,9 @@ HRESULT ScratchImage::Initialize3DFromImages(const Image* images, size_t depth,
if (!images || !depth)
return E_INVALIDARG;
if (depth > INT16_MAX)
return E_INVALIDARG;
const DXGI_FORMAT format = images[0].format;
const size_t width = images[0].width;
const size_t height = images[0].height;

View File

@ -71,13 +71,16 @@ namespace
_In_ IWICBitmap* src,
_In_ TEX_FILTER_FLAGS filter,
_In_ const WICPixelFormatGUID& desiredPixelFormat,
_Deref_out_ IWICBitmap** dest) noexcept
__RPC__deref_out_opt /* needed to match WIC annotation */ IWICBitmap** dest) noexcept
{
if (!pWIC || !src || !dest)
if (!dest)
return E_POINTER;
*dest = nullptr;
if (!pWIC || !src)
return E_POINTER;
WICPixelFormatGUID actualPixelFormat;
HRESULT hr = src->GetPixelFormat(&actualPixelFormat);
@ -454,16 +457,12 @@ HRESULT DirectX::Internal::ResizeSeparateColorAndAlpha(
}
else
{
#if(_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
if (iswic2)
{
colorBytesInPixel = colorBytesPerPixel = 12;
colorPixelFormat = GUID_WICPixelFormat96bppRGBFloat;
}
else
#else
UNREFERENCED_PARAMETER(iswic2);
#endif
{
colorBytesInPixel = 12;
colorBytesPerPixel = 16;
@ -1147,7 +1146,7 @@ namespace
for (size_t y = 0; y < nheight; ++y)
{
auto const& toY = lfY[y];
const auto& toY = lfY[y];
if (toY.u0 != u0)
{
@ -1177,7 +1176,7 @@ namespace
for (size_t x = 0; x < nwidth; ++x)
{
auto const& toX = lfX[x];
const auto& toX = lfX[x];
BILINEAR_INTERPOLATE(target[x], toX, toY, row0, row1)
}
@ -1270,7 +1269,7 @@ namespace
for (size_t y = 0; y < nheight; ++y)
{
auto const& toY = cfY[y];
const auto& toY = cfY[y];
// Scanline 1
if (toY.u0 != u0)
@ -1361,7 +1360,7 @@ namespace
for (size_t x = 0; x < nwidth; ++x)
{
auto const& toX = cfX[x];
const auto& toX = cfX[x];
XMVECTOR C0, C1, C2, C3;
@ -1615,6 +1614,9 @@ namespace
if (!baseImages || !depth)
return E_INVALIDARG;
if (depth > INT16_MAX)
return E_INVALIDARG;
assert(levels > 1);
const size_t width = baseImages[0].width;
@ -1666,6 +1668,9 @@ namespace
if (!depth || !mipChain.GetImages())
return E_INVALIDARG;
if (depth > INT16_MAX)
return E_INVALIDARG;
// This assumes that the base images are already placed into the mipChain at the top level... (see _Setup3DMips)
assert(levels > 1);
@ -1814,6 +1819,9 @@ namespace
if (!depth || !mipChain.GetImages())
return E_INVALIDARG;
if (depth > INT16_MAX)
return E_INVALIDARG;
// This assumes that the base images are already placed into the mipChain at the top level... (see _Setup3DMips)
assert(levels > 1);
@ -1988,6 +1996,9 @@ namespace
if (!depth || !mipChain.GetImages())
return E_INVALIDARG;
if (depth > INT16_MAX)
return E_INVALIDARG;
// This assumes that the base images are already placed into the mipChain at the top level... (see _Setup3DMips)
assert(levels > 1);
@ -2039,7 +2050,7 @@ namespace
for (size_t slice = 0; slice < ndepth; ++slice)
{
auto const& toZ = lfZ[slice];
const auto& toZ = lfZ[slice];
const Image* srca = mipChain.GetImage(level - 1, 0, toZ.u0);
const Image* srcb = mipChain.GetImage(level - 1, 0, toZ.u1);
@ -2057,7 +2068,7 @@ namespace
for (size_t y = 0; y < nheight; ++y)
{
auto const& toY = lfY[y];
const auto& toY = lfY[y];
if (toY.u0 != u0)
{
@ -2090,7 +2101,7 @@ namespace
for (size_t x = 0; x < nwidth; ++x)
{
auto const& toX = lfX[x];
const auto& toX = lfX[x];
TRILINEAR_INTERPOLATE(target[x], toX, toY, toZ, urow0, urow1, vrow0, vrow1)
}
@ -2120,7 +2131,7 @@ namespace
for (size_t y = 0; y < nheight; ++y)
{
auto const& toY = lfY[y];
const auto& toY = lfY[y];
if (toY.u0 != u0)
{
@ -2150,7 +2161,7 @@ namespace
for (size_t x = 0; x < nwidth; ++x)
{
auto const& toX = lfX[x];
const auto& toX = lfX[x];
BILINEAR_INTERPOLATE(target[x], toX, toY, urow0, urow1)
}
@ -2183,6 +2194,9 @@ namespace
if (!depth || !mipChain.GetImages())
return E_INVALIDARG;
if (depth > INT16_MAX)
return E_INVALIDARG;
// This assumes that the base images are already placed into the mipChain at the top level... (see _Setup3DMips)
assert(levels > 1);
@ -2246,7 +2260,7 @@ namespace
for (size_t slice = 0; slice < ndepth; ++slice)
{
auto const& toZ = cfZ[slice];
const auto& toZ = cfZ[slice];
const Image* srca = mipChain.GetImage(level - 1, 0, toZ.u0);
const Image* srcb = mipChain.GetImage(level - 1, 0, toZ.u1);
@ -2268,7 +2282,7 @@ namespace
for (size_t y = 0; y < nheight; ++y)
{
auto const& toY = cfY[y];
const auto& toY = cfY[y];
// Scanline 1
if (toY.u0 != u0)
@ -2389,7 +2403,7 @@ namespace
for (size_t x = 0; x < nwidth; ++x)
{
auto const& toX = cfX[x];
const auto& toX = cfX[x];
XMVECTOR D[4];
@ -2434,7 +2448,7 @@ namespace
for (size_t y = 0; y < nheight; ++y)
{
auto const& toY = cfY[y];
const auto& toY = cfY[y];
// Scanline 1
if (toY.u0 != u0)
@ -2525,7 +2539,7 @@ namespace
for (size_t x = 0; x < nwidth; ++x)
{
auto const& toX = cfX[x];
const auto& toX = cfX[x];
XMVECTOR C0, C1, C2, C3;
CUBIC_INTERPOLATE(C0, toX.x, urow[0][toX.u0], urow[0][toX.u1], urow[0][toX.u2], urow[0][toX.u3]);
@ -2564,6 +2578,9 @@ namespace
if (!depth || !mipChain.GetImages())
return E_INVALIDARG;
if (depth > INT16_MAX)
return E_INVALIDARG;
// This assumes that the base images are already placed into the mipChain at the top level... (see _Setup3DMips)
assert(levels > 1);
@ -2934,7 +2951,7 @@ HRESULT DirectX::GenerateMipMaps(
mdata.mipLevels = levels;
mdata.format = baseImage.format;
unsigned long filter_select = (filter & TEX_FILTER_MODE_MASK);
uint32_t filter_select = (filter & TEX_FILTER_MODE_MASK);
if (!filter_select)
{
// Default filter choice
@ -3149,7 +3166,7 @@ HRESULT DirectX::GenerateMipMaps(
TexMetadata mdata2 = metadata;
mdata2.mipLevels = levels;
unsigned long filter_select = (filter & TEX_FILTER_MODE_MASK);
uint32_t filter_select = (filter & TEX_FILTER_MODE_MASK);
if (!filter_select)
{
// Default filter choice
@ -3244,6 +3261,9 @@ HRESULT DirectX::GenerateMipMaps3D(
if (!baseImages || !depth)
return E_INVALIDARG;
if (depth > INT16_MAX)
return E_INVALIDARG;
if (filter & TEX_FILTER_FORCE_WIC)
return HRESULT_E_NOT_SUPPORTED;
@ -3276,7 +3296,7 @@ HRESULT DirectX::GenerateMipMaps3D(
HRESULT hr = E_UNEXPECTED;
unsigned long filter_select = (filter & TEX_FILTER_MODE_MASK);
uint32_t filter_select = (filter & TEX_FILTER_MODE_MASK);
if (!filter_select)
{
// Default filter choice
@ -3352,6 +3372,9 @@ HRESULT DirectX::GenerateMipMaps3D(
if (!srcImages || !nimages || !IsValid(metadata.format))
return E_INVALIDARG;
if (levels > INT16_MAX)
return E_INVALIDARG;
if (filter & TEX_FILTER_FORCE_WIC)
return HRESULT_E_NOT_SUPPORTED;
@ -3392,7 +3415,7 @@ HRESULT DirectX::GenerateMipMaps3D(
static_assert(TEX_FILTER_POINT == 0x100000, "TEX_FILTER_ flag values don't match TEX_FILTER_MODE_MASK");
unsigned long filter_select = (filter & TEX_FILTER_MODE_MASK);
uint32_t filter_select = (filter & TEX_FILTER_MODE_MASK);
if (!filter_select)
{
// Default filter choice

View File

@ -11,6 +11,7 @@
#pragma once
#ifdef _MSC_VER
// Off by default warnings
#pragma warning(disable : 4619 4616 4061 4265 4365 4571 4623 4625 4626 4628 4668 4710 4711 4746 4774 4820 4987 5026 5027 5031 5032 5039 5045 5219 5246 5264 26812)
// C4619/4616 #pragma warning warnings
@ -39,16 +40,24 @@
// C5264 'const' variable is not used
// 26812: The enum type 'x' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
// Windows 8.1 SDK related Off by default warnings
#pragma warning(disable : 4471 4917 4986 5029)
#if defined(_XBOX_ONE) && defined(_TITLE)
// Xbox One XDK related Off by default warnings
#pragma warning(disable : 4471 4643 4917 4986 5029 5038 5040 5043 5204 5246 5256 5262 5267)
// C4471 forward declaration of an unscoped enumeration must have an underlying type
// C4643 Forward declaring in namespace std is not permitted by the C++ Standard
// C4917 a GUID can only be associated with a class, interface or namespace
// C4986 exception specification does not match previous declaration
// C5029 nonstandard extension used
// Xbox One XDK related Off by default warnings
#pragma warning(disable : 4643)
// C4643 Forward declaring in namespace std is not permitted by the C++ Standard
// C5038 data member 'X' will be initialized after data member 'Y'
// C5040 dynamic exception specifications are valid only in C++14 and earlier; treating as noexcept(false)
// C5043 exception specification does not match previous declaration
// C5204 class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly
// C5246 'anonymous struct or union': the initialization of a subobject should be wrapped in braces
// C5256 a non-defining declaration of an enumeration with a fixed underlying type is only permitted as a standalone declaration
// C5262 implicit fall-through occurs here; are you missing a break statement?
// C5267 definition of implicit copy constructor for 'X' is deprecated because it has a user-provided assignment operator
#endif // _XBOX_ONE && _TITLE
#endif // _MSC_VER
#ifdef __INTEL_COMPILER
#pragma warning(disable : 161)
@ -70,6 +79,9 @@
#pragma clang diagnostic ignored "-Wswitch-enum"
#pragma clang diagnostic ignored "-Wtautological-type-limit-compare"
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wundef"
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif
#ifdef _WIN32
@ -120,7 +132,7 @@
#endif
#include <d3d11_4.h>
#else
#include <d3d11_1.h>
#include <d3d11_2.h>
#endif
#else // !WIN32
#include <wsl/winadapter.h>
@ -130,6 +142,7 @@
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdlib>
#include <ctime>
#include <cstring>
@ -186,10 +199,15 @@ using WICPixelFormatGUID = GUID;
#define XBOX_DXGI_FORMAT_R4G4_UNORM DXGI_FORMAT(190)
#define WIN11_DXGI_FORMAT_A4B4G4R4_UNORM DXGI_FORMAT(191)
#if defined(__MINGW32__) && !defined(E_BOUNDS)
#define E_BOUNDS static_cast<HRESULT>(0x8000000BL)
#endif
// HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
#define HRESULT_ERROR_FILE_NOT_FOUND static_cast<HRESULT>(0x80070002)
// HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW)
#define HRESULT_E_ARITHMETIC_OVERFLOW static_cast<HRESULT>(0x80070216L)
@ -309,7 +327,7 @@ namespace DirectX
//---------------------------------------------------------------------------------
// Image helper functions
_Success_(return) bool __cdecl DetermineImageArray(
HRESULT __cdecl DetermineImageArray(
_In_ const TexMetadata& metadata, _In_ CP_FLAGS cpFlags,
_Out_ size_t& nImages, _Out_ size_t& pixelSize) noexcept;

Some files were not shown because too many files have changed in this diff Show More