From 55b93efe35c6e02a98a761ff2d03d6af89e908ab Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 3 Sep 2024 11:52:27 -0700 Subject: [PATCH] ADO test pipeline updates (#504) --- Auxiliary/DirectXTexJPEG.cpp | 10 +++++++--- CMakePresets.json | 5 ++++- build/DirectXTex-GitHub-Test-Dev17.yml | 9 +++++++++ build/DirectXTex-GitHub-Test.yml | 9 +++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Auxiliary/DirectXTexJPEG.cpp b/Auxiliary/DirectXTexJPEG.cpp index 3828ac0..e54c888 100644 --- a/Auxiliary/DirectXTexJPEG.cpp +++ b/Auxiliary/DirectXTexJPEG.cpp @@ -141,11 +141,15 @@ namespace metadata.arraySize = 1; metadata.mipLevels = 1; metadata.dimension = TEX_DIMENSION_TEXTURE2D; - metadata.miscFlags2 |= TEX_ALPHA_MODE_OPAQUE; - metadata.format = TranslateColor(dec.out_color_space); if (metadata.format == DXGI_FORMAT_UNKNOWN) + { throw std::runtime_error{ "unexpected out_color_space in jpeg_decompress_struct" }; + } + if (metadata.format == DXGI_FORMAT_R8G8B8A8_UNORM) + { + metadata.miscFlags2 |= TEX_ALPHA_MODE_OPAQUE; + } } HRESULT GetHeader(TexMetadata& metadata) noexcept(false) @@ -293,7 +297,7 @@ namespace #endif default: - return E_INVALIDARG; + return HRESULT_E_NOT_SUPPORTED; } enc.image_width = static_cast(image.width); enc.image_height = static_cast(image.height); diff --git a/CMakePresets.json b/CMakePresets.json index b806d08..c2581be 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -381,6 +381,9 @@ { "name": "x64-Release-ICC" , "configurePreset": "x64-Release-ICC"}, { "name": "x64-Debug-ICX" , "configurePreset": "x64-Debug-ICX" }, - { "name": "x64-Release-ICX" , "configurePreset": "x64-Release-ICX"} + { "name": "x64-Release-ICX" , "configurePreset": "x64-Release-ICX"}, + + { "name": "x64-Debug-JPEG-PNG" , "configurePreset": "x64-Debug-JPEG-PNG" }, + { "name": "x64-Release-JPEG-PNG", "configurePreset": "x64-Release-JPEG-PNG"} ] } \ No newline at end of file diff --git a/build/DirectXTex-GitHub-Test-Dev17.yml b/build/DirectXTex-GitHub-Test-Dev17.yml index e02d00f..5977ec7 100644 --- a/build/DirectXTex-GitHub-Test-Dev17.yml +++ b/build/DirectXTex-GitHub-Test-Dev17.yml @@ -38,6 +38,7 @@ variables: Codeql.Enabled: false VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC' GITHUB_PAT: $(GITHUBPUBLICTOKEN) + GUID_FEED: $(ADOFeedGUID) jobs: - job: DESKTOP_BUILD @@ -61,6 +62,14 @@ jobs: script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests workingDirectory: $(Build.SourcesDirectory) failOnStderr: true + - 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 32dbg inputs: diff --git a/build/DirectXTex-GitHub-Test.yml b/build/DirectXTex-GitHub-Test.yml index 212322c..5b5ac46 100644 --- a/build/DirectXTex-GitHub-Test.yml +++ b/build/DirectXTex-GitHub-Test.yml @@ -36,6 +36,7 @@ pool: variables: Codeql.Enabled: false GITHUB_PAT: $(GITHUBPUBLICTOKEN) + GUID_FEED: $(ADOFeedGUID) jobs: - job: DESKTOP_BUILD @@ -59,6 +60,14 @@ jobs: script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtextest.git Tests workingDirectory: $(Build.SourcesDirectory) failOnStderr: true + - 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 32dbg inputs: