mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-13 13:40:14 +02:00
Compare commits
No commits in common. "main" and "sep2024" have entirely different histories.
@ -1,370 +0,0 @@
|
||||
# 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
|
@ -1,397 +0,0 @@
|
||||
# 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
|
@ -1,229 +0,0 @@
|
||||
# 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
|
@ -1,321 +0,0 @@
|
||||
# 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
|
@ -1,154 +0,0 @@
|
||||
# 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
|
@ -1,359 +0,0 @@
|
||||
# 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
|
@ -1,138 +0,0 @@
|
||||
# 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
|
@ -1,354 +0,0 @@
|
||||
# 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
|
@ -1,157 +0,0 @@
|
||||
# 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'
|
@ -1,157 +0,0 @@
|
||||
# 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'
|
@ -1,300 +0,0 @@
|
||||
# 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
|
@ -1,187 +0,0 @@
|
||||
# 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
|
@ -1,171 +0,0 @@
|
||||
# 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
|
@ -1,267 +0,0 @@
|
||||
# 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
|
@ -1,267 +0,0 @@
|
||||
# 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
|
@ -1,97 +0,0 @@
|
||||
# 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)'
|
@ -1,92 +0,0 @@
|
||||
# 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'
|
@ -1,152 +0,0 @@
|
||||
# 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)
|
@ -1,201 +0,0 @@
|
||||
# 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
|
@ -1,20 +0,0 @@
|
||||
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
|
@ -1,120 +0,0 @@
|
||||
# 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)
|
@ -1,57 +0,0 @@
|
||||
# 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
|
@ -1,89 +0,0 @@
|
||||
# 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
|
@ -1,13 +1,5 @@
|
||||
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
1
.gitattributes
vendored
@ -14,7 +14,6 @@
|
||||
*.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
6
.github/dependabot.yml
vendored
@ -1,6 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule:
|
||||
interval: monthly
|
9
.github/linters/.editorconfig-checker.json
vendored
9
.github/linters/.editorconfig-checker.json
vendored
@ -1,9 +0,0 @@
|
||||
{
|
||||
"Format": "github-actions",
|
||||
"exclude": [
|
||||
".git",
|
||||
"LICENSE",
|
||||
"Tests",
|
||||
"Common/d3dx12.h"
|
||||
]
|
||||
}
|
20
.github/linters/.markdown-lint.yml
vendored
20
.github/linters/.markdown-lint.yml
vendored
@ -1,20 +0,0 @@
|
||||
# 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
|
@ -1,5 +0,0 @@
|
||||
# PSScriptAnalyzerSettings.psd1
|
||||
@{
|
||||
Severity=@('Error','Warning')
|
||||
ExcludeRules=@('PSAvoidUsingWriteHost')
|
||||
}
|
17
.github/linters/.yaml-lint.yml
vendored
17
.github/linters/.yaml-lint.yml
vendored
@ -1,17 +0,0 @@
|
||||
# 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
133
.github/workflows/bvt.yml
vendored
@ -1,133 +0,0 @@
|
||||
# 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
|
33
.github/workflows/codeql.yml
vendored
33
.github/workflows/codeql.yml
vendored
@ -7,59 +7,42 @@ name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: "main"
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- LICENSE
|
||||
- '.azuredevops/**'
|
||||
- '.nuget/*'
|
||||
- build/*.cmd
|
||||
- build/*.json
|
||||
- build/*.props
|
||||
- build/*.ps1
|
||||
- build/*.targets
|
||||
- build/*.xvd
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: "main"
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- LICENSE
|
||||
- '.azuredevops/**'
|
||||
- '.nuget/*'
|
||||
- build/*.cmd
|
||||
- build/*.json
|
||||
- build/*.props
|
||||
- build/*.ps1
|
||||
- build/*.targets
|
||||
- build/*.xvd
|
||||
- build/*.yml
|
||||
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
|
||||
security-events: write
|
||||
packages: read
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 'Install Ninja'
|
||||
run: choco install ninja
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: c-cpp
|
||||
build-mode: manual
|
||||
@ -73,6 +56,6 @@ jobs:
|
||||
run: cmake --build out\build\x64-Debug
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:c-cpp"
|
||||
|
46
.github/workflows/lint.yml
vendored
46
.github/workflows/lint.yml
vendored
@ -1,46 +0,0 @@
|
||||
# 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
|
95
.github/workflows/main.yml
vendored
95
.github/workflows/main.yml
vendored
@ -7,106 +7,78 @@ 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
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: "main"
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- LICENSE
|
||||
- '.azuredevops/**'
|
||||
- '.nuget/*'
|
||||
- build/*.cmd
|
||||
- build/*.json
|
||||
- build/*.props
|
||||
- build/*.ps1
|
||||
- build/*.targets
|
||||
- build/*.xvd
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
- build/*.yml
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
matrix:
|
||||
toolver: ['14.29', '14']
|
||||
os: [windows-2019, windows-2022]
|
||||
build_type: [x64-Debug, x64-Release]
|
||||
arch: [amd64]
|
||||
include:
|
||||
- toolver: '14.29'
|
||||
- os: windows-2019
|
||||
build_type: x86-Debug
|
||||
arch: amd64_x86
|
||||
- toolver: '14.29'
|
||||
- os: windows-2019
|
||||
build_type: x86-Release
|
||||
arch: amd64_x86
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x86-Debug
|
||||
arch: amd64_x86
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
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'
|
||||
- os: windows-2022
|
||||
build_type: x64-Debug-Clang
|
||||
arch: amd64
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x64-Release-Clang
|
||||
arch: amd64
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x86-Debug-Clang
|
||||
arch: amd64_x86
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x86-Release-Clang
|
||||
arch: amd64_x86
|
||||
- toolver: '14'
|
||||
build_type: arm64-Debug-Clang
|
||||
- os: windows-2022
|
||||
build_type: arm64-Debug
|
||||
arch: amd64_arm64
|
||||
- toolver: '14'
|
||||
build_type: arm64-Release-Clang
|
||||
- os: windows-2022
|
||||
build_type: arm64-Release
|
||||
arch: amd64_arm64
|
||||
- os: windows-2022
|
||||
build_type: arm64ec-Debug
|
||||
arch: amd64_arm64
|
||||
- os: windows-2022
|
||||
build_type: arm64ec-Release
|
||||
arch: amd64_arm64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: 'Install Ninja'
|
||||
run: choco install ninja
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
toolset: ${{ matrix.toolver }}
|
||||
|
||||
- name: 'Configure CMake'
|
||||
working-directory: ${{ github.workspace }}
|
||||
@ -116,10 +88,6 @@ jobs:
|
||||
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 }}
|
||||
@ -129,16 +97,3 @@ jobs:
|
||||
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 }}
|
||||
|
46
.github/workflows/msbuild.yml
vendored
46
.github/workflows/msbuild.yml
vendored
@ -7,19 +7,12 @@ name: MSBuild
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: "main"
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- LICENSE
|
||||
- '.azuredevops/**'
|
||||
- '.nuget/*'
|
||||
- build/*
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: "main"
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- LICENSE
|
||||
- '.azuredevops/**'
|
||||
- '.nuget/*'
|
||||
- build/*
|
||||
|
||||
@ -28,7 +21,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022 # has v142 tools but not v142 spectre libs
|
||||
runs-on: windows-${{ matrix.vs }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@ -37,48 +30,33 @@ jobs:
|
||||
vs: [2019, 2022]
|
||||
build_type: [Debug, Release]
|
||||
platform: [x86, x64, ARM64]
|
||||
exclude:
|
||||
- vs: 2019
|
||||
platform: ARM64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Add MSBuild to PATH
|
||||
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- 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
|
||||
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
|
||||
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
|
||||
run: msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXTex_Windows10_2022.sln
|
||||
|
||||
- if: matrix.platform != 'ARM64' && matrix.vs != '2019'
|
||||
- if: matrix.platform != 'ARM64'
|
||||
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
|
||||
run: msbuild /m /p:SpectreMitigation=Spectre /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXTex_Desktop_${{ matrix.vs }}.sln
|
||||
|
||||
- if: matrix.platform != 'ARM64' && matrix.vs != '2019'
|
||||
- if: matrix.platform != 'ARM64'
|
||||
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
|
||||
run: msbuild /m /p:SpectreMitigation=Spectre /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXTex_Desktop_${{ matrix.vs }}_Win10.sln
|
||||
|
26
.github/workflows/msvc.yml
vendored
26
.github/workflows/msvc.yml
vendored
@ -7,31 +7,19 @@ 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
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: "main"
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- LICENSE
|
||||
- '.azuredevops/**'
|
||||
- '.nuget/*'
|
||||
- build/*.cmd
|
||||
- build/*.json
|
||||
- build/*.props
|
||||
- build/*.ps1
|
||||
- build/*.targets
|
||||
- build/*.xvd
|
||||
- build/*.yml
|
||||
schedule:
|
||||
- cron: '41 16 * * 1'
|
||||
|
||||
@ -49,9 +37,9 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: amd64
|
||||
|
||||
@ -74,7 +62,7 @@ jobs:
|
||||
CompileShadersOutput: ${{ github.workspace }}/out/Shaders/Compiled
|
||||
|
||||
- name: Initialize MSVC Code Analysis
|
||||
uses: microsoft/msvc-code-analysis-action@24c285ab36952c9e9182f4b78dfafbac38a7e5ee # v0.1.1
|
||||
uses: microsoft/msvc-code-analysis-action@v0.1.1
|
||||
id: run-analysis
|
||||
with:
|
||||
cmakeBuildDirectory: ./out
|
||||
@ -83,6 +71,6 @@ jobs:
|
||||
|
||||
# Upload SARIF file to GitHub Code Scanning Alerts
|
||||
- name: Upload SARIF to GitHub
|
||||
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
with:
|
||||
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
|
||||
|
102
.github/workflows/test.yml
vendored
102
.github/workflows/test.yml
vendored
@ -1,99 +1,84 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
#
|
||||
# https://go.microsoft.com/fwlink/?LinkId=248926
|
||||
# http://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
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: "main"
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- LICENSE
|
||||
- '.azuredevops/**'
|
||||
- '.nuget/*'
|
||||
- build/*.cmd
|
||||
- build/*.json
|
||||
- build/*.props
|
||||
- build/*.ps1
|
||||
- build/*.targets
|
||||
- build/*.xvd
|
||||
- build/*.yml
|
||||
|
||||
env:
|
||||
DIRECTXTEX_MEDIA_PATH: ${{ github.workspace }}/Media
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
matrix:
|
||||
toolver: ['14.29', '14']
|
||||
os: [windows-2019, windows-2022]
|
||||
build_type: [x64-Debug, x64-Release]
|
||||
arch: [amd64]
|
||||
include:
|
||||
- toolver: '14.29'
|
||||
- os: windows-2019
|
||||
build_type: x86-Debug
|
||||
arch: amd64_x86
|
||||
- toolver: '14.29'
|
||||
- os: windows-2019
|
||||
build_type: x86-Release
|
||||
arch: amd64_x86
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x86-Debug
|
||||
arch: amd64_x86
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x86-Release
|
||||
arch: amd64_x86
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x64-Debug-Clang
|
||||
arch: amd64
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x64-Release-Clang
|
||||
arch: amd64
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x86-Debug-Clang
|
||||
arch: amd64_x86
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x86-Release-Clang
|
||||
arch: amd64_x86
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: arm64-Debug
|
||||
arch: amd64_arm64
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: arm64-Release
|
||||
arch: amd64_arm64
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: arm64ec-Debug
|
||||
arch: amd64_arm64
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: arm64ec-Release
|
||||
arch: amd64_arm64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Clone test repository
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: walbourn/directxtextest
|
||||
path: Tests
|
||||
@ -102,10 +87,9 @@ jobs:
|
||||
- name: 'Install Ninja'
|
||||
run: choco install ninja
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
toolset: ${{ matrix.toolver }}
|
||||
|
||||
- name: 'Set triplet'
|
||||
shell: pwsh
|
||||
@ -134,55 +118,19 @@ jobs:
|
||||
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
|
||||
- uses: lukka/run-vcpkg@v11
|
||||
with:
|
||||
runVcpkgInstall: true
|
||||
vcpkgJsonGlob: '**/build/vcpkg.json'
|
||||
vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
|
||||
vcpkgGitCommitId: '7516a02de04e8f8ff4e4beb8f5bac0565f9bf9da'
|
||||
|
||||
- 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"
|
||||
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
96
.github/workflows/uwp.yml
vendored
@ -1,96 +0,0 @@
|
||||
# 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 }}
|
99
.github/workflows/vcpkg.yml
vendored
99
.github/workflows/vcpkg.yml
vendored
@ -1,108 +1,59 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
#
|
||||
# https://go.microsoft.com/fwlink/?LinkId=248926
|
||||
# http://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
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: "main"
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- LICENSE
|
||||
- '.azuredevops/**'
|
||||
- build/*.cmd
|
||||
- build/*.props
|
||||
- build/*.ps1
|
||||
- build/*.targets
|
||||
- build/*.xvd
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
- build/*
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
matrix:
|
||||
toolver: ['14.29', '14']
|
||||
os: [windows-2019, windows-2022]
|
||||
build_type: [x64-Debug-VCPKG]
|
||||
arch: [amd64]
|
||||
shared: ['OFF']
|
||||
include:
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x64-Debug-Clang-VCPKG
|
||||
arch: amd64
|
||||
shared: 'OFF'
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
build_type: x86-Debug-VCPKG
|
||||
arch: amd64_x86
|
||||
shared: 'OFF'
|
||||
- toolver: '14'
|
||||
- os: windows-2022
|
||||
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
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: 'Install Ninja'
|
||||
run: choco install ninja
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
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
|
||||
@ -123,37 +74,17 @@ jobs:
|
||||
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
|
||||
- uses: lukka/run-vcpkg@v11
|
||||
with:
|
||||
runVcpkgInstall: true
|
||||
vcpkgJsonGlob: '**/build/vcpkg.json'
|
||||
vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
|
||||
vcpkgGitCommitId: '7516a02de04e8f8ff4e4beb8f5bac0565f9bf9da'
|
||||
|
||||
- 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"
|
||||
cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=OFF -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="${env:VCPKG_DEFAULT_TRIPLET}"
|
||||
|
||||
- name: 'Build'
|
||||
|
69
.github/workflows/wsl.yml
vendored
69
.github/workflows/wsl.yml
vendored
@ -1,40 +1,25 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
#
|
||||
# https://go.microsoft.com/fwlink/?LinkId=248926
|
||||
# http://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
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: "main"
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- LICENSE
|
||||
- '.azuredevops/**'
|
||||
- '.nuget/*'
|
||||
- build/*.cmd
|
||||
- build/*.json
|
||||
- build/*.props
|
||||
- build/*.ps1
|
||||
- build/*.targets
|
||||
- build/*.xvd
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
- build/*.yml
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -45,35 +30,18 @@ jobs:
|
||||
|
||||
matrix:
|
||||
build_type: [x64-Debug-Linux, x64-Release-Linux]
|
||||
gcc: [12, 13, 14]
|
||||
gcc: [10, 11, 12]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
|
||||
- uses: seanmiddleditch/gha-setup-ninja@v5
|
||||
|
||||
- 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
|
||||
- uses: lukka/run-vcpkg@v11
|
||||
with:
|
||||
runVcpkgInstall: true
|
||||
vcpkgJsonGlob: '**/build/vcpkg.json'
|
||||
vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
|
||||
vcpkgGitCommitId: '7516a02de04e8f8ff4e4beb8f5bac0565f9bf9da'
|
||||
|
||||
- name: 'Configure CMake'
|
||||
working-directory: ${{ github.workspace }}
|
||||
@ -89,22 +57,3 @@ jobs:
|
||||
- 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 }}
|
||||
|
@ -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 (16.11) or Visual Studio 2022 on Windows 8.1 or later.
|
||||
<description>This version is for Windows desktop applications using Visual Studio 2019 (16.11) or Visual Studio 2022 and supports Windows 7 / DirectX 11.
|
||||
|
||||
DirectXTex, a shared source library for reading and writing .DDS files, and performing various texture content processing operations including resizing, format conversion, mip-map generation, block compression for Direct3D runtime texture resources, and height-map to normal-map conversion. This library makes use of the Windows Image Component (WIC) APIs. It also includes simple .TGA and .HDR readers and writers since these image file format are commonly used for texture content processing pipelines, but are not currently supported by a built-in WIC codec.</description>
|
||||
<releaseNotes>Matches the July 9, 2025 release on GitHub.</releaseNotes>
|
||||
<releaseNotes>Matches the September 4, 2024 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>
|
||||
|
@ -3,14 +3,14 @@
|
||||
<metadata minClientVersion="2.8.6">
|
||||
<id>directxtex_desktop_win10</id>
|
||||
<version>0.0.0-SpecifyVersionOnCommandline</version>
|
||||
<title>DirectXTex Library (VS 2022 Win32 for Windows 10/11)</title>
|
||||
<title>DirectXTex Library (VS 2019/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 2022 on Windows 10 / Windows 11 including both DirectX 11 and DirectX 12.
|
||||
<description>This version is for Windows desktop applications using Visual Studio 2019 (16.11) or Visual Studio 2022 and supports Windows 10 / Windows 11 including both DirectX 11 and DirectX 12.
|
||||
|
||||
DirectXTex, a shared source library for reading and writing .DDS files, and performing various texture content processing operations including resizing, format conversion, mip-map generation, block compression for Direct3D runtime texture resources, and height-map to normal-map conversion. This library makes use of the Windows Image Component (WIC) APIs. It also includes simple .TGA and .HDR readers and writers since these image file format are commonly used for texture content processing pipelines, but are not currently supported by a built-in WIC codec.</description>
|
||||
<releaseNotes>Matches the July 9, 2025 release on GitHub.</releaseNotes>
|
||||
<releaseNotes>Matches the September 4, 2024 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>© Microsoft Corporation. All rights reserved.</copyright>
|
||||
<tags>DirectX DirectXTex native nativepackage ARM64</tags>
|
||||
<tags>DirectX DirectXTex native nativepackage</tags>
|
||||
</metadata>
|
||||
|
||||
<files>
|
||||
@ -28,41 +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_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\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\DebugSpectre\*.lib" />
|
||||
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2022_Win10\Win32\DebugSpectre\*.pdb" />
|
||||
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2019_Win10\Win32\DebugSpectre\*.lib" />
|
||||
<file target="native\lib\x86\Debug" src="DirectXTex\Bin\Desktop_2019_Win10\Win32\DebugSpectre\*.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\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\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\x86\Release" src="DirectXTex\Bin\Desktop_2019_Win10\Win32\ReleaseSpectre\*.lib" />
|
||||
<file target="native\lib\x86\Release" src="DirectXTex\Bin\Desktop_2019_Win10\Win32\ReleaseSpectre\*.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\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\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\Debug" src="DirectXTex\Bin\Desktop_2019_Win10\x64\DebugSpectre\*.lib" />
|
||||
<file target="native\lib\x64\Debug" src="DirectXTex\Bin\Desktop_2019_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_2019_Win10\x64\Release\*.lib" />
|
||||
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2019_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\x64\Release" src="DirectXTex\Bin\Desktop_2019_Win10\x64\ReleaseSpectre\*.lib" />
|
||||
<file target="native\lib\x64\Release" src="DirectXTex\Bin\Desktop_2019_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_2019_Win10\ARM64\Debug\*.lib" />
|
||||
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Desktop_2019_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\Debug" src="DirectXTex\Bin\Desktop_2019_Win10\ARM64\DebugSpectre\*.lib" />
|
||||
<file target="native\lib\ARM64\Debug" src="DirectXTex\Bin\Desktop_2019_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_2019_Win10\ARM64\Release\*.lib" />
|
||||
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Desktop_2019_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 target="native\lib\ARM64\Release" src="DirectXTex\Bin\Desktop_2019_Win10\ARM64\ReleaseSpectre\*.lib" />
|
||||
<file target="native\lib\ARM64\Release" src="DirectXTex\Bin\Desktop_2019_Win10\ARM64\ReleaseSpectre\*.pdb" />
|
||||
|
||||
<file src=".nuget/directxtex_desktop_win10.targets" target="build\native" />
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
<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 July 9, 2025 release on GitHub.</releaseNotes>
|
||||
<releaseNotes>Matches the September 4, 2024 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>© Microsoft Corporation. All rights reserved.</copyright>
|
||||
<tags>DirectX DirectXTex native nativepackage ARM64</tags>
|
||||
<tags>DirectX DirectXTex native nativepackage</tags>
|
||||
</metadata>
|
||||
|
||||
<files>
|
||||
|
@ -45,13 +45,8 @@
|
||||
#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
|
||||
@ -153,13 +148,6 @@ 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;
|
||||
@ -169,8 +157,7 @@ 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;
|
||||
@ -233,7 +220,7 @@ HRESULT DirectX::GetMetadataFromEXRFile(const wchar_t* szFile, TexMetadata& meta
|
||||
const int nameLength = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, nullptr, 0, nullptr, nullptr);
|
||||
if (nameLength > 0)
|
||||
{
|
||||
fileName.resize(static_cast<size_t>(nameLength));
|
||||
fileName.resize(nameLength);
|
||||
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName.data(), nameLength, nullptr, nullptr);
|
||||
if (result <= 0)
|
||||
{
|
||||
@ -241,10 +228,19 @@ HRESULT DirectX::GetMetadataFromEXRFile(const wchar_t* szFile, TexMetadata& meta
|
||||
}
|
||||
}
|
||||
|
||||
#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());
|
||||
@ -342,7 +338,7 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
|
||||
const int nameLength = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, nullptr, 0, nullptr, nullptr);
|
||||
if (nameLength > 0)
|
||||
{
|
||||
fileName.resize(static_cast<size_t>(nameLength));
|
||||
fileName.resize(nameLength);
|
||||
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName.data(), nameLength, nullptr, nullptr);
|
||||
if (result <= 0)
|
||||
{
|
||||
@ -350,10 +346,19 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
|
||||
}
|
||||
}
|
||||
|
||||
#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());
|
||||
@ -375,7 +380,7 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
|
||||
Imf::RgbaInputFile file(fileName.c_str());
|
||||
#endif
|
||||
|
||||
const auto dw = file.dataWindow();
|
||||
auto const dw = file.dataWindow();
|
||||
|
||||
const int width = dw.max.x - dw.min.x + 1;
|
||||
int height = dw.max.y - dw.min.y + 1;
|
||||
@ -482,7 +487,7 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
|
||||
const int nameLength = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, nullptr, 0, nullptr, nullptr);
|
||||
if (nameLength > 0)
|
||||
{
|
||||
fileName.resize(static_cast<size_t>(nameLength));
|
||||
fileName.resize(nameLength);
|
||||
const int result = WideCharToMultiByte(CP_UTF8, 0, szFile, -1, fileName.data(), nameLength, nullptr, nullptr);
|
||||
if (result <= 0)
|
||||
{
|
||||
@ -491,10 +496,19 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
|
||||
}
|
||||
|
||||
// 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());
|
||||
@ -512,8 +526,8 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
|
||||
|
||||
try
|
||||
{
|
||||
const auto width = static_cast<int>(image.width);
|
||||
const auto height = static_cast<int>(image.height);
|
||||
const int width = static_cast<int>(image.width);
|
||||
const int height = static_cast<int>(image.height);
|
||||
|
||||
#ifdef _WIN32
|
||||
Imf::RgbaOutputFile file(stream, Imf::Header(width, height), Imf::WRITE_RGBA);
|
||||
@ -528,7 +542,7 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto bytes = static_cast<uint64_t>(image.width) * static_cast<uint64_t>(image.height);
|
||||
const uint64_t bytes = image.width * image.height;
|
||||
|
||||
if (bytes > static_cast<uint64_t>(UINT32_MAX))
|
||||
{
|
||||
|
@ -14,15 +14,13 @@
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromEXRFile(
|
||||
HRESULT __cdecl GetMetadataFromEXRFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_Out_ TexMetadata& metadata);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromEXRFile(
|
||||
HRESULT __cdecl LoadFromEXRFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl SaveToEXRFile(
|
||||
_In_ const Image& image,
|
||||
_In_z_ const wchar_t* szFile);
|
||||
HRESULT __cdecl SaveToEXRFile(_In_ const Image& image, _In_z_ const wchar_t* szFile);
|
||||
}
|
||||
|
@ -18,16 +18,16 @@
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromJPEGFile(
|
||||
HRESULT __cdecl GetMetadataFromJPEGFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_Out_ TexMetadata& metadata);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromJPEGFile(
|
||||
HRESULT __cdecl LoadFromJPEGFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_Out_opt_ TexMetadata* metadata,
|
||||
_Out_ ScratchImage& image);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl SaveToJPEGFile(
|
||||
HRESULT __cdecl SaveToJPEGFile(
|
||||
_In_ const Image& image,
|
||||
_In_z_ const wchar_t* szFile);
|
||||
}
|
||||
|
@ -18,16 +18,16 @@
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromPNGFile(
|
||||
HRESULT __cdecl GetMetadataFromPNGFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_Out_ TexMetadata& metadata);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromPNGFile(
|
||||
HRESULT __cdecl LoadFromPNGFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_Out_opt_ TexMetadata* metadata,
|
||||
_Out_ ScratchImage& image);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl SaveToPNGFile(
|
||||
HRESULT __cdecl SaveToPNGFile(
|
||||
_In_ const Image& image,
|
||||
_In_z_ const wchar_t* szFile);
|
||||
}
|
||||
|
@ -41,9 +41,6 @@
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
|
||||
#define DIRECTX_TEX_XBOX_VERSION 150
|
||||
|
||||
namespace Xbox
|
||||
@ -58,17 +55,13 @@ namespace Xbox
|
||||
constexpr XboxTileMode c_XboxTileModeLinear = XG_TILE_MODE_LINEAR;
|
||||
#endif
|
||||
|
||||
class DIRECTX_TEX_API XboxImage
|
||||
class XboxImage
|
||||
{
|
||||
public:
|
||||
XboxImage() noexcept
|
||||
: dataSize(0), baseAlignment(0), tilemode(c_XboxTileModeInvalid), metadata{}, memory(nullptr)
|
||||
{}
|
||||
: 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);
|
||||
}
|
||||
: dataSize(0), baseAlignment(0), tilemode(c_XboxTileModeInvalid), metadata{}, memory(nullptr) { *this = std::move(moveFrom); }
|
||||
~XboxImage() { Release(); }
|
||||
|
||||
XboxImage& __cdecl operator= (XboxImage&& moveFrom) noexcept;
|
||||
@ -101,98 +94,65 @@ namespace Xbox
|
||||
//---------------------------------------------------------------------------------
|
||||
// Image I/O
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSMemory(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl GetMetadataFromDDSMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_Out_ DirectX::TexMetadata& metadata, _Out_ bool& isXbox);
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSFile(
|
||||
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,
|
||||
HRESULT __cdecl GetMetadataFromDDSMemoryEx(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_Out_ DirectX::TexMetadata& metadata, _Out_ bool& isXbox,
|
||||
_Out_opt_ DirectX::DDSMetaData* ddPixelFormat);
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSFileEx(
|
||||
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,
|
||||
HRESULT __cdecl LoadFromDDSMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_Out_opt_ DirectX::TexMetadata* metadata, _Out_ XboxImage& image);
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSFile(
|
||||
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,
|
||||
HRESULT __cdecl LoadFromDDSMemoryEx(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_Out_opt_ DirectX::TexMetadata* metadata,
|
||||
_Out_opt_ DirectX::DDSMetaData* ddPixelFormat,
|
||||
_Out_ XboxImage& image);
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSFileEx(
|
||||
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
|
||||
HRESULT __cdecl SaveToDDSMemory(_In_ const XboxImage& xbox, _Out_ DirectX::Blob& blob);
|
||||
HRESULT __cdecl SaveToDDSFile(_In_ const XboxImage& xbox, _In_z_ const wchar_t* szFile);
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
// 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(
|
||||
HRESULT __cdecl Tile(_In_ const DirectX::Image& srcImage, _Out_ XboxImage& xbox, _In_ XboxTileMode mode = c_XboxTileModeInvalid);
|
||||
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);
|
||||
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(
|
||||
HRESULT __cdecl CreateTexture(
|
||||
_In_ ID3D11DeviceX* d3dDevice,
|
||||
_In_ const XboxImage& xbox, _Outptr_opt_ ID3D11Resource** ppResource, _Outptr_ void** grfxMemory);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl CreateShaderResourceView(
|
||||
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);
|
||||
void __cdecl FreeTextureMemory(_In_ ID3D11DeviceX* d3dDevice, _In_opt_ void* grfxMemory);
|
||||
|
||||
#endif
|
||||
|
||||
@ -201,27 +161,18 @@ namespace Xbox
|
||||
|
||||
#if ((defined(_XBOX_ONE) && defined(_TITLE)) || defined(_GAMING_XBOX)) && (defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__))
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl CreateTexture(
|
||||
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);
|
||||
void __cdecl FreeTextureMemory(_In_ ID3D12Device* d3dDevice, _In_opt_ void* grfxMemory);
|
||||
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
// DDS helper functions
|
||||
DIRECTX_TEX_API HRESULT __cdecl EncodeDDSHeader(
|
||||
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
|
||||
_Out_writes_bytes_(maxsize) void* pDestination, _In_ size_t maxsize) noexcept;
|
||||
|
||||
} // namespace
|
||||
|
@ -27,7 +27,7 @@ namespace
|
||||
// Decodes DDS header using XBOX extended header (variant of DX10 header)
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT DecodeDDSHeader(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource,
|
||||
_In_reads_bytes_(size) const void* pSource,
|
||||
size_t size,
|
||||
DirectX::TexMetadata& metadata,
|
||||
_Out_opt_ DDSMetaData* ddPixelFormat,
|
||||
@ -64,7 +64,7 @@ namespace
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(pSource);
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(pSource);
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
return E_FAIL;
|
||||
@ -229,7 +229,7 @@ namespace
|
||||
_Use_decl_annotations_
|
||||
HRESULT Xbox::EncodeDDSHeader(
|
||||
const XboxImage& xbox,
|
||||
uint8_t* pDestination,
|
||||
void* pDestination,
|
||||
size_t maxsize) noexcept
|
||||
{
|
||||
if (!pDestination)
|
||||
@ -383,7 +383,7 @@ HRESULT Xbox::EncodeDDSHeader(
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT Xbox::GetMetadataFromDDSMemory(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
TexMetadata& metadata,
|
||||
bool& isXbox)
|
||||
@ -393,7 +393,7 @@ HRESULT Xbox::GetMetadataFromDDSMemory(
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT Xbox::GetMetadataFromDDSMemoryEx(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
TexMetadata& metadata,
|
||||
bool& isXbox,
|
||||
@ -439,10 +439,12 @@ HRESULT Xbox::GetMetadataFromDDSFileEx(
|
||||
|
||||
isXbox = false;
|
||||
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
|
||||
nullptr)));
|
||||
#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());
|
||||
@ -496,7 +498,7 @@ HRESULT Xbox::GetMetadataFromDDSFileEx(
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
HRESULT Xbox::LoadFromDDSMemory(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
TexMetadata* metadata,
|
||||
XboxImage& xbox)
|
||||
@ -506,7 +508,7 @@ HRESULT Xbox::LoadFromDDSMemory(
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT Xbox::LoadFromDDSMemoryEx(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
TexMetadata* metadata,
|
||||
DDSMetaData* ddPixelFormat,
|
||||
@ -589,10 +591,13 @@ HRESULT Xbox::LoadFromDDSFileEx(
|
||||
|
||||
xbox.Release();
|
||||
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
|
||||
nullptr)));
|
||||
#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());
|
||||
@ -689,7 +694,7 @@ HRESULT Xbox::SaveToDDSMemory(const XboxImage& xbox, Blob& blob)
|
||||
return hr;
|
||||
|
||||
// Copy header
|
||||
auto pDestination = blob.GetBufferPointer();
|
||||
auto pDestination = reinterpret_cast<uint8_t*>(blob.GetBufferPointer());
|
||||
assert(pDestination);
|
||||
|
||||
hr = EncodeDDSHeader(xbox, pDestination, DDS_XBOX_HEADER_SIZE);
|
||||
@ -737,10 +742,13 @@ HRESULT Xbox::SaveToDDSFile(const XboxImage& xbox, const wchar_t* szFile)
|
||||
return hr;
|
||||
|
||||
// Create file and write header
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
GENERIC_WRITE, 0, CREATE_ALWAYS,
|
||||
nullptr)));
|
||||
#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());
|
||||
|
@ -32,9 +32,7 @@ namespace
|
||||
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)
|
||||
for (uint32_t item = 0; item < nimages; ++item)
|
||||
{
|
||||
const Image* img = result[item];
|
||||
if (!img || !img->pixels)
|
||||
@ -51,9 +49,9 @@ namespace
|
||||
{
|
||||
#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);
|
||||
const size_t offset = computer->GetTexelElementOffsetBytes(0, level, element, 0, item, 0, nullptr);
|
||||
#else
|
||||
const size_t offset = computer->GetTexelElementOffsetBytes(0, static_cast<uint32_t>(level), x, 0, static_cast<uint32_t>(item), 0);
|
||||
const size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, item, 0);
|
||||
#endif
|
||||
if (offset == size_t(-1))
|
||||
return E_FAIL;
|
||||
@ -85,7 +83,7 @@ namespace
|
||||
_In_reads_(nimages) const Image** result,
|
||||
size_t nimages)
|
||||
{
|
||||
if (!nimages || nimages > UINT32_MAX)
|
||||
if (!nimages)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (!xbox.GetPointer() || !computer || !result || !result[0])
|
||||
@ -152,7 +150,7 @@ namespace
|
||||
return E_FAIL;
|
||||
|
||||
// Perform detiling
|
||||
for (size_t item = 0; item < nimages; ++item)
|
||||
for (uint32_t item = 0; item < nimages; ++item)
|
||||
{
|
||||
const Image* img = result[item];
|
||||
if (!img || !img->pixels)
|
||||
@ -166,9 +164,9 @@ namespace
|
||||
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);
|
||||
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, item, 0, nullptr);
|
||||
#else
|
||||
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, static_cast<uint32_t>(item), 0);
|
||||
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, item, 0);
|
||||
#endif
|
||||
if (offset == size_t(-1))
|
||||
return E_FAIL;
|
||||
@ -201,7 +199,7 @@ namespace
|
||||
_In_reads_(nimages) const Image** result,
|
||||
size_t nimages)
|
||||
{
|
||||
if (!nimages || nimages > UINT32_MAX)
|
||||
if (!nimages)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (!xbox.GetPointer() || !computer || !result || !result[0])
|
||||
@ -212,7 +210,7 @@ namespace
|
||||
uint8_t* baseAddr = xbox.GetPointer();
|
||||
const auto& metadata = xbox.GetMetadata();
|
||||
|
||||
for (size_t item = 0; item < nimages; ++item)
|
||||
for (uint32_t item = 0; item < nimages; ++item)
|
||||
{
|
||||
const Image* img = result[item];
|
||||
if (!img || !img->pixels)
|
||||
@ -316,11 +314,6 @@ HRESULT Xbox::Detile(
|
||||
{
|
||||
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);
|
||||
@ -355,13 +348,13 @@ HRESULT Xbox::Detile(
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
for (size_t level = 0; level < metadata.mipLevels; ++level)
|
||||
for (uint32_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)
|
||||
for (uint32_t item = 0; item < metadata.arraySize; ++item)
|
||||
{
|
||||
const Image* img = image.GetImage(level, item, 0);
|
||||
if (!img)
|
||||
@ -373,7 +366,7 @@ HRESULT Xbox::Detile(
|
||||
images.push_back(img);
|
||||
}
|
||||
|
||||
hr = Detile1D(xbox, static_cast<uint32_t>(level), computer.Get(), layout, &images[0], images.size());
|
||||
hr = Detile1D(xbox, level, computer.Get(), layout, &images[0], images.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -384,7 +377,7 @@ HRESULT Xbox::Detile(
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
hr = Detile1D(xbox, static_cast<uint32_t>(level), computer.Get(), layout, &img, 1);
|
||||
hr = Detile1D(xbox, level, computer.Get(), layout, &img, 1);
|
||||
}
|
||||
|
||||
if (FAILED(hr))
|
||||
@ -398,12 +391,6 @@ HRESULT Xbox::Detile(
|
||||
|
||||
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);
|
||||
@ -440,13 +427,13 @@ HRESULT Xbox::Detile(
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
for (size_t level = 0; level < metadata.mipLevels; ++level)
|
||||
for (uint32_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)
|
||||
for (uint32_t item = 0; item < metadata.arraySize; ++item)
|
||||
{
|
||||
const Image* img = image.GetImage(level, item, 0);
|
||||
if (!img)
|
||||
@ -458,7 +445,7 @@ HRESULT Xbox::Detile(
|
||||
images.push_back(img);
|
||||
}
|
||||
|
||||
hr = Detile2D(xbox, static_cast<uint32_t>(level), computer.Get(), &images[0], images.size());
|
||||
hr = Detile2D(xbox, level, computer.Get(), &images[0], images.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -469,7 +456,7 @@ HRESULT Xbox::Detile(
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
hr = Detile2D(xbox, static_cast<uint32_t>(level), computer.Get(), &img, 1);
|
||||
hr = Detile2D(xbox, level, computer.Get(), &img, 1);
|
||||
}
|
||||
|
||||
if (FAILED(hr))
|
||||
@ -483,13 +470,6 @@ HRESULT Xbox::Detile(
|
||||
|
||||
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);
|
||||
@ -524,10 +504,10 @@ HRESULT Xbox::Detile(
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
auto d = static_cast<uint32_t>(metadata.depth);
|
||||
uint32_t d = static_cast<uint32_t>(metadata.depth);
|
||||
|
||||
size_t index = 0;
|
||||
for (size_t level = 0; level < metadata.mipLevels; ++level)
|
||||
for (uint32_t level = 0; level < metadata.mipLevels; ++level)
|
||||
{
|
||||
if ((index + d) > image.GetImageCount())
|
||||
{
|
||||
@ -536,7 +516,7 @@ HRESULT Xbox::Detile(
|
||||
}
|
||||
|
||||
// Relies on the fact that slices are contiguous
|
||||
hr = Detile3D(xbox, static_cast<uint32_t>(level), computer.Get(), image.GetImages()[index]);
|
||||
hr = Detile3D(xbox, level, computer.Get(), image.GetImages()[index]);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
image.Release();
|
||||
|
@ -34,7 +34,7 @@ namespace
|
||||
uint8_t* dptr = xbox.GetPointer();
|
||||
const uint8_t* endPtr = dptr + layout.SizeBytes;
|
||||
|
||||
for (size_t item = 0; item < nimages; ++item)
|
||||
for (uint32_t item = 0; item < nimages; ++item)
|
||||
{
|
||||
const Image* img = images[item];
|
||||
|
||||
@ -52,9 +52,9 @@ namespace
|
||||
{
|
||||
#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);
|
||||
size_t offset = computer->GetTexelElementOffsetBytes(0, level, element, 0, item, 0, nullptr);
|
||||
#else
|
||||
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, static_cast<uint32_t>(item), 0);
|
||||
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, item, 0);
|
||||
#endif
|
||||
if (offset == size_t(-1))
|
||||
return E_FAIL;
|
||||
@ -169,7 +169,7 @@ namespace
|
||||
const XG_RESOURCE_LAYOUT& layout,
|
||||
const XboxImage& xbox)
|
||||
{
|
||||
if (!nimages || nimages > UINT32_MAX)
|
||||
if (!nimages)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (!images || !images[0] || !computer || !xbox.GetPointer())
|
||||
@ -230,7 +230,7 @@ namespace
|
||||
memset(tiled, 0, sizeof(XMVECTOR) * tiledPixels);
|
||||
|
||||
// Perform tiling
|
||||
for (size_t item = 0; item < nimages; ++item)
|
||||
for (uint32_t item = 0; item < nimages; ++item)
|
||||
{
|
||||
const Image* img = images[item];
|
||||
|
||||
@ -248,9 +248,9 @@ namespace
|
||||
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);
|
||||
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, item, 0, nullptr);
|
||||
#else
|
||||
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, static_cast<uint32_t>(item), 0);
|
||||
size_t offset = computer->GetTexelElementOffsetBytes(0, level, x, 0, item, 0);
|
||||
#endif
|
||||
if (offset == size_t(-1))
|
||||
return E_FAIL;
|
||||
@ -285,7 +285,7 @@ namespace
|
||||
_In_ XGTextureAddressComputer* computer,
|
||||
const XboxImage& xbox)
|
||||
{
|
||||
if (!nimages || nimages > UINT32_MAX)
|
||||
if (!nimages)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (!images || !images[0] || !computer || !xbox.GetPointer())
|
||||
@ -294,7 +294,7 @@ namespace
|
||||
uint8_t* baseAddr = xbox.GetPointer();
|
||||
const auto& metadata = xbox.GetMetadata();
|
||||
|
||||
for (size_t item = 0; item < nimages; ++item)
|
||||
for (uint32_t item = 0; item < nimages; ++item)
|
||||
{
|
||||
const Image* img = images[item];
|
||||
|
||||
@ -444,38 +444,14 @@ HRESULT Xbox::Tile(
|
||||
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
|
||||
if (!srcImages
|
||||
|| !nimages
|
||||
|| 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)
|
||||
|| metadata.arraySize > D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION
|
||||
|| metadata.mipLevels > D3D11_REQ_MIP_LEVELS)
|
||||
return E_INVALIDARG;
|
||||
break;
|
||||
|
||||
default:
|
||||
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
xbox.Release();
|
||||
|
||||
@ -557,13 +533,13 @@ HRESULT Xbox::Tile(
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
for (size_t level = 0; level < metadata.mipLevels; ++level)
|
||||
for (uint32_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)
|
||||
for (uint32_t item = 0; item < metadata.arraySize; ++item)
|
||||
{
|
||||
const size_t index = metadata.ComputeIndex(level, item, 0);
|
||||
if (index >= nimages)
|
||||
@ -575,7 +551,7 @@ HRESULT Xbox::Tile(
|
||||
images.push_back(&srcImages[index]);
|
||||
}
|
||||
|
||||
hr = Tile1D(&images[0], images.size(), static_cast<uint32_t>(level), computer.Get(), layout, xbox);
|
||||
hr = Tile1D(&images[0], images.size(), level, computer.Get(), layout, xbox);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -587,7 +563,7 @@ HRESULT Xbox::Tile(
|
||||
}
|
||||
|
||||
const Image* images = &srcImages[index];
|
||||
hr = Tile1D(&images, 1, static_cast<uint32_t>(level), computer.Get(), layout, xbox);
|
||||
hr = Tile1D(&images, 1, level, computer.Get(), layout, xbox);
|
||||
}
|
||||
|
||||
if (FAILED(hr))
|
||||
@ -641,13 +617,13 @@ HRESULT Xbox::Tile(
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
for (size_t level = 0; level < metadata.mipLevels; ++level)
|
||||
for (uint32_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)
|
||||
for (uint32_t item = 0; item < metadata.arraySize; ++item)
|
||||
{
|
||||
const size_t index = metadata.ComputeIndex(level, item, 0);
|
||||
if (index >= nimages)
|
||||
@ -659,7 +635,7 @@ HRESULT Xbox::Tile(
|
||||
images.push_back(&srcImages[index]);
|
||||
}
|
||||
|
||||
hr = Tile2D(&images[0], images.size(), static_cast<uint32_t>(level), computer.Get(), xbox);
|
||||
hr = Tile2D(&images[0], images.size(), level, computer.Get(), xbox);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -671,7 +647,7 @@ HRESULT Xbox::Tile(
|
||||
}
|
||||
|
||||
const Image* images = &srcImages[index];
|
||||
hr = Tile2D(&images, 1, static_cast<uint32_t>(level), computer.Get(), xbox);
|
||||
hr = Tile2D(&images, 1, level, computer.Get(), xbox);
|
||||
}
|
||||
|
||||
if (FAILED(hr))
|
||||
@ -723,10 +699,10 @@ HRESULT Xbox::Tile(
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
auto d = static_cast<uint32_t>(metadata.depth);
|
||||
uint32_t d = static_cast<uint32_t>(metadata.depth);
|
||||
|
||||
size_t index = 0;
|
||||
for (size_t level = 0; level < metadata.mipLevels; ++level)
|
||||
for (uint32_t level = 0; level < metadata.mipLevels; ++level)
|
||||
{
|
||||
if ((index + d) > nimages)
|
||||
{
|
||||
@ -735,7 +711,7 @@ HRESULT Xbox::Tile(
|
||||
}
|
||||
|
||||
// Relies on the fact that slices are contiguous
|
||||
hr = Tile3D(srcImages[index], static_cast<uint32_t>(level), computer.Get(), xbox);
|
||||
hr = Tile3D(srcImages[index], level, computer.Get(), xbox);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
xbox.Release();
|
||||
|
49
CHANGELOG.md
49
CHANGELOG.md
@ -6,36 +6,6 @@ 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
|
||||
@ -45,7 +15,7 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXT
|
||||
* 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
|
||||
* 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
|
||||
@ -85,7 +55,7 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXT
|
||||
* 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
|
||||
* ``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*
|
||||
@ -140,7 +110,7 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXT
|
||||
* 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
|
||||
@ -149,7 +119,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)
|
||||
@ -170,7 +140,6 @@ 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
|
||||
@ -238,7 +207,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
|
||||
@ -256,7 +225,7 @@ 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.
|
||||
* Fixed conformance issues when using ``/Zc:preprocessor``
|
||||
@ -569,9 +538,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
|
||||
|
121
CMakeLists.txt
121
CMakeLists.txt
@ -3,9 +3,9 @@
|
||||
|
||||
cmake_minimum_required (VERSION 3.20)
|
||||
|
||||
set(DIRECTXTEX_VERSION 2.0.8)
|
||||
set(DIRECTXTEX_VERSION 2.0.5)
|
||||
|
||||
if(XBOX_CONSOLE_TARGET STREQUAL "durango")
|
||||
if(WINDOWS_STORE OR (DEFINED XBOX_CONSOLE_TARGET))
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
|
||||
endif()
|
||||
|
||||
@ -15,14 +15,8 @@ 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_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
|
||||
@ -45,8 +39,6 @@ option(DISABLE_MSVC_ITERATOR_DEBUGGING "Disable iterator debugging in Debug conf
|
||||
|
||||
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)
|
||||
@ -83,11 +75,6 @@ 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
|
||||
DirectXTex/DirectXTex.h
|
||||
@ -156,6 +143,7 @@ elseif((BUILD_XBOX_EXTS_XBOXONE OR BUILD_XBOX_EXTS_SCARLETT) AND WIN32)
|
||||
Auxiliary/DirectXTexXboxTile.cpp)
|
||||
endif()
|
||||
|
||||
|
||||
if(BUILD_DX11 AND WIN32 AND (NOT (XBOX_CONSOLE_TARGET STREQUAL "durango")))
|
||||
set(SHADER_SOURCES
|
||||
DirectXTex/Shaders/BC6HEncode.hlsl
|
||||
@ -172,7 +160,7 @@ if(BUILD_DX12)
|
||||
list(APPEND LIBRARY_SOURCES DirectXTex/DirectXTexD3D12.cpp)
|
||||
|
||||
if(NOT (DEFINED XBOX_CONSOLE_TARGET))
|
||||
list(APPEND LIBRARY_SOURCES Common/d3dx12.h)
|
||||
list(APPEND LIBRARY_SOURCES DirectXTex/d3dx12.h)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -226,28 +214,7 @@ if(BUILD_DX11 AND WIN32 AND (NOT (XBOX_CONSOLE_TARGET STREQUAL "durango")))
|
||||
endif()
|
||||
endif()
|
||||
|
||||
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()
|
||||
add_library(${PROJECT_NAME} STATIC ${LIBRARY_SOURCES} ${LIBRARY_HEADERS})
|
||||
|
||||
if(BUILD_DX11 AND WIN32)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${COMPILED_SHADERS})
|
||||
@ -343,11 +310,7 @@ endif()
|
||||
|
||||
if(MINGW OR (NOT WIN32))
|
||||
find_package(directxmath CONFIG REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectXMath)
|
||||
|
||||
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)
|
||||
@ -355,13 +318,13 @@ endif()
|
||||
|
||||
if(directxmath_FOUND)
|
||||
message(STATUS "Using DirectXMath package")
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectXMath)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC 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_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectX-Headers)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC USING_DIRECTX_HEADERS)
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CXX_COMPILER_ID:MSVC,Intel>:/wd4062> $<$<CXX_COMPILER_ID:Clang,IntelLLVM>:-Wno-switch-enum>)
|
||||
endif()
|
||||
|
||||
@ -441,8 +404,7 @@ if(BUILD_TOOLS AND WIN32)
|
||||
add_executable(texassemble
|
||||
Texassemble/texassemble.cpp
|
||||
Texassemble/texassemble.rc
|
||||
Common/CmdLineHelpers.h
|
||||
Common/settings.manifest
|
||||
Texassemble/settings.manifest
|
||||
Texassemble/AnimatedGif.cpp)
|
||||
target_compile_features(texassemble PRIVATE cxx_std_17)
|
||||
target_link_libraries(texassemble PRIVATE ${PROJECT_NAME} ole32.lib version.lib)
|
||||
@ -454,8 +416,7 @@ if(BUILD_TOOLS AND BUILD_DX11 AND WIN32)
|
||||
add_executable(texconv
|
||||
Texconv/texconv.cpp
|
||||
Texconv/texconv.rc
|
||||
Common/CmdLineHelpers.h
|
||||
Common/settings.manifest
|
||||
Texconv/settings.manifest
|
||||
Texconv/ExtendedBMP.cpp
|
||||
Texconv/PortablePixMap.cpp)
|
||||
target_compile_features(texconv PRIVATE cxx_std_17)
|
||||
@ -468,18 +429,13 @@ if(BUILD_TOOLS AND WIN32)
|
||||
add_executable(texdiag
|
||||
Texdiag/texdiag.cpp
|
||||
Texdiag/texdiag.rc
|
||||
Common/CmdLineHelpers.h
|
||||
Common/settings.manifest)
|
||||
Texdiag/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)
|
||||
@ -521,22 +477,32 @@ endif()
|
||||
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_SHADERS}/ddsview_ps1D.inc)
|
||||
${COMPILED_DDSVIEW_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_SHADERS})
|
||||
target_include_directories(ddsview PRIVATE ${COMPILED_DDSVIEW_SHADERS})
|
||||
|
||||
if(NOT USE_PREBUILT_SHADERS)
|
||||
add_custom_command(
|
||||
OUTPUT "${COMPILED_SHADERS}/ddsview_ps1D.inc"
|
||||
OUTPUT "${COMPILED_DDSVIEW_SHADERS}/ddsview_ps1D.inc"
|
||||
MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/DDSView/hlsl.cmd"
|
||||
DEPENDS "DDSView/ddsview.hlsl"
|
||||
DEPENDS "${PROJECT_SOURCE_DIR}/DDSView/ddsview.fx"
|
||||
COMMENT "Generating HLSL shaders for DDSView..."
|
||||
COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_SHADERS}" $<$<BOOL:${DIRECTX_FXC_TOOL}>:LegacyShaderCompiler=${DIRECTX_FXC_TOOL}> hlsl.cmd > "${COMPILED_SHADERS}/hlsl_ddsview.log"
|
||||
COMMAND COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_DDSVIEW_SHADERS}" hlsl.cmd > "${COMPILED_DDSVIEW_SHADERS}/hlsl.log"
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/DDSView"
|
||||
USES_TERMINAL)
|
||||
endif()
|
||||
@ -548,10 +514,6 @@ if(directxmath_FOUND)
|
||||
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 /Wall /GR-)
|
||||
@ -571,6 +533,12 @@ foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
|
||||
target_link_options(${t} PRIVATE ${LINKER_SWITCHES})
|
||||
endforeach()
|
||||
|
||||
if(MINGW)
|
||||
foreach(t IN LISTS TOOL_EXES)
|
||||
target_link_options(${t} PRIVATE -municode)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM")
|
||||
set(WarningsLib -Wall -Wpedantic -Wextra)
|
||||
|
||||
@ -593,10 +561,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM")
|
||||
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)
|
||||
@ -604,13 +568,12 @@ 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)))
|
||||
AND ((${DIRECTX_ARCH} MATCHES "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()
|
||||
@ -641,18 +604,15 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
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)
|
||||
if(BUILD_FUZZING
|
||||
AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.32)
|
||||
AND (NOT WINDOWS_STORE))
|
||||
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)
|
||||
if(XBOX_CONSOLE_TARGET STREQUAL "durango")
|
||||
@ -663,8 +623,9 @@ if(WIN32)
|
||||
elseif(${DIRECTX_ARCH} MATCHES "^arm")
|
||||
set(WINVER 0x0602)
|
||||
else()
|
||||
message(STATUS "Building with Windows 8.1 compatibility")
|
||||
set(WINVER 0x0603)
|
||||
message(STATUS "Building with Windows 7 compatibility")
|
||||
set(WINVER 0x0601)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE _WIN7_PLATFORM_UPDATE)
|
||||
endif()
|
||||
|
||||
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
|
||||
@ -694,10 +655,6 @@ if(WIN32 AND (NOT WINDOWS_STORE) AND (NOT (DEFINED XBOX_CONSOLE_TARGET)))
|
||||
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)
|
||||
|
@ -45,10 +45,6 @@
|
||||
"strategy": "external"
|
||||
},
|
||||
"cacheVariables": { "DIRECTX_ARCH": "arm64ec" },
|
||||
"environment": {
|
||||
"CFLAGS": "/arm64EC",
|
||||
"CXXFLAGS": "/arm64EC"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
@ -89,22 +85,6 @@
|
||||
"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,
|
||||
@ -118,7 +98,7 @@
|
||||
},
|
||||
|
||||
{
|
||||
"name": "Win8",
|
||||
"name": "Win7",
|
||||
"cacheVariables": {
|
||||
"BUILD_DX12": false
|
||||
},
|
||||
@ -214,7 +194,7 @@
|
||||
},
|
||||
"cacheVariables": {
|
||||
"VCPKG_TARGET_TRIPLET": "x86-mingw-static",
|
||||
"VCPKG_HOST_TRIPLET": "x64-windows"
|
||||
"VCPKG_HOST_TRIPLET": "x86-mingw-static"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -225,7 +205,7 @@
|
||||
},
|
||||
"cacheVariables": {
|
||||
"VCPKG_TARGET_TRIPLET": "x64-mingw-static",
|
||||
"VCPKG_HOST_TRIPLET": "x64-windows"
|
||||
"VCPKG_HOST_TRIPLET": "x64-mingw-static"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -251,24 +231,6 @@
|
||||
"strategy": "external"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "Analyze",
|
||||
"cacheVariables":
|
||||
{
|
||||
"ENABLE_CODE_ANALYSIS": true
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "Coverage",
|
||||
"cacheVariables":
|
||||
{
|
||||
"BUILD_TOOLS": false,
|
||||
"ENABLE_CODE_COVERAGE": true
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "Fuzzing",
|
||||
"cacheVariables": {
|
||||
@ -284,8 +246,8 @@
|
||||
{ "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": "arm64ec-Debug" , "description": "MSVC for ARM64EC (Debug) with DX12", "inherits": [ "base", "ARM64EC", "Debug", "MSVC" ], "environment": { "CXXFLAGS": "/arm64EC" } },
|
||||
{ "name": "arm64ec-Release", "description": "MSVC for ARM64EC (Release) with DX12", "inherits": [ "base", "ARM64EC", "Release", "MSVC" ], "environment": { "CXXFLAGS": "/arm64EC" } },
|
||||
|
||||
{ "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" ] },
|
||||
@ -294,10 +256,10 @@
|
||||
{ "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-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-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-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" ] },
|
||||
@ -314,8 +276,8 @@
|
||||
{ "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": "arm64ec-Debug-VCPKG" , "description": "MSVC for ARM64EC (Debug) using VCPKG", "inherits": [ "base", "ARM64EC", "Debug", "MSVC", "VCPKG" ], "environment": { "CXXFLAGS": "/arm64EC" }, "cacheVariables": { "VCPKG_TARGET_TRIPLET": "arm64ec-windows" } },
|
||||
{ "name": "arm64ec-Release-VCPKG", "description": "MSVC for ARM64EC (Release) using VCPKG", "inherits": [ "base", "ARM64EC", "Release", "MSVC", "VCPKG" ], "environment": { "CXXFLAGS": "/arm64EC" }, "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" ] },
|
||||
@ -325,29 +287,29 @@
|
||||
|
||||
{ "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", "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": "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": "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", "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": "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": "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-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-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": "x86-Debug-Clang-VCPKG" , "description": "Clang/LLVM for x86 (Debug) using VCPKG/OpenEXR", "inherits": [ "base", "x86", "Debug", "Clang", "VCPKG" ], "environment": { "CXXFLAGS": "-m32" } },
|
||||
{ "name": "x86-Release-Clang-VCPKG" , "description": "Clang/LLVM for x86 (Release) using VCPKG/OpenEXR", "inherits": [ "base", "x86", "Release", "Clang", "VCPKG" ], "environment": { "CXXFLAGS": "-m32" } },
|
||||
{ "name": "arm64-Debug-Clang-VCPKG" , "description": "Clang/LLVM for AArch64 (Debug) using VCPKG/OpenEXR", "inherits": [ "base", "ARM64", "Debug", "Clang", "VCPKG" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } },
|
||||
{ "name": "arm64-Release-Clang-VCPKG", "description": "Clang/LLVM for AArch64 (Release) using VCPKG/OpenEXR", "inherits": [ "base", "ARM64", "Release", "Clang", "VCPKG" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } },
|
||||
|
||||
{ "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" ] },
|
||||
@ -391,9 +353,6 @@
|
||||
{ "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": [
|
||||
@ -406,15 +365,6 @@
|
||||
{ "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" },
|
||||
@ -422,11 +372,6 @@
|
||||
{ "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" },
|
||||
|
@ -1,375 +0,0 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
// 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;
|
||||
}
|
||||
}
|
@ -18,7 +18,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <new>
|
||||
|
||||
@ -54,8 +53,6 @@ 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 "
|
||||
@ -129,15 +126,9 @@ namespace
|
||||
|
||||
#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
|
||||
{
|
||||
struct handle_closer { void operator()(HANDLE h) noexcept { if (h) CloseHandle(h); } };
|
||||
|
||||
using ScopedHandle = std::unique_ptr<void, handle_closer>;
|
||||
@ -153,7 +144,8 @@ namespace
|
||||
#else
|
||||
template<UINT TNameLength>
|
||||
inline void SetDebugObjectName(_In_ ID3D11DeviceChild*, _In_ const char(&)[TNameLength]) noexcept
|
||||
{}
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
@ -176,13 +168,13 @@ namespace
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (ddsDataSize < DDS_MIN_HEADER_SIZE)
|
||||
if (ddsDataSize < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
return E_FAIL;
|
||||
@ -203,7 +195,7 @@ namespace
|
||||
(MAKEFOURCC('D', 'X', '1', '0') == hdr->ddspf.fourCC))
|
||||
{
|
||||
// Must be long enough for both headers and magic value
|
||||
if (ddsDataSize < DDS_DX10_HEADER_SIZE)
|
||||
if (ddsDataSize < (sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
@ -213,7 +205,8 @@ namespace
|
||||
|
||||
// setup the pointers in the process request
|
||||
*header = hdr;
|
||||
auto offset = DDS_MIN_HEADER_SIZE
|
||||
auto offset = sizeof(uint32_t)
|
||||
+ sizeof(DDS_HEADER)
|
||||
+ (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0u);
|
||||
*bitData = ddsData + offset;
|
||||
*bitSize = ddsDataSize - offset;
|
||||
@ -238,10 +231,20 @@ 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());
|
||||
@ -261,7 +264,7 @@ namespace
|
||||
}
|
||||
|
||||
// Need at least enough data to fill the header and magic number to be a valid DDS
|
||||
if (fileInfo.EndOfFile.LowPart < DDS_MIN_HEADER_SIZE)
|
||||
if (fileInfo.EndOfFile.LowPart < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
@ -293,7 +296,7 @@ namespace
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
ddsData.reset();
|
||||
@ -316,7 +319,7 @@ namespace
|
||||
(MAKEFOURCC('D', 'X', '1', '0') == hdr->ddspf.fourCC))
|
||||
{
|
||||
// Must be long enough for both headers and magic value
|
||||
if (fileInfo.EndOfFile.LowPart < DDS_DX10_HEADER_SIZE)
|
||||
if (fileInfo.EndOfFile.LowPart < (sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10)))
|
||||
{
|
||||
ddsData.reset();
|
||||
return E_FAIL;
|
||||
@ -327,7 +330,7 @@ namespace
|
||||
|
||||
// setup the pointers in the process request
|
||||
*header = hdr;
|
||||
auto offset = DDS_MIN_HEADER_SIZE
|
||||
auto offset = sizeof(uint32_t) + sizeof(DDS_HEADER)
|
||||
+ (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0u);
|
||||
*bitData = ddsData.get() + offset;
|
||||
*bitSize = fileInfo.EndOfFile.LowPart - offset;
|
||||
@ -491,7 +494,7 @@ namespace
|
||||
_In_ size_t width,
|
||||
_In_ size_t height,
|
||||
_In_ DXGI_FORMAT fmt,
|
||||
_Out_opt_ size_t* outNumBytes,
|
||||
size_t* outNumBytes,
|
||||
_Out_opt_ size_t* outRowBytes,
|
||||
_Out_opt_ size_t* outNumRows) noexcept
|
||||
{
|
||||
@ -505,9 +508,6 @@ 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:
|
||||
@ -561,15 +561,6 @@ namespace
|
||||
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)
|
||||
@ -1750,7 +1741,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));
|
||||
const auto mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
|
||||
auto const mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
|
||||
switch (mode)
|
||||
{
|
||||
case DDS_ALPHA_MODE_STRAIGHT:
|
||||
|
@ -51,7 +51,6 @@ 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);
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <new>
|
||||
|
||||
@ -82,8 +81,6 @@ 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 "
|
||||
@ -157,15 +154,9 @@ namespace
|
||||
|
||||
#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
|
||||
{
|
||||
#ifdef _WIN32
|
||||
struct handle_closer { void operator()(HANDLE h) noexcept { if (h) CloseHandle(h); } };
|
||||
|
||||
@ -183,7 +174,8 @@ namespace
|
||||
#else
|
||||
template<UINT TNameLength>
|
||||
inline void SetDebugObjectName(_In_ ID3D12DeviceChild*, _In_z_ const wchar_t(&)[TNameLength]) noexcept
|
||||
{}
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
inline uint32_t CountMips(uint32_t width, uint32_t height) noexcept
|
||||
@ -222,13 +214,13 @@ namespace
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (ddsDataSize < DDS_MIN_HEADER_SIZE)
|
||||
if (ddsDataSize < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
return E_FAIL;
|
||||
@ -249,7 +241,7 @@ namespace
|
||||
(MAKEFOURCC('D', 'X', '1', '0') == hdr->ddspf.fourCC))
|
||||
{
|
||||
// Must be long enough for both headers and magic value
|
||||
if (ddsDataSize < DDS_DX10_HEADER_SIZE)
|
||||
if (ddsDataSize < (sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
@ -259,7 +251,8 @@ namespace
|
||||
|
||||
// setup the pointers in the process request
|
||||
*header = hdr;
|
||||
auto offset = DDS_MIN_HEADER_SIZE
|
||||
auto offset = sizeof(uint32_t)
|
||||
+ sizeof(DDS_HEADER)
|
||||
+ (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0u);
|
||||
*bitData = ddsData + offset;
|
||||
*bitSize = ddsDataSize - offset;
|
||||
@ -309,7 +302,7 @@ namespace
|
||||
}
|
||||
|
||||
// Need at least enough data to fill the header and magic number to be a valid DDS
|
||||
if (fileInfo.EndOfFile.LowPart < DDS_MIN_HEADER_SIZE)
|
||||
if (fileInfo.EndOfFile.LowPart < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
@ -352,7 +345,7 @@ namespace
|
||||
return E_FAIL;
|
||||
|
||||
// Need at least enough data to fill the header and magic number to be a valid DDS
|
||||
if (fileLen < DDS_MIN_HEADER_SIZE)
|
||||
if (fileLen < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
|
||||
return E_FAIL;
|
||||
|
||||
ddsData.reset(new (std::nothrow) uint8_t[size_t(fileLen)]);
|
||||
@ -379,7 +372,7 @@ namespace
|
||||
#endif
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
ddsData.reset();
|
||||
@ -402,7 +395,7 @@ namespace
|
||||
(MAKEFOURCC('D', 'X', '1', '0') == hdr->ddspf.fourCC))
|
||||
{
|
||||
// Must be long enough for both headers and magic value
|
||||
if (len < DDS_DX10_HEADER_SIZE)
|
||||
if (len < (sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10)))
|
||||
{
|
||||
ddsData.reset();
|
||||
return E_FAIL;
|
||||
@ -413,7 +406,7 @@ namespace
|
||||
|
||||
// setup the pointers in the process request
|
||||
*header = hdr;
|
||||
auto offset = DDS_MIN_HEADER_SIZE
|
||||
auto offset = sizeof(uint32_t) + sizeof(DDS_HEADER)
|
||||
+ (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0u);
|
||||
*bitData = ddsData.get() + offset;
|
||||
*bitSize = len - offset;
|
||||
@ -580,7 +573,7 @@ namespace
|
||||
_In_ size_t width,
|
||||
_In_ size_t height,
|
||||
_In_ DXGI_FORMAT fmt,
|
||||
_Out_opt_ size_t* outNumBytes,
|
||||
size_t* outNumBytes,
|
||||
_Out_opt_ size_t* outRowBytes,
|
||||
_Out_opt_ size_t* outNumRows) noexcept
|
||||
{
|
||||
@ -594,9 +587,6 @@ 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:
|
||||
@ -1622,7 +1612,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));
|
||||
const auto mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
|
||||
auto const mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
|
||||
switch (mode)
|
||||
{
|
||||
case DDS_ALPHA_MODE_STRAIGHT:
|
||||
|
@ -68,7 +68,6 @@ 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);
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
#include <new>
|
||||
@ -58,8 +57,6 @@ 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 "
|
||||
@ -118,12 +115,9 @@ namespace
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
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);
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
namespace
|
||||
{
|
||||
struct handle_closer { void operator()(HANDLE h) noexcept { if (h) CloseHandle(h); } };
|
||||
|
||||
using ScopedHandle = std::unique_ptr<void, handle_closer>;
|
||||
@ -150,13 +144,13 @@ namespace
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (ddsDataSize < DDS_DX9_HEADER_SIZE)
|
||||
if (ddsDataSize < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData);
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
return E_FAIL;
|
||||
@ -181,8 +175,9 @@ namespace
|
||||
|
||||
// setup the pointers in the process request
|
||||
*header = hdr;
|
||||
*bitData = ddsData + DDS_DX9_HEADER_SIZE;
|
||||
*bitSize = ddsDataSize - DDS_DX9_HEADER_SIZE;
|
||||
auto offset = sizeof(uint32_t) + sizeof(DDS_HEADER);
|
||||
*bitData = ddsData + offset;
|
||||
*bitSize = ddsDataSize - offset;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@ -204,10 +199,22 @@ namespace
|
||||
*bitSize = 0;
|
||||
|
||||
// open the file
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
fileName,
|
||||
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
|
||||
#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());
|
||||
@ -227,7 +234,7 @@ namespace
|
||||
}
|
||||
|
||||
// Need at least enough data to fill the header and magic number to be a valid DDS
|
||||
if (fileInfo.EndOfFile.LowPart < DDS_DX9_HEADER_SIZE)
|
||||
if (fileInfo.EndOfFile.LowPart < (sizeof(uint32_t) + sizeof(DDS_HEADER)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
@ -259,7 +266,7 @@ namespace
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
const auto dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
auto const dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
ddsData.reset();
|
||||
@ -287,8 +294,9 @@ namespace
|
||||
|
||||
// setup the pointers in the process request
|
||||
*header = hdr;
|
||||
*bitData = ddsData.get() + DDS_DX9_HEADER_SIZE;
|
||||
*bitSize = fileInfo.EndOfFile.LowPart - DDS_DX9_HEADER_SIZE;
|
||||
auto offset = sizeof(uint32_t) + sizeof(DDS_HEADER);
|
||||
*bitData = ddsData.get() + offset;
|
||||
*bitSize = fileInfo.EndOfFile.LowPart - offset;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@ -404,7 +412,7 @@ namespace
|
||||
_In_ size_t width,
|
||||
_In_ size_t height,
|
||||
_In_ D3DFORMAT fmt,
|
||||
_Out_opt_ size_t* outNumBytes,
|
||||
size_t* outNumBytes,
|
||||
_Out_opt_ size_t* outRowBytes,
|
||||
_Out_opt_ size_t* outNumRows) noexcept
|
||||
{
|
||||
@ -417,9 +425,6 @@ namespace
|
||||
size_t bpe = 0;
|
||||
switch (static_cast<int>(fmt))
|
||||
{
|
||||
case D3DFMT_UNKNOWN:
|
||||
return E_INVALIDARG;
|
||||
|
||||
case D3DFMT_DXT1:
|
||||
bc = true;
|
||||
bpe = 8;
|
||||
|
@ -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 "..\\Common\\directx.ico"
|
||||
IDI_MAIN_ICON ICON "directx.ico"
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -135,7 +135,7 @@
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(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=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
@ -182,7 +182,7 @@
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(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=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(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=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(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=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ControlFlowGuard>Guard</ControlFlowGuard>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
@ -291,7 +291,7 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ddsview.hlsl" />
|
||||
<None Include="ddsview.fx" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets" />
|
||||
@ -300,13 +300,10 @@
|
||||
<_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);WindowsSDKVersion=$(_ATGFXCVer);CompileShadersOutput=$(ProjectDir)\Shaders" LogStandardErrorAsError="true" />
|
||||
<Exec Condition="!Exists('Shaders/ddsview_vs.inc')" WorkingDirectory="$(ProjectDir)" Command="hlsl" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath)" LogStandardErrorAsError="true" />
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath />
|
||||
<_ATGFXCVer />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="ATGDeleteShaders" AfterTargets="Clean">
|
||||
|
@ -15,6 +15,6 @@
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ddsview.hlsl" />
|
||||
<None Include="ddsview.fx" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -135,7 +135,7 @@
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<AdditionalIncludeDirectories>..\DirectXTex;$(ProjectDir)Shaders;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(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=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(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=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(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=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;%(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=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(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=0x0603;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ControlFlowGuard>Guard</ControlFlowGuard>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
@ -291,7 +291,7 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ddsview.hlsl" />
|
||||
<None Include="ddsview.fx" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets" />
|
||||
@ -300,13 +300,10 @@
|
||||
<_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);WindowsSDKVersion=$(_ATGFXCVer);CompileShadersOutput=$(ProjectDir)\Shaders" LogStandardErrorAsError="true" />
|
||||
<Exec Condition="!Exists('Shaders/ddsview_vs.inc')" WorkingDirectory="$(ProjectDir)" Command="hlsl" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath)" LogStandardErrorAsError="true" />
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath />
|
||||
<_ATGFXCVer />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="ATGDeleteShaders" AfterTargets="Clean">
|
||||
|
@ -15,6 +15,6 @@
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ddsview.hlsl" />
|
||||
<None Include="ddsview.fx" />
|
||||
</ItemGroup>
|
||||
</Project>
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
@ -5,25 +5,16 @@ 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
|
||||
|
||||
if defined LegacyShaderCompiler goto fxcviaenv
|
||||
set PCFXC="%WindowsSdkVerBinPath%%FXCARCH%\fxc.exe"
|
||||
set PCFXC="%WindowsSdkVerBinPath%x86\fxc.exe"
|
||||
if exist %PCFXC% goto continue
|
||||
set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\%FXCARCH%\fxc.exe"
|
||||
set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\x86\fxc.exe"
|
||||
if exist %PCFXC% goto continue
|
||||
set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\%FXCARCH%\fxc.exe"
|
||||
set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\x86\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
|
||||
@ -32,50 +23,45 @@ set StrTrim=%StrTrim: ##=%
|
||||
set CompileShadersOutput=%StrTrim:##=%
|
||||
@if not exist "%CompileShadersOutput%" mkdir "%CompileShadersOutput%"
|
||||
|
||||
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EVS /Tvs_4_1 /Fh%CompileShadersOutput%\ddsview_vs.inc
|
||||
|
||||
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EVS /Tvs_4_1 /Fh%CompileShadersOutput%\ddsview_vs.inc
|
||||
echo %FXC%
|
||||
%FXC%
|
||||
@if ERRORLEVEL 1 goto error
|
||||
|
||||
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_1D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1D.inc
|
||||
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_1D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1D.inc
|
||||
echo %FXC%
|
||||
%FXC%
|
||||
@if ERRORLEVEL 1 goto error
|
||||
|
||||
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_1DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1Darray.inc
|
||||
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_1DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps1Darray.inc
|
||||
echo %FXC%
|
||||
%FXC%
|
||||
@if ERRORLEVEL 1 goto error
|
||||
|
||||
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_2D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2D.inc
|
||||
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_2D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2D.inc
|
||||
echo %FXC%
|
||||
%FXC%
|
||||
@if ERRORLEVEL 1 goto error
|
||||
|
||||
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_2DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2Darray.inc
|
||||
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_2DArray /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps2Darray.inc
|
||||
echo %FXC%
|
||||
%FXC%
|
||||
@if ERRORLEVEL 1 goto error
|
||||
|
||||
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_3D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps3D.inc
|
||||
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_3D /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_ps3D.inc
|
||||
echo %FXC%
|
||||
%FXC%
|
||||
@if ERRORLEVEL 1 goto error
|
||||
|
||||
set FXC=%PCFXC% ddsview.hlsl %FXCOPTS% /EPS_Cube /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_psCube.inc
|
||||
set FXC=%PCFXC% ddsview.fx %FXCOPTS% /EPS_Cube /Tps_4_1 /Fh%CompileShadersOutput%\ddsview_psCube.inc
|
||||
echo %FXC%
|
||||
%FXC%
|
||||
@if ERRORLEVEL 1 goto error
|
||||
|
||||
@echo --- Shaders built ok ---
|
||||
endlocal
|
||||
exit /b 0
|
||||
|
||||
@goto end
|
||||
:error
|
||||
@echo --- ERROR: Shader build failed ---
|
||||
exit /b 1
|
||||
|
||||
:needfxc
|
||||
echo ERROR: CompileShaders requires FXC.EXE
|
||||
exit /b 1
|
||||
:end
|
@ -203,7 +203,7 @@ namespace
|
||||
}
|
||||
|
||||
// Use Newton's Method to find local minima of sum-of-squares error.
|
||||
const auto fSteps = static_cast<float>(cSteps - 1);
|
||||
auto const 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);
|
||||
|
||||
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));
|
||||
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));
|
||||
|
||||
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
|
||||
const auto fSteps = static_cast<float>(uSteps - 1);
|
||||
auto const 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)
|
||||
|
@ -230,7 +230,7 @@ namespace DirectX
|
||||
}
|
||||
|
||||
// Use Newton's Method to find local minima of sum-of-squares error.
|
||||
const auto fSteps = static_cast<float>(cSteps - 1);
|
||||
auto const fSteps = static_cast<float>(cSteps - 1);
|
||||
|
||||
for (size_t iIteration = 0; iIteration < 8; iIteration++)
|
||||
{
|
||||
|
@ -593,7 +593,7 @@ namespace
|
||||
assert(uStartBit < 128);
|
||||
_Analysis_assume_(uStartBit < 128);
|
||||
const size_t uIndex = uStartBit >> 3;
|
||||
const auto ret = static_cast<uint8_t>((m_uBits[uIndex] >> (uStartBit - (uIndex << 3))) & 0x01);
|
||||
auto const ret = static_cast<uint8_t>((m_uBits[uIndex] >> (uStartBit - (uIndex << 3))) & 0x01);
|
||||
uStartBit++;
|
||||
return ret;
|
||||
}
|
||||
@ -1290,7 +1290,7 @@ namespace
|
||||
}
|
||||
|
||||
// Use Newton's Method to find local minima of sum-of-squares error.
|
||||
const auto fSteps = static_cast<float>(cSteps - 1);
|
||||
auto const fSteps = static_cast<float>(cSteps - 1);
|
||||
|
||||
for (size_t iIteration = 0; iIteration < 8; iIteration++)
|
||||
{
|
||||
@ -2048,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;
|
||||
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
|
||||
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
|
||||
INTColor aPalette[BC6H_MAX_INDICES];
|
||||
GeneratePaletteQuantized(pEP, endPts, aPalette);
|
||||
|
||||
@ -2264,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;
|
||||
const auto uNumIndices = static_cast<const uint8_t>(1u << ms_aInfo[pEP->uMode].uIndexPrec);
|
||||
auto const 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);
|
||||
@ -2437,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;
|
||||
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
|
||||
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
|
||||
assert(uNumIndices > 0);
|
||||
_Analysis_assume_(uNumIndices > 0);
|
||||
|
||||
@ -2473,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;
|
||||
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
|
||||
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
|
||||
INTColor aPalette[BC6H_MAX_INDICES];
|
||||
GeneratePaletteUnquantized(pEP, uRegion, aPalette);
|
||||
|
||||
@ -2577,7 +2577,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
|
||||
assert(uPartitions < BC7_MAX_REGIONS);
|
||||
_Analysis_assume_(uPartitions < BC7_MAX_REGIONS);
|
||||
|
||||
const auto uNumEndPts = static_cast<const uint8_t>((unsigned(uPartitions) + 1u) << 1);
|
||||
auto const 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;
|
||||
@ -3151,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;
|
||||
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
|
||||
const auto uNumIndices2 = static_cast<const uint8_t>(1u << uIndexPrec2);
|
||||
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
|
||||
auto const 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));
|
||||
@ -3505,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;
|
||||
const auto uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
|
||||
const auto uNumIndices2 = static_cast<const uint8_t>(1u << uIndexPrec2);
|
||||
auto const uNumIndices = static_cast<const uint8_t>(1u << uIndexPrec);
|
||||
auto const uNumIndices2 = static_cast<const uint8_t>(1u << uIndexPrec2);
|
||||
size_t auPixIdx[NUM_PIXELS_PER_BLOCK];
|
||||
LDRColorA aPalette[BC7_MAX_REGIONS][BC7_MAX_INDICES];
|
||||
|
||||
|
@ -101,7 +101,8 @@ GPUCompressBC::GPUCompressBC() noexcept :
|
||||
m_bc7_mode137(false),
|
||||
m_width(0),
|
||||
m_height(0)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
@ -263,7 +264,7 @@ HRESULT GPUCompressBC::Prepare(size_t width, size_t height, uint32_t flags, DXGI
|
||||
if (sizeInBytes >= UINT32_MAX)
|
||||
return HRESULT_E_ARITHMETIC_OVERFLOW;
|
||||
|
||||
const auto bufferSize = static_cast<size_t>(sizeInBytes);
|
||||
auto const bufferSize = static_cast<size_t>(sizeInBytes);
|
||||
|
||||
{
|
||||
D3D11_BUFFER_DESC desc = {};
|
||||
@ -458,7 +459,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);
|
||||
|
||||
const auto num_total_blocks = static_cast<UINT>(xblocks * yblocks);
|
||||
auto const num_total_blocks = static_cast<UINT>(xblocks * yblocks);
|
||||
UINT num_blocks = num_total_blocks;
|
||||
UINT start_block_id = 0;
|
||||
while (num_blocks > 0)
|
||||
|
@ -47,49 +47,32 @@ struct IWICImagingFactory;
|
||||
struct IWICMetadataQueryReader;
|
||||
#endif
|
||||
|
||||
#define DIRECTX_TEX_VERSION 208
|
||||
#define DIRECTX_TEX_VERSION 205
|
||||
|
||||
#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
|
||||
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;
|
||||
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 bool __cdecl HasAlpha(_In_ DXGI_FORMAT fmt) noexcept;
|
||||
bool __cdecl HasAlpha(_In_ DXGI_FORMAT fmt) noexcept;
|
||||
|
||||
DIRECTX_TEX_API size_t __cdecl BitsPerPixel(_In_ DXGI_FORMAT fmt) noexcept;
|
||||
size_t __cdecl BitsPerPixel(_In_ DXGI_FORMAT fmt) noexcept;
|
||||
|
||||
DIRECTX_TEX_API size_t __cdecl BitsPerColor(_In_ DXGI_FORMAT fmt) noexcept;
|
||||
size_t __cdecl BitsPerColor(_In_ DXGI_FORMAT fmt) noexcept;
|
||||
|
||||
DIRECTX_TEX_API size_t __cdecl BytesPerBlock(_In_ DXGI_FORMAT fmt) noexcept;
|
||||
|
||||
enum FORMAT_TYPE : uint32_t
|
||||
enum FORMAT_TYPE
|
||||
{
|
||||
FORMAT_TYPE_TYPELESS,
|
||||
FORMAT_TYPE_FLOAT,
|
||||
@ -99,9 +82,9 @@ namespace DirectX
|
||||
FORMAT_TYPE_SINT,
|
||||
};
|
||||
|
||||
DIRECTX_TEX_API FORMAT_TYPE __cdecl FormatDataType(_In_ DXGI_FORMAT fmt) noexcept;
|
||||
FORMAT_TYPE __cdecl FormatDataType(_In_ DXGI_FORMAT fmt) noexcept;
|
||||
|
||||
enum CP_FLAGS : uint32_t
|
||||
enum CP_FLAGS : unsigned long
|
||||
{
|
||||
CP_FLAGS_NONE = 0x0,
|
||||
// Normal operation
|
||||
@ -137,21 +120,21 @@ namespace DirectX
|
||||
// Don't allow pixel allocations in excess of 4GB (always true for 32-bit)
|
||||
};
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl ComputePitch(
|
||||
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;
|
||||
|
||||
DIRECTX_TEX_API size_t __cdecl ComputeScanlines(_In_ DXGI_FORMAT fmt, _In_ size_t height) noexcept;
|
||||
size_t __cdecl ComputeScanlines(_In_ DXGI_FORMAT fmt, _In_ size_t height) 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;
|
||||
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;
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
// Texture metadata
|
||||
enum TEX_DIMENSION : uint32_t
|
||||
enum TEX_DIMENSION
|
||||
// Subset here matches D3D10_RESOURCE_DIMENSION and D3D11_RESOURCE_DIMENSION
|
||||
{
|
||||
TEX_DIMENSION_TEXTURE1D = 2,
|
||||
@ -159,18 +142,18 @@ namespace DirectX
|
||||
TEX_DIMENSION_TEXTURE3D = 4,
|
||||
};
|
||||
|
||||
enum TEX_MISC_FLAG : uint32_t
|
||||
enum TEX_MISC_FLAG : unsigned long
|
||||
// Subset here matches D3D10_RESOURCE_MISC_FLAG and D3D11_RESOURCE_MISC_FLAG
|
||||
{
|
||||
TEX_MISC_TEXTURECUBE = 0x4L,
|
||||
};
|
||||
|
||||
enum TEX_MISC_FLAG2 : uint32_t
|
||||
enum TEX_MISC_FLAG2 : unsigned long
|
||||
{
|
||||
TEX_MISC2_ALPHA_MODE_MASK = 0x7L,
|
||||
};
|
||||
|
||||
enum TEX_ALPHA_MODE : uint32_t
|
||||
enum TEX_ALPHA_MODE
|
||||
// Matches DDS_ALPHA_MODE, encoded in MISC_FLAGS2
|
||||
{
|
||||
TEX_ALPHA_MODE_UNKNOWN = 0,
|
||||
@ -180,7 +163,7 @@ namespace DirectX
|
||||
TEX_ALPHA_MODE_CUSTOM = 4,
|
||||
};
|
||||
|
||||
struct DIRECTX_TEX_API TexMetadata
|
||||
struct TexMetadata
|
||||
{
|
||||
size_t width;
|
||||
size_t height; // Should be 1 for 1D textures
|
||||
@ -211,7 +194,7 @@ namespace DirectX
|
||||
// Returns size_t(-1) to indicate an out-of-range error
|
||||
};
|
||||
|
||||
struct DIRECTX_TEX_API DDSMetaData
|
||||
struct DDSMetaData
|
||||
{
|
||||
uint32_t size; // DDPIXELFORMAT.dwSize
|
||||
uint32_t flags; // DDPIXELFORMAT.dwFlags
|
||||
@ -225,7 +208,7 @@ namespace DirectX
|
||||
bool __cdecl IsDX10() const noexcept { return (fourCC == 0x30315844); }
|
||||
};
|
||||
|
||||
enum DDS_FLAGS : uint32_t
|
||||
enum DDS_FLAGS : unsigned long
|
||||
{
|
||||
DDS_FLAGS_NONE = 0x0,
|
||||
|
||||
@ -272,7 +255,7 @@ namespace DirectX
|
||||
// Enables the loader to read large dimension .dds files (i.e. greater than known hardware requirements)
|
||||
};
|
||||
|
||||
enum TGA_FLAGS : uint32_t
|
||||
enum TGA_FLAGS : unsigned long
|
||||
{
|
||||
TGA_FLAGS_NONE = 0x0,
|
||||
|
||||
@ -295,7 +278,7 @@ namespace DirectX
|
||||
// If no colorspace is specified in TGA 2.0 metadata, assume sRGB
|
||||
};
|
||||
|
||||
enum WIC_FLAGS : uint32_t
|
||||
enum WIC_FLAGS : unsigned long
|
||||
{
|
||||
WIC_FLAGS_NONE = 0x0,
|
||||
|
||||
@ -339,50 +322,50 @@ namespace DirectX
|
||||
// Filtering mode to use for any required image resizing (only needed when loading arrays of differently sized images; defaults to Fant)
|
||||
};
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSMemory(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl GetMetadataFromDDSMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_In_ DDS_FLAGS flags,
|
||||
_Out_ TexMetadata& metadata) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSFile(
|
||||
HRESULT __cdecl GetMetadataFromDDSFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_In_ DDS_FLAGS flags,
|
||||
_Out_ TexMetadata& metadata) noexcept;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSMemoryEx(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl GetMetadataFromDDSMemoryEx(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_In_ DDS_FLAGS flags,
|
||||
_Out_ TexMetadata& metadata,
|
||||
_Out_opt_ DDSMetaData* ddPixelFormat) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSFileEx(
|
||||
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,
|
||||
HRESULT __cdecl GetMetadataFromHDRMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_Out_ TexMetadata& metadata) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromHDRFile(
|
||||
HRESULT __cdecl GetMetadataFromHDRFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_Out_ TexMetadata& metadata) noexcept;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromTGAMemory(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl GetMetadataFromTGAMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_In_ TGA_FLAGS flags,
|
||||
_Out_ TexMetadata& metadata) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromTGAFile(
|
||||
HRESULT __cdecl GetMetadataFromTGAFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_In_ TGA_FLAGS flags,
|
||||
_Out_ TexMetadata& metadata) noexcept;
|
||||
|
||||
#ifdef _WIN32
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromWICMemory(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl GetMetadataFromWICMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_In_ WIC_FLAGS flags,
|
||||
_Out_ TexMetadata& metadata,
|
||||
_In_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromWICFile(
|
||||
HRESULT __cdecl GetMetadataFromWICFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_In_ WIC_FLAGS flags,
|
||||
_Out_ TexMetadata& metadata,
|
||||
@ -390,41 +373,13 @@ namespace DirectX
|
||||
#endif
|
||||
|
||||
// Compatability helpers
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromTGAMemory(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl GetMetadataFromTGAMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_Out_ TexMetadata& metadata) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromTGAFile(
|
||||
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
|
||||
@ -437,17 +392,13 @@ namespace DirectX
|
||||
uint8_t* pixels;
|
||||
};
|
||||
|
||||
class DIRECTX_TEX_API ScratchImage
|
||||
class 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;
|
||||
@ -492,7 +443,7 @@ namespace DirectX
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
// Memory blob (allocated buffer pointer is always 16-byte aligned)
|
||||
class DIRECTX_TEX_API Blob
|
||||
class Blob
|
||||
{
|
||||
public:
|
||||
Blob() noexcept : m_buffer(nullptr), m_size(0) {}
|
||||
@ -508,10 +459,7 @@ namespace DirectX
|
||||
|
||||
void __cdecl Release() noexcept;
|
||||
|
||||
uint8_t* __cdecl GetBufferPointer() const noexcept { return m_buffer; }
|
||||
|
||||
const uint8_t* __cdecl GetConstBufferPointer() const noexcept { return m_buffer; }
|
||||
|
||||
void *__cdecl GetBufferPointer() const noexcept { return m_buffer; }
|
||||
size_t __cdecl GetBufferSize() const noexcept { return m_size; }
|
||||
|
||||
HRESULT __cdecl Resize(size_t size) noexcept;
|
||||
@ -521,150 +469,105 @@ namespace DirectX
|
||||
// Shorten size without reallocation
|
||||
|
||||
private:
|
||||
uint8_t* m_buffer;
|
||||
void* 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
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSMemory(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl LoadFromDDSMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_In_ DDS_FLAGS flags,
|
||||
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSFile(
|
||||
HRESULT __cdecl LoadFromDDSFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_In_ DDS_FLAGS flags,
|
||||
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromDDSMemoryEx(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl LoadFromDDSMemoryEx(
|
||||
_In_reads_bytes_(size) const void* 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(
|
||||
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(
|
||||
HRESULT __cdecl SaveToDDSMemory(
|
||||
_In_ const Image& image,
|
||||
_In_ DDS_FLAGS flags,
|
||||
_Out_ Blob& blob) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl SaveToDDSMemory(
|
||||
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;
|
||||
|
||||
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(
|
||||
HRESULT __cdecl SaveToDDSFile(_In_ const Image& image, _In_ DDS_FLAGS flags, _In_z_ const wchar_t* szFile) noexcept;
|
||||
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
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromHDRMemory(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl LoadFromHDRMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromHDRFile(
|
||||
HRESULT __cdecl LoadFromHDRFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) 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;
|
||||
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;
|
||||
|
||||
// TGA operations
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromTGAMemory(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl LoadFromTGAMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_In_ TGA_FLAGS flags,
|
||||
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromTGAFile(
|
||||
HRESULT __cdecl LoadFromTGAFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_In_ TGA_FLAGS flags,
|
||||
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl SaveToTGAMemory(_In_ const Image& image,
|
||||
HRESULT __cdecl SaveToTGAMemory(_In_ const Image& image,
|
||||
_In_ TGA_FLAGS flags,
|
||||
_Out_ Blob& blob, _In_opt_ const TexMetadata* metadata = nullptr) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl SaveToTGAFile(_In_ const Image& image,
|
||||
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
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromWICMemory(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl LoadFromWICMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_In_ WIC_FLAGS flags,
|
||||
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image,
|
||||
_In_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromWICFile(
|
||||
HRESULT __cdecl LoadFromWICFile(
|
||||
_In_z_ const wchar_t* szFile, _In_ WIC_FLAGS flags,
|
||||
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image,
|
||||
_In_ std::function<void __cdecl(IWICMetadataQueryReader*)> getMQR = nullptr);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl SaveToWICMemory(
|
||||
HRESULT __cdecl SaveToWICMemory(
|
||||
_In_ const Image& image, _In_ WIC_FLAGS flags, _In_ REFGUID guidContainerFormat,
|
||||
_Out_ Blob& blob, _In_opt_ const GUID* targetFormat = nullptr,
|
||||
_In_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
|
||||
DIRECTX_TEX_API HRESULT __cdecl SaveToWICMemory(
|
||||
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_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl SaveToWICFile(
|
||||
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_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
|
||||
DIRECTX_TEX_API HRESULT __cdecl SaveToWICFile(
|
||||
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,
|
||||
@ -672,48 +575,20 @@ namespace DirectX
|
||||
#endif // WIN32
|
||||
|
||||
// Compatability helpers
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromTGAMemory(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
|
||||
HRESULT __cdecl LoadFromTGAMemory(
|
||||
_In_reads_bytes_(size) const void* pSource, _In_ size_t size,
|
||||
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl LoadFromTGAFile(
|
||||
HRESULT __cdecl LoadFromTGAFile(
|
||||
_In_z_ const wchar_t* szFile,
|
||||
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) 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
|
||||
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;
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
// Texture conversion, resizing, mipmap generation, and block compression
|
||||
|
||||
enum TEX_FR_FLAGS : uint32_t
|
||||
enum TEX_FR_FLAGS : unsigned long
|
||||
{
|
||||
TEX_FR_ROTATE0 = 0x0,
|
||||
TEX_FR_ROTATE90 = 0x1,
|
||||
@ -724,14 +599,14 @@ namespace DirectX
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
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(
|
||||
HRESULT __cdecl FlipRotate(_In_ const Image& srcImage, _In_ TEX_FR_FLAGS flags, _Out_ ScratchImage& image) noexcept;
|
||||
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 : uint32_t
|
||||
enum TEX_FILTER_FLAGS : unsigned long
|
||||
{
|
||||
TEX_FILTER_DEFAULT = 0,
|
||||
|
||||
@ -785,15 +660,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 uint32_t TEX_FILTER_DITHER_MASK = 0xF0000;
|
||||
constexpr uint32_t TEX_FILTER_MODE_MASK = 0xF00000;
|
||||
constexpr uint32_t TEX_FILTER_SRGB_MASK = 0xF000000;
|
||||
constexpr unsigned long TEX_FILTER_DITHER_MASK = 0xF0000;
|
||||
constexpr unsigned long TEX_FILTER_MODE_MASK = 0xF00000;
|
||||
constexpr unsigned long TEX_FILTER_SRGB_MASK = 0xF000000;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl Resize(
|
||||
HRESULT __cdecl Resize(
|
||||
_In_ const Image& srcImage, _In_ size_t width, _In_ size_t height,
|
||||
_In_ TEX_FILTER_FLAGS filter,
|
||||
_Out_ ScratchImage& image) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl Resize(
|
||||
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.
|
||||
@ -808,53 +683,53 @@ namespace DirectX
|
||||
float threshold;
|
||||
};
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl Convert(
|
||||
HRESULT __cdecl Convert(
|
||||
_In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ TEX_FILTER_FLAGS filter, _In_ float threshold,
|
||||
_Out_ ScratchImage& image) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl Convert(
|
||||
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(
|
||||
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(
|
||||
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
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl ConvertToSinglePlane(_In_ const Image& srcImage, _Out_ ScratchImage& image) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl ConvertToSinglePlane(
|
||||
HRESULT __cdecl ConvertToSinglePlane(_In_ const Image& srcImage, _Out_ ScratchImage& image) noexcept;
|
||||
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
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl GenerateMipMaps(
|
||||
HRESULT __cdecl GenerateMipMaps(
|
||||
_In_ const Image& baseImage, _In_ TEX_FILTER_FLAGS filter, _In_ size_t levels,
|
||||
_Inout_ ScratchImage& mipChain, _In_ bool allow1D = false) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl GenerateMipMaps(
|
||||
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
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl GenerateMipMaps3D(
|
||||
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;
|
||||
DIRECTX_TEX_API HRESULT __cdecl GenerateMipMaps3D(
|
||||
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
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl ScaleMipMapsAlphaForCoverage(
|
||||
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 : uint32_t
|
||||
enum TEX_PMALPHA_FLAGS : unsigned long
|
||||
{
|
||||
TEX_PMALPHA_DEFAULT = 0,
|
||||
|
||||
@ -871,13 +746,13 @@ namespace DirectX
|
||||
// if the output format type is IsSRGB(), then SRGB_OUT is on by default
|
||||
};
|
||||
|
||||
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(
|
||||
HRESULT __cdecl PremultiplyAlpha(_In_ const Image& srcImage, _In_ TEX_PMALPHA_FLAGS flags, _Out_ ScratchImage& image) noexcept;
|
||||
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 : uint32_t
|
||||
enum TEX_COMPRESS_FLAGS : unsigned long
|
||||
{
|
||||
TEX_COMPRESS_DEFAULT = 0,
|
||||
|
||||
@ -919,51 +794,51 @@ namespace DirectX
|
||||
float alphaWeight;
|
||||
};
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl Compress(
|
||||
HRESULT __cdecl Compress(
|
||||
_In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ TEX_COMPRESS_FLAGS compress, _In_ float threshold,
|
||||
_Out_ ScratchImage& cImage) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl Compress(
|
||||
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(
|
||||
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(
|
||||
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__)
|
||||
DIRECTX_TEX_API HRESULT __cdecl Compress(
|
||||
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;
|
||||
DIRECTX_TEX_API HRESULT __cdecl Compress(
|
||||
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(
|
||||
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(
|
||||
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
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl Decompress(_In_ const Image& cImage, _In_ DXGI_FORMAT format, _Out_ ScratchImage& image) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl Decompress(
|
||||
HRESULT __cdecl Decompress(_In_ const Image& cImage, _In_ DXGI_FORMAT format, _Out_ ScratchImage& image) noexcept;
|
||||
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 : uint32_t
|
||||
enum CNMAP_FLAGS : unsigned long
|
||||
{
|
||||
CNMAP_DEFAULT = 0,
|
||||
|
||||
@ -987,17 +862,17 @@ namespace DirectX
|
||||
// Computes a crude occlusion term stored in the alpha channel
|
||||
};
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl ComputeNormalMap(
|
||||
HRESULT __cdecl ComputeNormalMap(
|
||||
_In_ const Image& srcImage, _In_ CNMAP_FLAGS flags, _In_ float amplitude,
|
||||
_In_ DXGI_FORMAT format, _Out_ ScratchImage& normalMap) noexcept;
|
||||
DIRECTX_TEX_API HRESULT __cdecl ComputeNormalMap(
|
||||
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 DIRECTX_TEX_API Rect
|
||||
struct Rect
|
||||
{
|
||||
size_t x;
|
||||
size_t y;
|
||||
@ -1008,11 +883,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) {}
|
||||
};
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl CopyRectangle(
|
||||
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 : uint32_t
|
||||
enum CMSE_FLAGS : unsigned long
|
||||
{
|
||||
CMSE_DEFAULT = 0,
|
||||
|
||||
@ -1031,21 +906,21 @@ namespace DirectX
|
||||
// Indicates that image should be scaled and biased before comparison (i.e. UNORM -> SNORM)
|
||||
};
|
||||
|
||||
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 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 EvaluateImage(
|
||||
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);
|
||||
DIRECTX_TEX_API HRESULT __cdecl EvaluateImage(
|
||||
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);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl TransformImage(
|
||||
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);
|
||||
DIRECTX_TEX_API HRESULT __cdecl TransformImage(
|
||||
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,
|
||||
@ -1054,7 +929,7 @@ namespace DirectX
|
||||
//---------------------------------------------------------------------------------
|
||||
// WIC utility code
|
||||
#ifdef _WIN32
|
||||
enum WICCodecs : uint32_t
|
||||
enum WICCodecs
|
||||
{
|
||||
WIC_CODEC_BMP = 1, // Windows Bitmap (.bmp)
|
||||
WIC_CODEC_JPEG, // Joint Photographic Experts Group (.jpg, .jpeg)
|
||||
@ -1066,31 +941,19 @@ namespace DirectX
|
||||
WIC_CODEC_HEIF, // High Efficiency Image File (.heif, .heic)
|
||||
};
|
||||
|
||||
DIRECTX_TEX_API REFGUID __cdecl GetWICCodec(_In_ WICCodecs codec) noexcept;
|
||||
REFGUID __cdecl GetWICCodec(_In_ WICCodecs codec) noexcept;
|
||||
|
||||
DIRECTX_TEX_API IWICImagingFactory* __cdecl GetWICFactory(bool& iswic2) noexcept;
|
||||
DIRECTX_TEX_API void __cdecl SetWICFactory(_In_opt_ IWICImagingFactory* pWIC) noexcept;
|
||||
IWICImagingFactory* __cdecl GetWICFactory(bool& iswic2) noexcept;
|
||||
void __cdecl SetWICFactory(_In_opt_ IWICImagingFactory* pWIC) noexcept;
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
// DDS helper functions
|
||||
DIRECTX_TEX_API HRESULT __cdecl EncodeDDSHeader(
|
||||
HRESULT __cdecl EncodeDDSHeader(
|
||||
_In_ const TexMetadata& metadata, DDS_FLAGS flags,
|
||||
_Out_writes_bytes_to_opt_(maxsize, required) uint8_t* pDestination, _In_ size_t maxsize,
|
||||
_Out_writes_bytes_to_opt_(maxsize, required) void* 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
|
||||
|
||||
@ -1103,48 +966,48 @@ namespace DirectX
|
||||
|
||||
// Direct3D 11 functions
|
||||
#if defined(__d3d11_h__) || defined(__d3d11_x_h__)
|
||||
DIRECTX_TEX_API bool __cdecl IsSupportedTexture(_In_ ID3D11Device* pDevice, _In_ const TexMetadata& metadata) noexcept;
|
||||
bool __cdecl IsSupportedTexture(_In_ ID3D11Device* pDevice, _In_ const TexMetadata& metadata) noexcept;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl CreateTexture(
|
||||
HRESULT __cdecl CreateTexture(
|
||||
_In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
|
||||
_Outptr_ ID3D11Resource** ppResource) noexcept;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl CreateShaderResourceView(
|
||||
HRESULT __cdecl CreateShaderResourceView(
|
||||
_In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
|
||||
_Outptr_ ID3D11ShaderResourceView** ppSRV) noexcept;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl CreateTextureEx(
|
||||
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;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl CreateShaderResourceViewEx(
|
||||
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;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl CaptureTexture(_In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource* pSource, _Out_ ScratchImage& result) noexcept;
|
||||
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__)
|
||||
DIRECTX_TEX_API bool __cdecl IsSupportedTexture(_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata) noexcept;
|
||||
bool __cdecl IsSupportedTexture(_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata) noexcept;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl CreateTexture(
|
||||
HRESULT __cdecl CreateTexture(
|
||||
_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata,
|
||||
_Outptr_ ID3D12Resource** ppResource) noexcept;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl CreateTextureEx(
|
||||
HRESULT __cdecl CreateTextureEx(
|
||||
_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata,
|
||||
_In_ D3D12_RESOURCE_FLAGS resFlags, _In_ CREATETEX_FLAGS flags,
|
||||
_Outptr_ ID3D12Resource** ppResource) noexcept;
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl PrepareUpload(
|
||||
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);
|
||||
|
||||
DIRECTX_TEX_API HRESULT __cdecl CaptureTexture(
|
||||
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,
|
||||
|
@ -14,12 +14,6 @@
|
||||
//=====================================================================================
|
||||
// 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);
|
||||
@ -32,21 +26,17 @@ 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<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)); }
|
||||
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)); }
|
||||
|
||||
// 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<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)); }
|
||||
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)); }
|
||||
|
||||
// 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<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)); }
|
||||
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)); }
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
@ -166,7 +156,7 @@ inline HRESULT __cdecl SaveToDDSFile(const Image& image, DDS_FLAGS flags, const
|
||||
// Compatability helpers
|
||||
//=====================================================================================
|
||||
_Use_decl_annotations_
|
||||
inline HRESULT __cdecl GetMetadataFromTGAMemory(const uint8_t* pSource, size_t size, TexMetadata& metadata) noexcept
|
||||
inline HRESULT __cdecl GetMetadataFromTGAMemory(const void* pSource, size_t size, TexMetadata& metadata) noexcept
|
||||
{
|
||||
return GetMetadataFromTGAMemory(pSource, size, TGA_FLAGS_NONE, metadata);
|
||||
}
|
||||
@ -178,7 +168,7 @@ inline HRESULT __cdecl GetMetadataFromTGAFile(const wchar_t* szFile, TexMetadata
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
inline HRESULT __cdecl LoadFromTGAMemory(const uint8_t* pSource, size_t size, TexMetadata* metadata, ScratchImage& image) noexcept
|
||||
inline HRESULT __cdecl LoadFromTGAMemory(const void* pSource, size_t size, TexMetadata* metadata, ScratchImage& image) noexcept
|
||||
{
|
||||
return LoadFromTGAMemory(pSource, size, TGA_FLAGS_NONE, metadata, image);
|
||||
}
|
||||
@ -200,85 +190,3 @@ 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
|
||||
|
@ -172,7 +172,7 @@ namespace
|
||||
ScratchImage image;
|
||||
HRESULT hr = E_UNEXPECTED;
|
||||
|
||||
const auto srgb = GetSRGBFlags(compress);
|
||||
auto const srgb = GetSRGBFlags(compress);
|
||||
|
||||
switch (tformat)
|
||||
{
|
||||
@ -261,9 +261,6 @@ HRESULT DirectX::CompressEx(
|
||||
|| 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)
|
||||
|
@ -983,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))
|
||||
{
|
||||
const auto d = static_cast<float>(*sPtr & 0xFFFFFF) / 16777215.f;
|
||||
const auto s = static_cast<float>((*sPtr & 0xFF000000) >> 24);
|
||||
auto const d = static_cast<float>(*sPtr & 0xFFFFFF) / 16777215.f;
|
||||
auto const s = static_cast<float>((*sPtr & 0xFF000000) >> 24);
|
||||
++sPtr;
|
||||
if (dPtr >= ePtr) break;
|
||||
*(dPtr++) = XMVectorSet(d, s, 0.f, 1.f);
|
||||
@ -999,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))
|
||||
{
|
||||
const auto r = static_cast<float>(*sPtr & 0xFFFFFF) / 16777215.f;
|
||||
auto const 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);
|
||||
@ -1014,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))
|
||||
{
|
||||
const auto g = static_cast<float>((*sPtr & 0xFF000000) >> 24);
|
||||
auto const 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);
|
||||
@ -1344,9 +1344,9 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
|
||||
// G = 1.1678Y' - 0.3929Cb' - 0.8152Cr'
|
||||
// B = 1.1678Y' + 2.0232Cb'
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
if (dPtr >= ePtr) break;
|
||||
*(dPtr++) = XMVectorSet(float(std::min<int>(std::max<int>(r, 0), 1023)) / 1023.f,
|
||||
@ -1367,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;
|
||||
const auto a = static_cast<int>(sPtr->w);
|
||||
auto const a = static_cast<int>(sPtr->w);
|
||||
++sPtr;
|
||||
|
||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/bb970578.aspx
|
||||
@ -1380,9 +1380,9 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
|
||||
// G = 1.1689Y' - 0.3933Cb' - 0.8160Cr'
|
||||
// B = 1.1689Y'+ 2.0251Cb'
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
if (dPtr >= ePtr) break;
|
||||
*(dPtr++) = XMVectorSet(float(std::min<int>(std::max<int>(r, 0), 65535)) / 65535.f,
|
||||
@ -4716,7 +4716,7 @@ namespace
|
||||
filter &= ~(TEX_FILTER_SRGB_IN | TEX_FILTER_SRGB_OUT);
|
||||
}
|
||||
|
||||
const auto wicsrgb = CheckWICColorSpace(pfGUID, targetGUID);
|
||||
auto const wicsrgb = CheckWICColorSpace(pfGUID, targetGUID);
|
||||
|
||||
if (wicsrgb != (filter & (TEX_FILTER_SRGB_IN | TEX_FILTER_SRGB_OUT)))
|
||||
{
|
||||
@ -4943,7 +4943,7 @@ namespace
|
||||
{\
|
||||
const size_t rowPitch = srcImage.rowPitch;\
|
||||
\
|
||||
const auto sourceE = reinterpret_cast<const srcType*>(pSrc + srcImage.slicePitch);\
|
||||
auto const sourceE = reinterpret_cast<const srcType*>(pSrc + srcImage.slicePitch);\
|
||||
auto pSrcUV = pSrc + (srcImage.height * rowPitch);\
|
||||
\
|
||||
for(size_t y = 0; y < srcImage.height; y+= 2)\
|
||||
|
@ -217,11 +217,8 @@ 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;
|
||||
@ -233,7 +230,7 @@ namespace
|
||||
&defaultHeapProperties,
|
||||
D3D12_HEAP_FLAG_NONE,
|
||||
&descCopy,
|
||||
D3D12_RESOURCE_STATE_RESOLVE_DEST,
|
||||
D3D12_RESOURCE_STATE_COPY_DEST,
|
||||
nullptr,
|
||||
IID_GRAPHICS_PPV_ARGS(pTemp.GetAddressOf()));
|
||||
if (FAILED(hr))
|
||||
@ -270,11 +267,6 @@ namespace
|
||||
}
|
||||
|
||||
copySource = pTemp;
|
||||
beforeState = D3D12_RESOURCE_STATE_RESOLVE_DEST;
|
||||
}
|
||||
else
|
||||
{
|
||||
beforeStateSource = D3D12_RESOURCE_STATE_COPY_SOURCE;
|
||||
}
|
||||
|
||||
// Create a staging texture
|
||||
@ -291,7 +283,7 @@ namespace
|
||||
assert(*pStaging);
|
||||
|
||||
// Transition the resource if necessary
|
||||
TransitionResource(commandList.Get(), copySource.Get(), beforeState, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
||||
TransitionResource(commandList.Get(), pSource, beforeState, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
||||
|
||||
// Get the copy target location
|
||||
for (UINT j = 0; j < numberOfResources; ++j)
|
||||
@ -301,8 +293,8 @@ namespace
|
||||
commandList->CopyTextureRegion(©Dest, 0, 0, 0, ©Src, nullptr);
|
||||
}
|
||||
|
||||
// Transition the source resource to the next state
|
||||
TransitionResource(commandList.Get(), pSource, beforeStateSource, afterState);
|
||||
// Transition the resource to the next state
|
||||
TransitionResource(commandList.Get(), pSource, D3D12_RESOURCE_STATE_COPY_SOURCE, afterState);
|
||||
|
||||
hr = commandList->Close();
|
||||
if (FAILED(hr))
|
||||
@ -738,10 +730,10 @@ HRESULT DirectX::CaptureTexture(
|
||||
pCommandQueue->GetDevice(IID_GRAPHICS_PPV_ARGS(device.GetAddressOf()));
|
||||
|
||||
#if defined(_MSC_VER) || !defined(_WIN32)
|
||||
const auto desc = pSource->GetDesc();
|
||||
auto const desc = pSource->GetDesc();
|
||||
#else
|
||||
D3D12_RESOURCE_DESC tmpDesc;
|
||||
const auto& desc = *pSource->GetDesc(&tmpDesc);
|
||||
auto const& desc = *pSource->GetDesc(&tmpDesc);
|
||||
#endif
|
||||
|
||||
ComPtr<ID3D12Resource> pStaging;
|
||||
|
@ -105,18 +105,19 @@ namespace
|
||||
{ DXGI_FORMAT_R10G10B10A2_UNORM, CONV_FLAGS_SWIZZLE, DDSPF_A2R10G10B10 }, // D3DFMT_A2R10G10B10 (D3DX reversal issue)
|
||||
{ DXGI_FORMAT_R10G10B10A2_UNORM, CONV_FLAGS_NONE, DDSPF_A2B10G10R10 }, // D3DFMT_A2B10G10R10 (D3DX reversal issue)
|
||||
|
||||
{ DXGI_FORMAT_R8G8B8A8_UNORM, CONV_FLAGS_EXPAND | CONV_FLAGS_NOALPHA | CONV_FLAGS_888,
|
||||
DDSPF_R8G8B8 }, // D3DFMT_R8G8B8
|
||||
{ DXGI_FORMAT_R8G8B8A8_UNORM, CONV_FLAGS_EXPAND
|
||||
| CONV_FLAGS_NOALPHA
|
||||
| CONV_FLAGS_888, DDSPF_R8G8B8 }, // D3DFMT_R8G8B8
|
||||
|
||||
{ DXGI_FORMAT_B5G6R5_UNORM, CONV_FLAGS_565, DDSPF_R5G6B5 }, // D3DFMT_R5G6B5
|
||||
{ DXGI_FORMAT_B5G5R5A1_UNORM, CONV_FLAGS_5551, DDSPF_A1R5G5B5 }, // D3DFMT_A1R5G5B5
|
||||
{ DXGI_FORMAT_B5G5R5A1_UNORM, CONV_FLAGS_5551 | CONV_FLAGS_NOALPHA,
|
||||
DDSPF_X1R5G5B5 }, // D3DFMT_X1R5G5B5
|
||||
{ DXGI_FORMAT_B5G5R5A1_UNORM, CONV_FLAGS_5551
|
||||
| CONV_FLAGS_NOALPHA, DDSPF_X1R5G5B5 }, // D3DFMT_X1R5G5B5
|
||||
|
||||
{ DXGI_FORMAT_R8G8B8A8_UNORM, CONV_FLAGS_EXPAND | CONV_FLAGS_8332,
|
||||
DDSPF_A8R3G3B2 }, // D3DFMT_A8R3G3B2
|
||||
{ DXGI_FORMAT_B5G6R5_UNORM, CONV_FLAGS_EXPAND | CONV_FLAGS_332,
|
||||
DDSPF_R3G3B2 }, // D3DFMT_R3G3B2
|
||||
{ DXGI_FORMAT_R8G8B8A8_UNORM, CONV_FLAGS_EXPAND
|
||||
| CONV_FLAGS_8332, DDSPF_A8R3G3B2 }, // D3DFMT_A8R3G3B2
|
||||
{ DXGI_FORMAT_B5G6R5_UNORM, CONV_FLAGS_EXPAND
|
||||
| CONV_FLAGS_332, DDSPF_R3G3B2 }, // D3DFMT_R3G3B2
|
||||
|
||||
{ DXGI_FORMAT_R8_UNORM, CONV_FLAGS_NONE, DDSPF_L8 }, // D3DFMT_L8
|
||||
{ DXGI_FORMAT_R16_UNORM, CONV_FLAGS_NONE, DDSPF_L16 }, // D3DFMT_L16
|
||||
@ -141,16 +142,17 @@ namespace
|
||||
|
||||
{ DXGI_FORMAT_R32_FLOAT, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 32, 0xffffffff, 0, 0, 0 } }, // D3DFMT_R32F (D3DX uses FourCC 114 instead)
|
||||
|
||||
{ DXGI_FORMAT_R8G8B8A8_UNORM, CONV_FLAGS_EXPAND | CONV_FLAGS_PAL8 | CONV_FLAGS_A8P8,
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_PAL8A, 0, 16, 0, 0, 0, 0xff00 } }, // D3DFMT_A8P8
|
||||
{ DXGI_FORMAT_R8G8B8A8_UNORM, CONV_FLAGS_EXPAND | CONV_FLAGS_PAL8,
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_PAL8, 0, 8, 0, 0, 0, 0 } }, // D3DFMT_P8
|
||||
{ DXGI_FORMAT_R8G8B8A8_UNORM, CONV_FLAGS_EXPAND
|
||||
| CONV_FLAGS_PAL8
|
||||
| CONV_FLAGS_A8P8, { sizeof(DDS_PIXELFORMAT), DDS_PAL8A, 0, 16, 0, 0, 0, 0xff00 } }, // D3DFMT_A8P8
|
||||
{ DXGI_FORMAT_R8G8B8A8_UNORM, CONV_FLAGS_EXPAND
|
||||
| CONV_FLAGS_PAL8, { sizeof(DDS_PIXELFORMAT), DDS_PAL8, 0, 8, 0, 0, 0, 0 } }, // D3DFMT_P8
|
||||
|
||||
{ DXGI_FORMAT_B4G4R4A4_UNORM, CONV_FLAGS_4444, DDSPF_A4R4G4B4 }, // D3DFMT_A4R4G4B4 (uses DXGI 1.2 format)
|
||||
{ DXGI_FORMAT_B4G4R4A4_UNORM, CONV_FLAGS_NOALPHA | CONV_FLAGS_4444,
|
||||
DDSPF_X4R4G4B4 }, // D3DFMT_X4R4G4B4 (uses DXGI 1.2 format)
|
||||
{ DXGI_FORMAT_B4G4R4A4_UNORM, CONV_FLAGS_EXPAND | CONV_FLAGS_44,
|
||||
DDSPF_A4L4 }, // D3DFMT_A4L4 (uses DXGI 1.2 format)
|
||||
{ DXGI_FORMAT_B4G4R4A4_UNORM, CONV_FLAGS_NOALPHA
|
||||
| CONV_FLAGS_4444, DDSPF_X4R4G4B4 }, // D3DFMT_X4R4G4B4 (uses DXGI 1.2 format)
|
||||
{ DXGI_FORMAT_B4G4R4A4_UNORM, CONV_FLAGS_EXPAND
|
||||
| CONV_FLAGS_44, DDSPF_A4L4 }, // D3DFMT_A4L4 (uses DXGI 1.2 format)
|
||||
|
||||
{ DXGI_FORMAT_YUY2, CONV_FLAGS_NONE, DDSPF_YUY2 }, // D3DFMT_YUY2 (uses DXGI 1.2 format)
|
||||
{ DXGI_FORMAT_YUY2, CONV_FLAGS_SWIZZLE, DDSPF_UYVY }, // D3DFMT_UYVY (uses DXGI 1.2 format)
|
||||
@ -159,8 +161,8 @@ namespace
|
||||
{ DXGI_FORMAT_R8G8B8A8_SNORM, CONV_FLAGS_NONE, DDSPF_Q8W8V8U8 }, // D3DFMT_Q8W8V8U8
|
||||
{ DXGI_FORMAT_R16G16_SNORM, CONV_FLAGS_NONE, DDSPF_V16U16 }, // D3DFMT_V16U16
|
||||
|
||||
{ DXGI_FORMAT_R8G8B8A8_UNORM, CONV_FLAGS_L6V5U5 | CONV_FLAGS_EXPAND,
|
||||
DDSPF_L6V5U5 }, // D3DFMT_L6V5U5
|
||||
{ DXGI_FORMAT_R8G8B8A8_UNORM, CONV_FLAGS_L6V5U5
|
||||
| CONV_FLAGS_EXPAND, DDSPF_L6V5U5 }, // D3DFMT_L6V5U5
|
||||
{ DXGI_FORMAT_R8G8B8A8_UNORM, CONV_FLAGS_L8U8V8, DDSPF_X8L8V8U8 }, // D3DFMT_X8L8V8U8
|
||||
{ DXGI_FORMAT_R10G10B10A2_UNORM, CONV_FLAGS_WUV10, DDSPF_A2W10V10U10 }, // D3DFMT_A2W10V10U10
|
||||
};
|
||||
@ -339,7 +341,7 @@ namespace
|
||||
}
|
||||
|
||||
// DDS files always start with the same magic number ("DDS ")
|
||||
const auto dwMagicNumber = *static_cast<const uint32_t*>(pSource);
|
||||
auto const dwMagicNumber = *static_cast<const uint32_t*>(pSource);
|
||||
if (dwMagicNumber != DDS_MAGIC)
|
||||
{
|
||||
return E_FAIL;
|
||||
@ -376,7 +378,7 @@ namespace
|
||||
}
|
||||
|
||||
metadata.mipLevels = pHeader->mipMapCount;
|
||||
if (metadata.mipLevels == 0)
|
||||
if ((metadata.mipLevels == 0) || (flags & DDS_FLAGS_IGNORE_MIPS))
|
||||
{
|
||||
metadata.mipLevels = 1;
|
||||
}
|
||||
@ -648,12 +650,6 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
// Special-handling flag for ignoring mipchains on simple DDS files
|
||||
if ((flags & DDS_FLAGS_IGNORE_MIPS) && (metadata.arraySize == 1))
|
||||
{
|
||||
metadata.mipLevels = 1;
|
||||
}
|
||||
|
||||
// Handle DDS-specific metadata
|
||||
if (ddPixelFormat)
|
||||
{
|
||||
@ -679,7 +675,7 @@ _Use_decl_annotations_
|
||||
HRESULT DirectX::EncodeDDSHeader(
|
||||
const TexMetadata& metadata,
|
||||
DDS_FLAGS flags,
|
||||
uint8_t* pDestination,
|
||||
void* pDestination,
|
||||
size_t maxsize,
|
||||
size_t& required) noexcept
|
||||
{
|
||||
@ -855,7 +851,7 @@ HRESULT DirectX::EncodeDDSHeader(
|
||||
if (maxsize < required)
|
||||
return E_NOT_SUFFICIENT_BUFFER;
|
||||
|
||||
*reinterpret_cast<uint32_t*>(pDestination) = DDS_MAGIC;
|
||||
*static_cast<uint32_t*>(pDestination) = DDS_MAGIC;
|
||||
|
||||
auto header = reinterpret_cast<DDS_HEADER*>(static_cast<uint8_t*>(pDestination) + sizeof(uint32_t));
|
||||
assert(header);
|
||||
@ -1839,7 +1835,7 @@ namespace
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::GetMetadataFromDDSMemory(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
DDS_FLAGS flags,
|
||||
TexMetadata& metadata) noexcept
|
||||
@ -1849,7 +1845,7 @@ HRESULT DirectX::GetMetadataFromDDSMemory(
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::GetMetadataFromDDSMemoryEx(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
DDS_FLAGS flags,
|
||||
TexMetadata& metadata,
|
||||
@ -1882,10 +1878,12 @@ HRESULT DirectX::GetMetadataFromDDSFileEx(
|
||||
return E_INVALIDARG;
|
||||
|
||||
#ifdef _WIN32
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
|
||||
nullptr)));
|
||||
#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());
|
||||
@ -1940,9 +1938,9 @@ HRESULT DirectX::GetMetadataFromDDSFileEx(
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
|
||||
const auto headerLen = static_cast<size_t>(bytesRead);
|
||||
auto const headerLen = static_cast<size_t>(bytesRead);
|
||||
#else
|
||||
const auto headerLen = std::min<size_t>(len, DDS_DX10_HEADER_SIZE);
|
||||
auto const headerLen = std::min<size_t>(len, DDS_DX10_HEADER_SIZE);
|
||||
|
||||
inFile.read(reinterpret_cast<char*>(header), headerLen);
|
||||
if (!inFile)
|
||||
@ -1959,7 +1957,7 @@ HRESULT DirectX::GetMetadataFromDDSFileEx(
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::LoadFromDDSMemory(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
DDS_FLAGS flags,
|
||||
TexMetadata* metadata,
|
||||
@ -1970,7 +1968,7 @@ HRESULT DirectX::LoadFromDDSMemory(
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::LoadFromDDSMemoryEx(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
DDS_FLAGS flags,
|
||||
TexMetadata* metadata,
|
||||
@ -2004,36 +2002,10 @@ HRESULT DirectX::LoadFromDDSMemoryEx(
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
size_t remaining = size - offset;
|
||||
if (remaining == 0)
|
||||
return E_FAIL;
|
||||
|
||||
hr = image.Initialize(mdata);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if (flags & DDS_FLAGS_PERMISSIVE)
|
||||
{
|
||||
// For cubemaps, DDS_HEADER_DXT10.arraySize is supposed to be 'number of cubes'.
|
||||
// This handles cases where the value is incorrectly written as the original 6*numCubes value.
|
||||
if ((mdata.miscFlags & TEX_MISC_TEXTURECUBE)
|
||||
&& (convFlags & CONV_FLAGS_DX10)
|
||||
&& (image.GetPixelsSize() > remaining)
|
||||
&& ((mdata.arraySize % 6) == 0))
|
||||
{
|
||||
mdata.arraySize = mdata.arraySize / 6;
|
||||
hr = image.Initialize(mdata);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if (image.GetPixelsSize() > remaining)
|
||||
{
|
||||
image.Release();
|
||||
return HRESULT_E_HANDLE_EOF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CP_FLAGS cflags = CP_FLAGS_NONE;
|
||||
if (flags & DDS_FLAGS_LEGACY_DWORD)
|
||||
{
|
||||
@ -2092,10 +2064,12 @@ HRESULT DirectX::LoadFromDDSFileEx(
|
||||
image.Release();
|
||||
|
||||
#ifdef _WIN32
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
|
||||
nullptr)));
|
||||
#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());
|
||||
@ -2148,9 +2122,9 @@ HRESULT DirectX::LoadFromDDSFileEx(
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
|
||||
const auto headerLen = static_cast<size_t>(bytesRead);
|
||||
auto const headerLen = static_cast<size_t>(bytesRead);
|
||||
#else
|
||||
const auto headerLen = std::min<size_t>(len, DDS_DX10_HEADER_SIZE);
|
||||
auto const headerLen = std::min<size_t>(len, DDS_DX10_HEADER_SIZE);
|
||||
|
||||
inFile.read(reinterpret_cast<char*>(header), headerLen);
|
||||
if (!inFile)
|
||||
@ -2219,28 +2193,6 @@ HRESULT DirectX::LoadFromDDSFileEx(
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if (flags & DDS_FLAGS_PERMISSIVE)
|
||||
{
|
||||
// For cubemaps, DDS_HEADER_DXT10.arraySize is supposed to be 'number of cubes'.
|
||||
// This handles cases where the value is incorrectly written as the original 6*numCubes value.
|
||||
if ((mdata.miscFlags & TEX_MISC_TEXTURECUBE)
|
||||
&& (convFlags & CONV_FLAGS_DX10)
|
||||
&& (image.GetPixelsSize() > remaining)
|
||||
&& ((mdata.arraySize % 6) == 0))
|
||||
{
|
||||
mdata.arraySize = mdata.arraySize / 6;
|
||||
hr = image.Initialize(mdata);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if (image.GetPixelsSize() > remaining)
|
||||
{
|
||||
image.Release();
|
||||
return HRESULT_E_HANDLE_EOF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((convFlags & CONV_FLAGS_EXPAND) || (flags & (DDS_FLAGS_LEGACY_DWORD | DDS_FLAGS_BAD_DXTN_TAILS)))
|
||||
{
|
||||
std::unique_ptr<uint8_t[]> temp(new (std::nothrow) uint8_t[remaining]);
|
||||
@ -2309,7 +2261,7 @@ HRESULT DirectX::LoadFromDDSFileEx(
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
const auto pixelBytes = static_cast<DWORD>(image.GetPixelsSize());
|
||||
auto const pixelBytes = static_cast<DWORD>(image.GetPixelsSize());
|
||||
if (!ReadFile(hFile.get(), image.GetPixels(), pixelBytes, &bytesRead, nullptr))
|
||||
{
|
||||
image.Release();
|
||||
@ -2403,7 +2355,7 @@ HRESULT DirectX::SaveToDDSMemory(
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
auto pDestination = blob.GetBufferPointer();
|
||||
auto pDestination = static_cast<uint8_t*>(blob.GetBufferPointer());
|
||||
assert(pDestination);
|
||||
|
||||
hr = EncodeDDSHeader(metadata, flags, pDestination, blob.GetBufferSize(), required);
|
||||
@ -2416,7 +2368,7 @@ HRESULT DirectX::SaveToDDSMemory(
|
||||
size_t remaining = blob.GetBufferSize() - required;
|
||||
pDestination += required;
|
||||
|
||||
if (remaining == 0)
|
||||
if (!remaining)
|
||||
{
|
||||
blob.Release();
|
||||
return E_FAIL;
|
||||
@ -2596,9 +2548,13 @@ HRESULT DirectX::SaveToDDSFile(
|
||||
|
||||
// Create file and write header
|
||||
#ifdef _WIN32
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(szFile,
|
||||
GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr)));
|
||||
#else
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(szFile,
|
||||
GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
|
||||
#endif
|
||||
if (!hFile)
|
||||
{
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
|
@ -94,7 +94,7 @@ namespace
|
||||
// Decodes HDR header
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT DecodeHDRHeader(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource,
|
||||
_In_reads_bytes_(size) const void* 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 = reinterpret_cast<const char*>(pSource);
|
||||
auto info = static_cast<const char*>(pSource);
|
||||
while (size > 0)
|
||||
{
|
||||
if (*info == '\n')
|
||||
@ -310,7 +310,7 @@ namespace
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
offset = size_t(info - reinterpret_cast<const char*>(pSource));
|
||||
offset = size_t(info - static_cast<const char*>(pSource));
|
||||
|
||||
metadata.width = width;
|
||||
metadata.height = height;
|
||||
@ -600,7 +600,7 @@ namespace
|
||||
// Obtain metadata from HDR file in memory/on disk
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::GetMetadataFromHDRMemory(const uint8_t* pSource, size_t size, TexMetadata& metadata) noexcept
|
||||
HRESULT DirectX::GetMetadataFromHDRMemory(const void* pSource, size_t size, TexMetadata& metadata) noexcept
|
||||
{
|
||||
if (!pSource || size == 0)
|
||||
return E_INVALIDARG;
|
||||
@ -617,10 +617,12 @@ HRESULT DirectX::GetMetadataFromHDRFile(const wchar_t* szFile, TexMetadata& meta
|
||||
return E_INVALIDARG;
|
||||
|
||||
#ifdef _WIN32
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
|
||||
nullptr)));
|
||||
#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());
|
||||
@ -675,9 +677,9 @@ HRESULT DirectX::GetMetadataFromHDRFile(const wchar_t* szFile, TexMetadata& meta
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
|
||||
const auto headerLen = static_cast<size_t>(bytesRead);
|
||||
auto const headerLen = static_cast<size_t>(bytesRead);
|
||||
#else
|
||||
const auto headerLen = std::min<size_t>(sizeof(header), len);
|
||||
auto const headerLen = std::min<size_t>(sizeof(header), len);
|
||||
|
||||
inFile.read(reinterpret_cast<char*>(header), headerLen);
|
||||
if (!inFile)
|
||||
@ -694,7 +696,7 @@ HRESULT DirectX::GetMetadataFromHDRFile(const wchar_t* szFile, TexMetadata& meta
|
||||
// Load a HDR file in memory
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::LoadFromHDRMemory(const uint8_t* pSource, size_t size, TexMetadata* metadata, ScratchImage& image) noexcept
|
||||
HRESULT DirectX::LoadFromHDRMemory(const void* pSource, size_t size, TexMetadata* metadata, ScratchImage& image) noexcept
|
||||
{
|
||||
if (!pSource || size == 0)
|
||||
return E_INVALIDARG;
|
||||
@ -890,7 +892,7 @@ HRESULT DirectX::LoadFromHDRMemory(const uint8_t* pSource, size_t size, TexMetad
|
||||
|
||||
for (size_t j = 0; j < image.GetPixelsSize(); j += 16)
|
||||
{
|
||||
const auto exponent = static_cast<int>(fdata[3]);
|
||||
auto const 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));
|
||||
@ -919,10 +921,12 @@ HRESULT DirectX::LoadFromHDRFile(const wchar_t* szFile, TexMetadata* metadata, S
|
||||
image.Release();
|
||||
|
||||
#ifdef _WIN32
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
|
||||
nullptr)));
|
||||
#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());
|
||||
@ -1041,7 +1045,7 @@ HRESULT DirectX::SaveToHDRMemory(const Image& image, Blob& blob) noexcept
|
||||
return hr;
|
||||
|
||||
// Copy header
|
||||
auto dPtr = blob.GetBufferPointer();
|
||||
auto dPtr = static_cast<uint8_t*>(blob.GetBufferPointer());
|
||||
assert(dPtr != nullptr);
|
||||
memcpy(dPtr, header, headerLen);
|
||||
dPtr += headerLen;
|
||||
@ -1093,7 +1097,7 @@ HRESULT DirectX::SaveToHDRMemory(const Image& image, Blob& blob) noexcept
|
||||
}
|
||||
#endif
|
||||
|
||||
hr = blob.Trim(size_t(dPtr - blob.GetConstBufferPointer()));
|
||||
hr = blob.Trim(size_t(dPtr - static_cast<uint8_t*>(blob.GetBufferPointer())));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
blob.Release();
|
||||
@ -1140,9 +1144,13 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
|
||||
|
||||
// Create file and write header
|
||||
#ifdef _WIN32
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
#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());
|
||||
@ -1174,9 +1182,9 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
|
||||
|
||||
// Write blob
|
||||
#ifdef _WIN32
|
||||
const auto bytesToWrite = static_cast<const DWORD>(blob.GetBufferSize());
|
||||
auto const bytesToWrite = static_cast<const DWORD>(blob.GetBufferSize());
|
||||
DWORD bytesWritten;
|
||||
if (!WriteFile(hFile.get(), blob.GetConstBufferPointer(), bytesToWrite, &bytesWritten, nullptr))
|
||||
if (!WriteFile(hFile.get(), blob.GetBufferPointer(), bytesToWrite, &bytesWritten, nullptr))
|
||||
{
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
@ -1186,7 +1194,7 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
|
||||
return E_FAIL;
|
||||
}
|
||||
#else
|
||||
outFile.write(reinterpret_cast<const char*>(blob.GetConstBufferPointer()),
|
||||
outFile.write(reinterpret_cast<char*>(blob.GetBufferPointer()),
|
||||
static_cast<std::streamsize>(blob.GetBufferSize()));
|
||||
|
||||
if (!outFile)
|
||||
@ -1207,7 +1215,7 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
|
||||
sprintf_s(header, g_Header, image.height, image.width);
|
||||
|
||||
#ifdef _WIN32
|
||||
const auto headerLen = static_cast<DWORD>(strlen(header));
|
||||
auto const headerLen = static_cast<DWORD>(strlen(header));
|
||||
|
||||
DWORD bytesWritten;
|
||||
if (!WriteFile(hFile.get(), header, headerLen, &bytesWritten, nullptr))
|
||||
|
@ -457,12 +457,16 @@ 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;
|
||||
@ -1146,7 +1150,7 @@ namespace
|
||||
|
||||
for (size_t y = 0; y < nheight; ++y)
|
||||
{
|
||||
const auto& toY = lfY[y];
|
||||
auto const& toY = lfY[y];
|
||||
|
||||
if (toY.u0 != u0)
|
||||
{
|
||||
@ -1176,7 +1180,7 @@ namespace
|
||||
|
||||
for (size_t x = 0; x < nwidth; ++x)
|
||||
{
|
||||
const auto& toX = lfX[x];
|
||||
auto const& toX = lfX[x];
|
||||
|
||||
BILINEAR_INTERPOLATE(target[x], toX, toY, row0, row1)
|
||||
}
|
||||
@ -1269,7 +1273,7 @@ namespace
|
||||
|
||||
for (size_t y = 0; y < nheight; ++y)
|
||||
{
|
||||
const auto& toY = cfY[y];
|
||||
auto const& toY = cfY[y];
|
||||
|
||||
// Scanline 1
|
||||
if (toY.u0 != u0)
|
||||
@ -1360,7 +1364,7 @@ namespace
|
||||
|
||||
for (size_t x = 0; x < nwidth; ++x)
|
||||
{
|
||||
const auto& toX = cfX[x];
|
||||
auto const& toX = cfX[x];
|
||||
|
||||
XMVECTOR C0, C1, C2, C3;
|
||||
|
||||
@ -2050,7 +2054,7 @@ namespace
|
||||
|
||||
for (size_t slice = 0; slice < ndepth; ++slice)
|
||||
{
|
||||
const auto& toZ = lfZ[slice];
|
||||
auto const& toZ = lfZ[slice];
|
||||
|
||||
const Image* srca = mipChain.GetImage(level - 1, 0, toZ.u0);
|
||||
const Image* srcb = mipChain.GetImage(level - 1, 0, toZ.u1);
|
||||
@ -2068,7 +2072,7 @@ namespace
|
||||
|
||||
for (size_t y = 0; y < nheight; ++y)
|
||||
{
|
||||
const auto& toY = lfY[y];
|
||||
auto const& toY = lfY[y];
|
||||
|
||||
if (toY.u0 != u0)
|
||||
{
|
||||
@ -2101,7 +2105,7 @@ namespace
|
||||
|
||||
for (size_t x = 0; x < nwidth; ++x)
|
||||
{
|
||||
const auto& toX = lfX[x];
|
||||
auto const& toX = lfX[x];
|
||||
|
||||
TRILINEAR_INTERPOLATE(target[x], toX, toY, toZ, urow0, urow1, vrow0, vrow1)
|
||||
}
|
||||
@ -2131,7 +2135,7 @@ namespace
|
||||
|
||||
for (size_t y = 0; y < nheight; ++y)
|
||||
{
|
||||
const auto& toY = lfY[y];
|
||||
auto const& toY = lfY[y];
|
||||
|
||||
if (toY.u0 != u0)
|
||||
{
|
||||
@ -2161,7 +2165,7 @@ namespace
|
||||
|
||||
for (size_t x = 0; x < nwidth; ++x)
|
||||
{
|
||||
const auto& toX = lfX[x];
|
||||
auto const& toX = lfX[x];
|
||||
|
||||
BILINEAR_INTERPOLATE(target[x], toX, toY, urow0, urow1)
|
||||
}
|
||||
@ -2260,7 +2264,7 @@ namespace
|
||||
|
||||
for (size_t slice = 0; slice < ndepth; ++slice)
|
||||
{
|
||||
const auto& toZ = cfZ[slice];
|
||||
auto const& toZ = cfZ[slice];
|
||||
|
||||
const Image* srca = mipChain.GetImage(level - 1, 0, toZ.u0);
|
||||
const Image* srcb = mipChain.GetImage(level - 1, 0, toZ.u1);
|
||||
@ -2282,7 +2286,7 @@ namespace
|
||||
|
||||
for (size_t y = 0; y < nheight; ++y)
|
||||
{
|
||||
const auto& toY = cfY[y];
|
||||
auto const& toY = cfY[y];
|
||||
|
||||
// Scanline 1
|
||||
if (toY.u0 != u0)
|
||||
@ -2403,7 +2407,7 @@ namespace
|
||||
|
||||
for (size_t x = 0; x < nwidth; ++x)
|
||||
{
|
||||
const auto& toX = cfX[x];
|
||||
auto const& toX = cfX[x];
|
||||
|
||||
XMVECTOR D[4];
|
||||
|
||||
@ -2448,7 +2452,7 @@ namespace
|
||||
|
||||
for (size_t y = 0; y < nheight; ++y)
|
||||
{
|
||||
const auto& toY = cfY[y];
|
||||
auto const& toY = cfY[y];
|
||||
|
||||
// Scanline 1
|
||||
if (toY.u0 != u0)
|
||||
@ -2539,7 +2543,7 @@ namespace
|
||||
|
||||
for (size_t x = 0; x < nwidth; ++x)
|
||||
{
|
||||
const auto& toX = cfX[x];
|
||||
auto const& 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]);
|
||||
@ -2951,7 +2955,7 @@ HRESULT DirectX::GenerateMipMaps(
|
||||
mdata.mipLevels = levels;
|
||||
mdata.format = baseImage.format;
|
||||
|
||||
uint32_t filter_select = (filter & TEX_FILTER_MODE_MASK);
|
||||
unsigned long filter_select = (filter & TEX_FILTER_MODE_MASK);
|
||||
if (!filter_select)
|
||||
{
|
||||
// Default filter choice
|
||||
@ -3166,7 +3170,7 @@ HRESULT DirectX::GenerateMipMaps(
|
||||
TexMetadata mdata2 = metadata;
|
||||
mdata2.mipLevels = levels;
|
||||
|
||||
uint32_t filter_select = (filter & TEX_FILTER_MODE_MASK);
|
||||
unsigned long filter_select = (filter & TEX_FILTER_MODE_MASK);
|
||||
if (!filter_select)
|
||||
{
|
||||
// Default filter choice
|
||||
@ -3296,7 +3300,7 @@ HRESULT DirectX::GenerateMipMaps3D(
|
||||
|
||||
HRESULT hr = E_UNEXPECTED;
|
||||
|
||||
uint32_t filter_select = (filter & TEX_FILTER_MODE_MASK);
|
||||
unsigned long filter_select = (filter & TEX_FILTER_MODE_MASK);
|
||||
if (!filter_select)
|
||||
{
|
||||
// Default filter choice
|
||||
@ -3415,7 +3419,7 @@ HRESULT DirectX::GenerateMipMaps3D(
|
||||
|
||||
static_assert(TEX_FILTER_POINT == 0x100000, "TEX_FILTER_ flag values don't match TEX_FILTER_MODE_MASK");
|
||||
|
||||
uint32_t filter_select = (filter & TEX_FILTER_MODE_MASK);
|
||||
unsigned long filter_select = (filter & TEX_FILTER_MODE_MASK);
|
||||
if (!filter_select)
|
||||
{
|
||||
// Default filter choice
|
||||
|
@ -132,7 +132,7 @@
|
||||
#endif
|
||||
#include <d3d11_4.h>
|
||||
#else
|
||||
#include <d3d11_2.h>
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
#else // !WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
|
@ -414,7 +414,7 @@ namespace
|
||||
|
||||
for (size_t y = 0; y < destImage.height; ++y)
|
||||
{
|
||||
const auto& toY = lfY[y];
|
||||
auto const& toY = lfY[y];
|
||||
|
||||
if (toY.u0 != u0)
|
||||
{
|
||||
@ -444,7 +444,7 @@ namespace
|
||||
|
||||
for (size_t x = 0; x < destImage.width; ++x)
|
||||
{
|
||||
const auto& toX = lfX[x];
|
||||
auto const& toX = lfX[x];
|
||||
|
||||
BILINEAR_INTERPOLATE(target[x], toX, toY, row0, row1)
|
||||
}
|
||||
@ -511,7 +511,7 @@ namespace
|
||||
|
||||
for (size_t y = 0; y < destImage.height; ++y)
|
||||
{
|
||||
const auto& toY = cfY[y];
|
||||
auto const& toY = cfY[y];
|
||||
|
||||
// Scanline 1
|
||||
if (toY.u0 != u0)
|
||||
@ -602,7 +602,7 @@ namespace
|
||||
|
||||
for (size_t x = 0; x < destImage.width; ++x)
|
||||
{
|
||||
const auto& toX = cfX[x];
|
||||
auto const& toX = cfX[x];
|
||||
|
||||
XMVECTOR C0, C1, C2, C3;
|
||||
|
||||
@ -811,7 +811,7 @@ namespace
|
||||
|
||||
static_assert(TEX_FILTER_POINT == 0x100000, "TEX_FILTER_ flag values don't match TEX_FILTER_MASK");
|
||||
|
||||
uint32_t filter_select = filter & TEX_FILTER_MODE_MASK;
|
||||
unsigned long filter_select = filter & TEX_FILTER_MODE_MASK;
|
||||
if (!filter_select)
|
||||
{
|
||||
// Default filter choice
|
||||
|
@ -139,7 +139,7 @@ namespace
|
||||
// Decodes TGA header
|
||||
//-------------------------------------------------------------------------------------
|
||||
HRESULT DecodeTGAHeader(
|
||||
_In_reads_bytes_(size) const uint8_t* pSource,
|
||||
_In_reads_bytes_(size) const void* pSource,
|
||||
size_t size,
|
||||
TGA_FLAGS flags,
|
||||
_Out_ TexMetadata& metadata,
|
||||
@ -156,7 +156,7 @@ namespace
|
||||
return HRESULT_E_INVALID_DATA;
|
||||
}
|
||||
|
||||
auto pHeader = reinterpret_cast<const TGA_HEADER*>(pSource);
|
||||
auto pHeader = static_cast<const TGA_HEADER*>(pSource);
|
||||
|
||||
if (pHeader->bDescriptor & (TGA_FLAGS_INTERLEAVED_2WAY | TGA_FLAGS_INTERLEAVED_4WAY))
|
||||
{
|
||||
@ -1413,7 +1413,7 @@ namespace
|
||||
|
||||
if (ext && ext->wSize == sizeof(TGA_EXTENSION) && ext->wGammaDenominator != 0)
|
||||
{
|
||||
const auto gamma = static_cast<float>(ext->wGammaNumerator) / static_cast<float>(ext->wGammaDenominator);
|
||||
auto const gamma = static_cast<float>(ext->wGammaNumerator) / static_cast<float>(ext->wGammaDenominator);
|
||||
if (fabsf(gamma - 2.2f) < GAMMA_EPSILON || fabsf(gamma - 2.4f) < GAMMA_EPSILON)
|
||||
{
|
||||
sRGB = true;
|
||||
@ -1447,7 +1447,7 @@ namespace
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::GetMetadataFromTGAMemory(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
TGA_FLAGS flags,
|
||||
TexMetadata& metadata) noexcept
|
||||
@ -1492,10 +1492,12 @@ HRESULT DirectX::GetMetadataFromTGAFile(const wchar_t* szFile, TGA_FLAGS flags,
|
||||
return E_INVALIDARG;
|
||||
|
||||
#ifdef _WIN32
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
|
||||
nullptr)));
|
||||
#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());
|
||||
@ -1550,7 +1552,7 @@ HRESULT DirectX::GetMetadataFromTGAFile(const wchar_t* szFile, TGA_FLAGS flags,
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
|
||||
const auto headerLen = static_cast<size_t>(bytesRead);
|
||||
auto const headerLen = static_cast<size_t>(bytesRead);
|
||||
#else
|
||||
inFile.read(reinterpret_cast<char*>(header), TGA_HEADER_LEN);
|
||||
if (!inFile)
|
||||
@ -1639,7 +1641,7 @@ HRESULT DirectX::GetMetadataFromTGAFile(const wchar_t* szFile, TGA_FLAGS flags,
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::LoadFromTGAMemory(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
TGA_FLAGS flags,
|
||||
TexMetadata* metadata,
|
||||
@ -1679,7 +1681,7 @@ HRESULT DirectX::LoadFromTGAMemory(
|
||||
|
||||
const size_t remaining = size - offset - paletteOffset;
|
||||
if (remaining == 0)
|
||||
return HRESULT_E_HANDLE_EOF;
|
||||
return E_FAIL;
|
||||
|
||||
const void* pPixels = static_cast<const uint8_t*>(pSource) + offset + paletteOffset;
|
||||
|
||||
@ -1756,10 +1758,12 @@ HRESULT DirectX::LoadFromTGAFile(
|
||||
image.Release();
|
||||
|
||||
#ifdef _WIN32
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING,
|
||||
nullptr)));
|
||||
#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());
|
||||
@ -1814,7 +1818,7 @@ HRESULT DirectX::LoadFromTGAFile(
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
|
||||
const auto headerLen = static_cast<size_t>(bytesRead);
|
||||
auto const headerLen = static_cast<size_t>(bytesRead);
|
||||
#else
|
||||
inFile.read(reinterpret_cast<char*>(header), TGA_HEADER_LEN);
|
||||
if (!inFile)
|
||||
@ -1834,7 +1838,7 @@ HRESULT DirectX::LoadFromTGAFile(
|
||||
return HRESULT_E_INVALID_DATA;
|
||||
|
||||
// Read the pixels
|
||||
const auto remaining = len - offset;
|
||||
auto const remaining = len - offset;
|
||||
if (remaining == 0)
|
||||
return E_FAIL;
|
||||
|
||||
@ -2127,12 +2131,6 @@ HRESULT DirectX::LoadFromTGAFile(
|
||||
image.Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
if ((remaining - paletteOffset) == 0)
|
||||
{
|
||||
image.Release();
|
||||
return HRESULT_E_HANDLE_EOF;
|
||||
}
|
||||
}
|
||||
|
||||
if (convFlags & CONV_FLAGS_RLE)
|
||||
@ -2281,7 +2279,7 @@ HRESULT DirectX::SaveToTGAMemory(
|
||||
return hr;
|
||||
|
||||
// Copy header
|
||||
auto destPtr = blob.GetBufferPointer();
|
||||
auto destPtr = static_cast<uint8_t*>(blob.GetBufferPointer());
|
||||
assert(destPtr != nullptr);
|
||||
|
||||
uint8_t* dPtr = destPtr;
|
||||
@ -2359,10 +2357,13 @@ HRESULT DirectX::SaveToTGAFile(
|
||||
|
||||
// Create file and write header
|
||||
#ifdef _WIN32
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(
|
||||
szFile,
|
||||
GENERIC_WRITE, 0, CREATE_ALWAYS,
|
||||
nullptr)));
|
||||
#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());
|
||||
@ -2395,7 +2396,7 @@ HRESULT DirectX::SaveToTGAFile(
|
||||
#ifdef _WIN32
|
||||
const DWORD bytesToWrite = static_cast<DWORD>(blob.GetBufferSize());
|
||||
DWORD bytesWritten;
|
||||
if (!WriteFile(hFile.get(), blob.GetConstBufferPointer(), bytesToWrite, &bytesWritten, nullptr))
|
||||
if (!WriteFile(hFile.get(), blob.GetBufferPointer(), bytesToWrite, &bytesWritten, nullptr))
|
||||
{
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
@ -2405,7 +2406,7 @@ HRESULT DirectX::SaveToTGAFile(
|
||||
return E_FAIL;
|
||||
}
|
||||
#else
|
||||
outFile.write(reinterpret_cast<const char*>(blob.GetConstBufferPointer()),
|
||||
outFile.write(reinterpret_cast<char*>(blob.GetBufferPointer()),
|
||||
static_cast<std::streamsize>(blob.GetBufferSize()));
|
||||
|
||||
if (!outFile)
|
||||
|
@ -49,8 +49,7 @@ namespace
|
||||
constexpr WICTranslate(const GUID& wg, DXGI_FORMAT fmt, bool isrgb) noexcept :
|
||||
wic(wg),
|
||||
format(fmt),
|
||||
srgb(isrgb)
|
||||
{}
|
||||
srgb(isrgb) {}
|
||||
};
|
||||
|
||||
constexpr WICTranslate g_WICFormats[] =
|
||||
@ -85,6 +84,7 @@ namespace
|
||||
|
||||
BOOL WINAPI InitializeWICFactory(PINIT_ONCE, PVOID, PVOID *ifactory) noexcept
|
||||
{
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
HRESULT hr = CoCreateInstance(
|
||||
CLSID_WICImagingFactory2,
|
||||
nullptr,
|
||||
@ -112,6 +112,16 @@ namespace
|
||||
);
|
||||
return SUCCEEDED(hr) ? TRUE : FALSE;
|
||||
}
|
||||
#else
|
||||
g_WIC2 = false;
|
||||
|
||||
return SUCCEEDED(CoCreateInstance(
|
||||
CLSID_WICImagingFactory,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(IWICImagingFactory),
|
||||
ifactory)) ? TRUE : FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#else // !WIN32
|
||||
@ -140,11 +150,13 @@ DXGI_FORMAT DirectX::Internal::WICToDXGI(const GUID& guid) noexcept
|
||||
return g_WICFormats[i].format;
|
||||
}
|
||||
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
if (g_WIC2)
|
||||
{
|
||||
if (memcmp(&GUID_WICPixelFormat96bppRGBFloat, &guid, sizeof(GUID)) == 0)
|
||||
return DXGI_FORMAT_R32G32B32_FLOAT;
|
||||
}
|
||||
#endif
|
||||
|
||||
return DXGI_FORMAT_UNKNOWN;
|
||||
}
|
||||
@ -184,6 +196,7 @@ bool DirectX::Internal::DXGIToWIC(DXGI_FORMAT format, GUID& guid, bool ignoreRGB
|
||||
memcpy(&guid, &GUID_WICPixelFormat32bppBGR, sizeof(GUID));
|
||||
return true;
|
||||
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
case DXGI_FORMAT_R32G32B32_FLOAT:
|
||||
if (g_WIC2)
|
||||
{
|
||||
@ -191,6 +204,7 @@ bool DirectX::Internal::DXGIToWIC(DXGI_FORMAT format, GUID& guid, bool ignoreRGB
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
for (size_t i = 0; i < std::size(g_WICFormats); ++i)
|
||||
@ -314,12 +328,14 @@ void DirectX::SetWICFactory(_In_opt_ IWICImagingFactory* pWIC) noexcept
|
||||
bool iswic2 = false;
|
||||
if (pWIC)
|
||||
{
|
||||
#if(_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
ComPtr<IWICImagingFactory2> wic2;
|
||||
HRESULT hr = pWIC->QueryInterface(IID_PPV_ARGS(wic2.GetAddressOf()));
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
iswic2 = true;
|
||||
}
|
||||
#endif
|
||||
pWIC->AddRef();
|
||||
}
|
||||
|
||||
@ -393,20 +409,10 @@ bool DirectX::IsVideo(DXGI_FORMAT fmt) noexcept
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
bool DirectX::IsPlanar(DXGI_FORMAT fmt, bool isd3d12) noexcept
|
||||
bool DirectX::IsPlanar(DXGI_FORMAT fmt) noexcept
|
||||
{
|
||||
switch (static_cast<int>(fmt))
|
||||
{
|
||||
case DXGI_FORMAT_R32G8X24_TYPELESS:
|
||||
case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:
|
||||
case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
|
||||
case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
|
||||
case DXGI_FORMAT_R24G8_TYPELESS:
|
||||
case DXGI_FORMAT_D24_UNORM_S8_UINT:
|
||||
case DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
|
||||
case DXGI_FORMAT_X24_TYPELESS_G8_UINT:
|
||||
return isd3d12; // Direct3D 12 considers these planar, Direct3D 11 does not.
|
||||
|
||||
case DXGI_FORMAT_NV12: // 4:2:0 8-bit
|
||||
case DXGI_FORMAT_P010: // 4:2:0 10-bit
|
||||
case DXGI_FORMAT_P016: // 4:2:0 16-bit
|
||||
@ -914,45 +920,6 @@ size_t DirectX::BitsPerColor(DXGI_FORMAT fmt) noexcept
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Returns bytes per block for a given DXGI BC format, or 0 on failure
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
size_t DirectX::BytesPerBlock(DXGI_FORMAT fmt) noexcept
|
||||
{
|
||||
switch (fmt)
|
||||
{
|
||||
case DXGI_FORMAT_BC1_TYPELESS:
|
||||
case DXGI_FORMAT_BC1_UNORM:
|
||||
case DXGI_FORMAT_BC1_UNORM_SRGB:
|
||||
case DXGI_FORMAT_BC4_TYPELESS:
|
||||
case DXGI_FORMAT_BC4_UNORM:
|
||||
case DXGI_FORMAT_BC4_SNORM:
|
||||
return 8;
|
||||
|
||||
case DXGI_FORMAT_BC2_TYPELESS:
|
||||
case DXGI_FORMAT_BC2_UNORM:
|
||||
case DXGI_FORMAT_BC2_UNORM_SRGB:
|
||||
case DXGI_FORMAT_BC3_TYPELESS:
|
||||
case DXGI_FORMAT_BC3_UNORM:
|
||||
case DXGI_FORMAT_BC3_UNORM_SRGB:
|
||||
case DXGI_FORMAT_BC5_TYPELESS:
|
||||
case DXGI_FORMAT_BC5_UNORM:
|
||||
case DXGI_FORMAT_BC5_SNORM:
|
||||
case DXGI_FORMAT_BC6H_TYPELESS:
|
||||
case DXGI_FORMAT_BC6H_UF16:
|
||||
case DXGI_FORMAT_BC6H_SF16:
|
||||
case DXGI_FORMAT_BC7_TYPELESS:
|
||||
case DXGI_FORMAT_BC7_UNORM:
|
||||
case DXGI_FORMAT_BC7_UNORM_SRGB:
|
||||
return 16;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Computes the image row pitch in bytes, and the slice ptich (size in bytes of the image)
|
||||
// based on DXGI format, width, and height
|
||||
@ -966,9 +933,6 @@ HRESULT DirectX::ComputePitch(DXGI_FORMAT fmt, size_t width, size_t height,
|
||||
|
||||
switch (static_cast<int>(fmt))
|
||||
{
|
||||
case DXGI_FORMAT_UNKNOWN:
|
||||
return E_INVALIDARG;
|
||||
|
||||
case DXGI_FORMAT_BC1_TYPELESS:
|
||||
case DXGI_FORMAT_BC1_UNORM:
|
||||
case DXGI_FORMAT_BC1_UNORM_SRGB:
|
||||
@ -1189,9 +1153,6 @@ size_t DirectX::ComputeScanlines(DXGI_FORMAT fmt, size_t height) noexcept
|
||||
{
|
||||
switch (static_cast<int>(fmt))
|
||||
{
|
||||
case DXGI_FORMAT_UNKNOWN:
|
||||
return 0;
|
||||
|
||||
case DXGI_FORMAT_BC1_TYPELESS:
|
||||
case DXGI_FORMAT_BC1_UNORM:
|
||||
case DXGI_FORMAT_BC1_UNORM_SRGB:
|
||||
@ -1247,163 +1208,6 @@ size_t DirectX::ComputeScanlines(DXGI_FORMAT fmt, size_t height) noexcept
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Compute standard tile shape for 64KB tiles
|
||||
//-------------------------------------------------------------------------------------
|
||||
namespace
|
||||
{
|
||||
constexpr size_t TILED_RESOURCE_TILE_SIZE_IN_BYTES = 65536;
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::ComputeTileShape(
|
||||
DXGI_FORMAT fmt,
|
||||
TEX_DIMENSION dimension,
|
||||
TileShape& tiling) noexcept
|
||||
{
|
||||
tiling = {};
|
||||
|
||||
if (IsVideo(fmt) || IsPacked(fmt))
|
||||
return E_INVALIDARG;
|
||||
|
||||
const size_t bpp = BitsPerPixel(fmt);
|
||||
if (!bpp || bpp == 1 || bpp == 24 || bpp == 96)
|
||||
return E_INVALIDARG;
|
||||
|
||||
const bool iscompressed = IsCompressed(fmt);
|
||||
|
||||
switch (dimension)
|
||||
{
|
||||
case TEX_DIMENSION_TEXTURE1D:
|
||||
if (iscompressed)
|
||||
return E_INVALIDARG;
|
||||
|
||||
tiling.width = (bpp) ? ((TILED_RESOURCE_TILE_SIZE_IN_BYTES * 8) / bpp) : TILED_RESOURCE_TILE_SIZE_IN_BYTES;
|
||||
tiling.height = tiling.depth = 1;
|
||||
break;
|
||||
|
||||
case TEX_DIMENSION_TEXTURE2D:
|
||||
tiling.depth = 1;
|
||||
if (iscompressed)
|
||||
{
|
||||
size_t bpb = BytesPerBlock(fmt);
|
||||
switch (bpb)
|
||||
{
|
||||
case 8:
|
||||
tiling.width = 128 * 4;
|
||||
tiling.height = 64 * 4;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
tiling.width = tiling.height = 64 * 4;
|
||||
break;
|
||||
|
||||
default:
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
assert(((tiling.width / 4) * (tiling.height / 4) * bpb) == TILED_RESOURCE_TILE_SIZE_IN_BYTES);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bpp <= 8)
|
||||
{
|
||||
tiling.width = tiling.height = 256;
|
||||
}
|
||||
else if (bpp <= 16)
|
||||
{
|
||||
tiling.width = 256;
|
||||
tiling.height = 128;
|
||||
}
|
||||
else if (bpp <= 32)
|
||||
{
|
||||
tiling.width = tiling.height = 128;
|
||||
}
|
||||
else if (bpp <= 64)
|
||||
{
|
||||
tiling.width = 128;
|
||||
tiling.height = 64;
|
||||
}
|
||||
else if (bpp <= 128)
|
||||
{
|
||||
tiling.width = tiling.height = 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
tiling = {};
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
assert(((tiling.width * tiling.height * bpp) / 8) == TILED_RESOURCE_TILE_SIZE_IN_BYTES);
|
||||
}
|
||||
break;
|
||||
|
||||
case TEX_DIMENSION_TEXTURE3D:
|
||||
if (iscompressed)
|
||||
{
|
||||
size_t bpb = BytesPerBlock(fmt);
|
||||
switch (bpb)
|
||||
{
|
||||
case 8:
|
||||
tiling.width = 32 * 4;
|
||||
tiling.height = 16 * 4;
|
||||
tiling.depth = 16;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
tiling.width = tiling.height = 16 * 4;
|
||||
tiling.depth = 16;
|
||||
break;
|
||||
|
||||
default:
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
assert(((tiling.width / 4) * (tiling.height / 4) * tiling.depth * bpb) == TILED_RESOURCE_TILE_SIZE_IN_BYTES);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bpp <= 8)
|
||||
{
|
||||
tiling.width = 64;
|
||||
tiling.height = tiling.depth = 32;
|
||||
}
|
||||
else if (bpp <= 16)
|
||||
{
|
||||
tiling.width = tiling.height = tiling.depth = 32;
|
||||
}
|
||||
else if (bpp <= 32)
|
||||
{
|
||||
tiling.width = tiling.height = 32;
|
||||
tiling.depth = 16;
|
||||
}
|
||||
else if (bpp <= 64)
|
||||
{
|
||||
tiling.width = 32;
|
||||
tiling.height = tiling.depth = 16;
|
||||
}
|
||||
else if (bpp <= 128)
|
||||
{
|
||||
tiling.width = tiling.height = tiling.depth = 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
tiling = {};
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
assert(((tiling.width * tiling.height * tiling.depth * bpp) / 8) == TILED_RESOURCE_TILE_SIZE_IN_BYTES);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Converts to an SRGB equivalent type if available
|
||||
//-------------------------------------------------------------------------------------
|
||||
@ -1845,7 +1649,7 @@ HRESULT Blob::Initialize(size_t size) noexcept
|
||||
|
||||
Release();
|
||||
|
||||
m_buffer = reinterpret_cast<uint8_t*>(_aligned_malloc(size, 16));
|
||||
m_buffer = _aligned_malloc(size, 16);
|
||||
if (!m_buffer)
|
||||
{
|
||||
Release();
|
||||
@ -1881,7 +1685,7 @@ HRESULT Blob::Resize(size_t size) noexcept
|
||||
if (!m_buffer || !m_size)
|
||||
return E_UNEXPECTED;
|
||||
|
||||
auto tbuffer = reinterpret_cast<uint8_t*>(_aligned_malloc(size, 16));
|
||||
void *tbuffer = _aligned_malloc(size, 16);
|
||||
if (!tbuffer)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
|
@ -29,8 +29,7 @@ namespace
|
||||
constexpr WICConvert(const GUID& src, const GUID& tgt, TEX_ALPHA_MODE mode) noexcept :
|
||||
source(src),
|
||||
target(tgt),
|
||||
alphaMode(mode)
|
||||
{}
|
||||
alphaMode(mode) {}
|
||||
};
|
||||
|
||||
constexpr WICConvert g_WICConvert[] =
|
||||
@ -82,9 +81,11 @@ namespace
|
||||
{ GUID_WICPixelFormat40bppCMYKAlpha, GUID_WICPixelFormat32bppRGBA, TEX_ALPHA_MODE_UNKNOWN }, // DXGI_FORMAT_R8G8B8A8_UNORM
|
||||
{ GUID_WICPixelFormat80bppCMYKAlpha, GUID_WICPixelFormat64bppRGBA, TEX_ALPHA_MODE_UNKNOWN }, // DXGI_FORMAT_R16G16B16A16_UNORM
|
||||
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
{ GUID_WICPixelFormat32bppRGB, GUID_WICPixelFormat32bppRGBA, TEX_ALPHA_MODE_OPAQUE }, // DXGI_FORMAT_R8G8B8A8_UNORM
|
||||
{ GUID_WICPixelFormat64bppRGB, GUID_WICPixelFormat64bppRGBA, TEX_ALPHA_MODE_OPAQUE }, // DXGI_FORMAT_R16G16B16A16_UNORM
|
||||
{ GUID_WICPixelFormat64bppPRGBAHalf, GUID_WICPixelFormat64bppRGBAHalf, TEX_ALPHA_MODE_UNKNOWN }, // DXGI_FORMAT_R16G16B16A16_FLOAT
|
||||
#endif
|
||||
|
||||
// We don't support n-channel formats
|
||||
};
|
||||
@ -110,6 +111,7 @@ namespace
|
||||
{
|
||||
if (memcmp(&GUID_WICPixelFormat96bppRGBFixedPoint, &pixelFormat, sizeof(WICPixelFormatGUID)) == 0)
|
||||
{
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
if (iswic2)
|
||||
{
|
||||
if (pConvert)
|
||||
@ -117,6 +119,9 @@ namespace
|
||||
format = DXGI_FORMAT_R32G32B32_FLOAT;
|
||||
}
|
||||
else
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(iswic2);
|
||||
#endif
|
||||
{
|
||||
if (pConvert)
|
||||
memcpy_s(pConvert, sizeof(WICPixelFormatGUID), &GUID_WICPixelFormat128bppRGBAFloat, sizeof(GUID));
|
||||
@ -203,7 +208,7 @@ namespace
|
||||
m_streamEOF(0),
|
||||
mRefCount(1)
|
||||
{
|
||||
assert(mBlob.GetConstBufferPointer() && mBlob.GetBufferSize() > 0);
|
||||
assert(mBlob.GetBufferPointer() && mBlob.GetBufferSize() > 0);
|
||||
}
|
||||
|
||||
public:
|
||||
@ -249,7 +254,7 @@ namespace
|
||||
HRESULT STDMETHODCALLTYPE Read(void* pv, ULONG cb, ULONG* pcbRead) override
|
||||
{
|
||||
size_t maxRead = m_streamEOF - m_streamPosition;
|
||||
auto ptr = mBlob.GetBufferPointer();
|
||||
auto ptr = static_cast<const uint8_t*>(mBlob.GetBufferPointer());
|
||||
if (cb > maxRead)
|
||||
{
|
||||
const uint64_t pos = uint64_t(m_streamPosition) + uint64_t(maxRead);
|
||||
@ -319,7 +324,7 @@ namespace
|
||||
if (pos > UINT32_MAX)
|
||||
return HRESULT_E_ARITHMETIC_OVERFLOW;
|
||||
|
||||
auto ptr = mBlob.GetBufferPointer();
|
||||
auto ptr = static_cast<uint8_t*>(mBlob.GetBufferPointer());
|
||||
memcpy(&ptr[m_streamPosition], pv, cb);
|
||||
|
||||
m_streamPosition = static_cast<size_t>(pos);
|
||||
@ -342,7 +347,7 @@ namespace
|
||||
|
||||
if (blobSize >= size.LowPart)
|
||||
{
|
||||
auto ptr = mBlob.GetBufferPointer();
|
||||
auto ptr = static_cast<uint8_t*>(mBlob.GetBufferPointer());
|
||||
if (m_streamEOF < size.LowPart)
|
||||
{
|
||||
memset(&ptr[m_streamEOF], 0, size.LowPart - m_streamEOF);
|
||||
@ -362,7 +367,7 @@ namespace
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
auto ptr = mBlob.GetBufferPointer();
|
||||
auto ptr = static_cast<uint8_t*>(mBlob.GetBufferPointer());
|
||||
if (m_streamEOF < size.LowPart)
|
||||
{
|
||||
memset(&ptr[m_streamEOF], 0, size.LowPart - m_streamEOF);
|
||||
@ -1216,7 +1221,7 @@ namespace
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::GetMetadataFromWICMemory(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
WIC_FLAGS flags,
|
||||
TexMetadata& metadata,
|
||||
@ -1239,7 +1244,7 @@ HRESULT DirectX::GetMetadataFromWICMemory(
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
hr = stream->InitializeFromMemory(static_cast<BYTE*>(const_cast<uint8_t*>(pSource)),
|
||||
hr = stream->InitializeFromMemory(static_cast<BYTE*>(const_cast<void*>(pSource)),
|
||||
static_cast<UINT>(size));
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
@ -1307,7 +1312,7 @@ HRESULT DirectX::GetMetadataFromWICFile(
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::LoadFromWICMemory(
|
||||
const uint8_t* pSource,
|
||||
const void* pSource,
|
||||
size_t size,
|
||||
WIC_FLAGS flags,
|
||||
TexMetadata* metadata,
|
||||
@ -1333,7 +1338,7 @@ HRESULT DirectX::LoadFromWICMemory(
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
hr = stream->InitializeFromMemory(static_cast<uint8_t*>(const_cast<uint8_t*>(pSource)), static_cast<DWORD>(size));
|
||||
hr = stream->InitializeFromMemory(static_cast<uint8_t*>(const_cast<void*>(pSource)), static_cast<DWORD>(size));
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
|
@ -138,10 +138,10 @@
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -165,10 +165,10 @@
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -192,10 +192,10 @@
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -218,10 +218,10 @@
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -246,10 +246,10 @@
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -272,10 +272,10 @@
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -347,13 +347,10 @@
|
||||
<_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/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);WindowsSDKVersion=$(_ATGFXCVer);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<Exec Condition="!Exists('Shaders/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath />
|
||||
<_ATGFXCVer />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="ATGDeleteShaders" AfterTargets="Clean">
|
||||
|
@ -196,7 +196,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -223,7 +223,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -250,7 +250,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -277,7 +277,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -303,7 +303,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -330,7 +330,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -358,7 +358,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -384,7 +384,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -411,7 +411,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -437,12 +437,12 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Common\d3dx12.h" />
|
||||
<CLInclude Include="BC.h" />
|
||||
<ClCompile Include="BC.cpp" />
|
||||
<ClCompile Include="BC4BC5.cpp" />
|
||||
<ClCompile Include="BC6HBC7.cpp" />
|
||||
<ClInclude Include="BCDirectCompute.h" />
|
||||
<ClInclude Include="d3dx12.h" />
|
||||
<CLInclude Include="DDS.h" />
|
||||
<ClInclude Include="filters.h" />
|
||||
<CLInclude Include="scoped.h" />
|
||||
@ -488,13 +488,10 @@
|
||||
<_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/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);WindowsSDKVersion=$(_ATGFXCVer);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<Exec Condition="!Exists('Shaders/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath />
|
||||
<_ATGFXCVer />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="ATGDeleteShaders" AfterTargets="Clean">
|
||||
|
@ -36,7 +36,7 @@
|
||||
<CLInclude Include="scoped.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</CLInclude>
|
||||
<ClInclude Include="..\Common\d3dx12.h">
|
||||
<ClInclude Include="d3dx12.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
|
@ -138,10 +138,10 @@
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -165,10 +165,10 @@
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -192,10 +192,10 @@
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -218,10 +218,10 @@
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -246,10 +246,10 @@
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -272,10 +272,10 @@
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0603;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0601;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -347,13 +347,10 @@
|
||||
<_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/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);WindowsSDKVersion=$(_ATGFXCVer);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<Exec Condition="!Exists('Shaders/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath />
|
||||
<_ATGFXCVer />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="ATGDeleteShaders" AfterTargets="Clean">
|
||||
|
@ -196,7 +196,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -223,7 +223,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -250,7 +250,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -277,7 +277,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -303,7 +303,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -330,7 +330,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -358,7 +358,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -384,7 +384,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -411,7 +411,7 @@
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -437,12 +437,12 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Common\d3dx12.h" />
|
||||
<CLInclude Include="BC.h" />
|
||||
<ClCompile Include="BC.cpp" />
|
||||
<ClCompile Include="BC4BC5.cpp" />
|
||||
<ClCompile Include="BC6HBC7.cpp" />
|
||||
<ClInclude Include="BCDirectCompute.h" />
|
||||
<ClInclude Include="d3dx12.h" />
|
||||
<CLInclude Include="DDS.h" />
|
||||
<ClInclude Include="filters.h" />
|
||||
<CLInclude Include="scoped.h" />
|
||||
@ -488,13 +488,10 @@
|
||||
<_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/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);WindowsSDKVersion=$(_ATGFXCVer);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<Exec Condition="!Exists('Shaders/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath />
|
||||
<_ATGFXCVer />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="ATGDeleteShaders" AfterTargets="Clean">
|
||||
|
@ -36,7 +36,7 @@
|
||||
<CLInclude Include="scoped.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</CLInclude>
|
||||
<ClInclude Include="..\Common\d3dx12.h">
|
||||
<ClInclude Include="d3dx12.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
|
@ -239,7 +239,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -265,7 +265,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -292,7 +292,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -318,7 +318,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -344,7 +344,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -371,7 +371,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -394,7 +394,7 @@
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -419,7 +419,7 @@
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -444,7 +444,7 @@
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -462,8 +462,8 @@
|
||||
</FXCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Common\d3dx12.h" />
|
||||
<ClInclude Include="BC.h" />
|
||||
<ClInclude Include="d3dx12.h" />
|
||||
<ClInclude Include="DDS.h" />
|
||||
<ClInclude Include="DirectXTex.h" />
|
||||
<ClInclude Include="DirectXTexP.h" />
|
||||
@ -478,6 +478,7 @@
|
||||
<ItemGroup>
|
||||
<None Include="..\README.md" />
|
||||
<None Include="DirectXTex.inl" />
|
||||
<None Include="Shaders\CompileShaders.cmd" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BC.cpp" />
|
||||
@ -534,6 +535,14 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Profile|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Shaders\BC6HEncode.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="Shaders\BC7Encode.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets" />
|
||||
<Target Name="EnsureGDK" BeforeTargets="_CheckForInvalidConfigurationAndPlatform" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('$(Platform)', 'Gaming\..+\.x64'))">
|
||||
@ -543,4 +552,23 @@
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(VCTargetsPath)\Platforms\$(Platform)\Platform.props')" Text="$([System.String]::Format('$(ErrorText)', '$(Platform)'))" />
|
||||
</Target>
|
||||
<Target Name="ATGEnsureShaders" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath>$(WindowsSDK_ExecutablePath_x64.Split(';')[0])</_ATGFXCPath>
|
||||
<_ATGFXCPath>$(_ATGFXCPath.Replace("x64",""))</_ATGFXCPath>
|
||||
<_ATGFXCPath Condition="'$(_ATGFXCPath)' != '' and !HasTrailingSlash('$(_ATGFXCPath)')">$(_ATGFXCPath)\</_ATGFXCPath>
|
||||
</PropertyGroup>
|
||||
<Exec Condition="!Exists('Shaders/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="ATGDeleteShaders" AfterTargets="Clean">
|
||||
<ItemGroup>
|
||||
<_ATGShaderHeaders Include="$(ProjectDir)Shaders/Compiled/*.inc" />
|
||||
<_ATGShaderSymbols Include="$(ProjectDir)Shaders/Compiled/*.pdb" />
|
||||
</ItemGroup>
|
||||
<Delete Files="@(_ATGShaderHeaders)" />
|
||||
<Delete Files="@(_ATGShaderSymbols)" />
|
||||
</Target>
|
||||
</Project>
|
@ -35,17 +35,26 @@
|
||||
<ClInclude Include="scoped.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d3dx12.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Auxiliary\DirectXTexXbox.h">
|
||||
<Filter>Auxiliary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Common\d3dx12.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="DirectXTex.inl">
|
||||
<Filter>Header Files</Filter>
|
||||
</None>
|
||||
<None Include="Shaders\CompileShaders.cmd">
|
||||
<Filter>Source Files\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="Shaders\BC7Encode.hlsl">
|
||||
<Filter>Source Files\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="Shaders\BC6HEncode.hlsl">
|
||||
<Filter>Source Files\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\README.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -239,7 +239,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -265,7 +265,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -292,7 +292,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -318,7 +318,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -344,7 +344,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -371,7 +371,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;_LIB;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -394,7 +394,7 @@
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -419,7 +419,7 @@
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -444,7 +444,7 @@
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
@ -462,8 +462,8 @@
|
||||
</FXCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Common\d3dx12.h" />
|
||||
<ClInclude Include="BC.h" />
|
||||
<ClInclude Include="d3dx12.h" />
|
||||
<ClInclude Include="DDS.h" />
|
||||
<ClInclude Include="DirectXTex.h" />
|
||||
<ClInclude Include="DirectXTexP.h" />
|
||||
@ -478,6 +478,7 @@
|
||||
<ItemGroup>
|
||||
<None Include="..\README.md" />
|
||||
<None Include="DirectXTex.inl" />
|
||||
<None Include="Shaders\CompileShaders.cmd" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BC.cpp" />
|
||||
@ -534,6 +535,14 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Profile|Gaming.Desktop.x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Shaders\BC6HEncode.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
<None Include="Shaders\BC7Encode.hlsl">
|
||||
<FileType>Document</FileType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets" />
|
||||
<Target Name="EnsureGDK" BeforeTargets="_CheckForInvalidConfigurationAndPlatform" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('$(Platform)', 'Gaming\..+\.x64'))">
|
||||
@ -543,4 +552,23 @@
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(VCTargetsPath)\Platforms\$(Platform)\Platform.props')" Text="$([System.String]::Format('$(ErrorText)', '$(Platform)'))" />
|
||||
</Target>
|
||||
<Target Name="ATGEnsureShaders" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath>$(WindowsSDK_ExecutablePath_x64.Split(';')[0])</_ATGFXCPath>
|
||||
<_ATGFXCPath>$(_ATGFXCPath.Replace("x64",""))</_ATGFXCPath>
|
||||
<_ATGFXCPath Condition="'$(_ATGFXCPath)' != '' and !HasTrailingSlash('$(_ATGFXCPath)')">$(_ATGFXCPath)\</_ATGFXCPath>
|
||||
</PropertyGroup>
|
||||
<Exec Condition="!Exists('Shaders/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="ATGDeleteShaders" AfterTargets="Clean">
|
||||
<ItemGroup>
|
||||
<_ATGShaderHeaders Include="$(ProjectDir)Shaders/Compiled/*.inc" />
|
||||
<_ATGShaderSymbols Include="$(ProjectDir)Shaders/Compiled/*.pdb" />
|
||||
</ItemGroup>
|
||||
<Delete Files="@(_ATGShaderHeaders)" />
|
||||
<Delete Files="@(_ATGShaderSymbols)" />
|
||||
</Target>
|
||||
</Project>
|
@ -35,17 +35,26 @@
|
||||
<ClInclude Include="scoped.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d3dx12.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Auxiliary\DirectXTexXbox.h">
|
||||
<Filter>Auxiliary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Common\d3dx12.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="DirectXTex.inl">
|
||||
<Filter>Header Files</Filter>
|
||||
</None>
|
||||
<None Include="Shaders\CompileShaders.cmd">
|
||||
<Filter>Source Files\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="Shaders\BC7Encode.hlsl">
|
||||
<Filter>Source Files\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="Shaders\BC6HEncode.hlsl">
|
||||
<Filter>Source Files\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="..\README.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -107,7 +107,7 @@
|
||||
<PreprocessorDefinitions>_USE_GXDK;USE_XBOX_EXTS;_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -135,7 +135,7 @@
|
||||
<PreprocessorDefinitions>_USE_GXDK;USE_XBOX_EXTS;_USE_SCARLETT;_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -162,7 +162,7 @@
|
||||
<PreprocessorDefinitions>_USE_GXDK;USE_XBOX_EXTS;_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -190,7 +190,7 @@
|
||||
<PreprocessorDefinitions>_USE_GXDK;USE_XBOX_EXTS;_USE_SCARLETT;_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -211,7 +211,6 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Auxiliary\DirectXTexXbox.h" />
|
||||
<ClInclude Include="..\Common\d3dx12.h" />
|
||||
<CLInclude Include="BC.h" />
|
||||
<ClCompile Include="..\Auxiliary\DirectXTexXboxDDS.cpp" />
|
||||
<ClCompile Include="..\Auxiliary\DirectXTexXboxDetile.cpp" />
|
||||
@ -221,6 +220,7 @@
|
||||
<ClCompile Include="BC4BC5.cpp" />
|
||||
<ClCompile Include="BC6HBC7.cpp" />
|
||||
<ClInclude Include="BCDirectCompute.h" />
|
||||
<ClInclude Include="d3dx12.h" />
|
||||
<CLInclude Include="DDS.h" />
|
||||
<ClInclude Include="filters.h" />
|
||||
<CLInclude Include="scoped.h" />
|
||||
@ -268,13 +268,10 @@
|
||||
<_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/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);WindowsSDKVersion=$(_ATGFXCVer);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<Exec Condition="!Exists('Shaders/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath />
|
||||
<_ATGFXCVer />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="ATGDeleteShaders" AfterTargets="Clean">
|
||||
|
@ -39,12 +39,12 @@
|
||||
<CLInclude Include="scoped.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</CLInclude>
|
||||
<ClInclude Include="d3dx12.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Auxiliary\DirectXTexXbox.h">
|
||||
<Filter>Auxiliary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Common\d3dx12.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BC.cpp">
|
||||
|
@ -107,7 +107,7 @@
|
||||
<PreprocessorDefinitions>_USE_GXDK;USE_XBOX_EXTS;_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -135,7 +135,7 @@
|
||||
<PreprocessorDefinitions>_USE_GXDK;USE_XBOX_EXTS;_USE_SCARLETT;_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -162,7 +162,7 @@
|
||||
<PreprocessorDefinitions>_USE_GXDK;USE_XBOX_EXTS;_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -190,7 +190,7 @@
|
||||
<PreprocessorDefinitions>_USE_GXDK;USE_XBOX_EXTS;_USE_SCARLETT;_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0A00;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
@ -211,7 +211,6 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Auxiliary\DirectXTexXbox.h" />
|
||||
<ClInclude Include="..\Common\d3dx12.h" />
|
||||
<CLInclude Include="BC.h" />
|
||||
<ClCompile Include="..\Auxiliary\DirectXTexXboxDDS.cpp" />
|
||||
<ClCompile Include="..\Auxiliary\DirectXTexXboxDetile.cpp" />
|
||||
@ -221,6 +220,7 @@
|
||||
<ClCompile Include="BC4BC5.cpp" />
|
||||
<ClCompile Include="BC6HBC7.cpp" />
|
||||
<ClInclude Include="BCDirectCompute.h" />
|
||||
<ClInclude Include="d3dx12.h" />
|
||||
<CLInclude Include="DDS.h" />
|
||||
<ClInclude Include="filters.h" />
|
||||
<CLInclude Include="scoped.h" />
|
||||
@ -268,13 +268,10 @@
|
||||
<_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/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);WindowsSDKVersion=$(_ATGFXCVer);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<Exec Condition="!Exists('Shaders/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath />
|
||||
<_ATGFXCVer />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="ATGDeleteShaders" AfterTargets="Clean">
|
||||
|
@ -39,12 +39,12 @@
|
||||
<CLInclude Include="scoped.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</CLInclude>
|
||||
<ClInclude Include="d3dx12.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Auxiliary\DirectXTexXbox.h">
|
||||
<Filter>Auxiliary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Common\d3dx12.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BC.cpp">
|
||||
|
@ -57,9 +57,9 @@
|
||||
<ClCompile Include="DirectXTexWIC.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Common\d3dx12.h" />
|
||||
<ClInclude Include="BC.h" />
|
||||
<ClInclude Include="BCDirectCompute.h" />
|
||||
<ClInclude Include="d3dx12.h" />
|
||||
<ClInclude Include="DDS.h" />
|
||||
<ClInclude Include="DirectXTex.h" />
|
||||
<ClInclude Include="DirectXTexP.h" />
|
||||
@ -195,7 +195,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
@ -221,7 +221,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
@ -245,7 +245,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
@ -271,7 +271,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
@ -295,7 +295,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
@ -320,7 +320,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\Common;$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)Shaders\Compiled;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:twoPhase- /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
@ -342,13 +342,10 @@
|
||||
<_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/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);WindowsSDKVersion=$(_ATGFXCVer);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<Exec Condition="!Exists('Shaders/Compiled/BC6HEncode_EncodeBlockCS.inc')" WorkingDirectory="$(ProjectDir)Shaders" Command="CompileShaders" EnvironmentVariables="WindowsSdkVerBinPath=$(_ATGFXCPath);CompileShadersOutput=$(ProjectDir)Shaders/Compiled" LogStandardErrorAsError="true" />
|
||||
<PropertyGroup>
|
||||
<_ATGFXCPath />
|
||||
<_ATGFXCVer />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="ATGDeleteShaders" AfterTargets="Clean">
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user