1
0
mirror of https://github.com/microsoft/DirectXTex synced 2024-11-08 22:10:05 +00:00

Fix build break for Debug on WSL (#299)

This commit is contained in:
Chuck Walbourn 2022-12-27 12:03:08 -08:00 committed by GitHub
parent 23b7fd1f38
commit e4f5af944c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 18 deletions

View File

@ -27,6 +27,8 @@ option(BC_USE_OPENMP "Build with OpenMP support" ON)
# https://devblogs.microsoft.com/cppblog/spectre-mitigations-in-msvc/
option(ENABLE_SPECTRE_MITIGATION "Build using /Qspectre for MSVC" OFF)
option(DISABLE_MSVC_ITERATOR_DEBUGGING "Disable iterator debugging in Debug configurations with the MSVC CRT" OFF)
option(ENABLE_CODE_ANALYSIS "Use Static Code Analysis on build" OFF)
option(USE_PREBUILT_SHADERS "Use externally built HLSL shaders" OFF)
@ -415,6 +417,12 @@ if(WIN32)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_definitions(${t} PRIVATE _UNICODE UNICODE _WIN32_WINNT=${WINVER})
endforeach()
if(DISABLE_MSVC_ITERATOR_DEBUGGING)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_definitions(${t} PRIVATE _ITERATOR_DEBUG_LEVEL=0)
endforeach()
endif()
endif()
if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE))

View File

@ -1696,7 +1696,7 @@ void D3DX_BC6H::Decode(bool bSigned, HDRColorA* pOut) const noexcept
case BZ: aEndPts[1].B.b |= 1 << uint32_t(desc[uCurBit].m_uBit); break;
default:
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC6H: Invalid header bits encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -1740,7 +1740,7 @@ void D3DX_BC6H::Decode(bool bSigned, HDRColorA* pOut) const noexcept
const size_t uNumBits = IsFixUpOffset(info.uPartitions, uShape, i) ? info.uIndexPrec - 1u : info.uIndexPrec;
if (uStartBit + uNumBits > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC6H: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -1750,7 +1750,7 @@ void D3DX_BC6H::Decode(bool bSigned, HDRColorA* pOut) const noexcept
if (uIndex >= ((info.uPartitions > 0) ? 8 : 16))
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC6H: Invalid index encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -1785,7 +1785,7 @@ void D3DX_BC6H::Decode(bool bSigned, HDRColorA* pOut) const noexcept
}
else
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
const char* warnstr = "BC6H: Invalid mode encountered during decoding\n";
switch (uMode)
{
@ -2596,7 +2596,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
{
if (uStartBit + RGBAPrec.r > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2611,7 +2611,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
{
if (uStartBit + RGBAPrec.g > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2626,7 +2626,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
{
if (uStartBit + RGBAPrec.b > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2641,7 +2641,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
{
if (uStartBit + RGBAPrec.a > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2658,7 +2658,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
{
if (uStartBit > 127)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2696,7 +2696,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
const size_t uNumBits = IsFixUpOffset(ms_aInfo[uMode].uPartitions, uShape, i) ? uIndexPrec - 1u : uIndexPrec;
if (uStartBit + uNumBits > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2713,7 +2713,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
const size_t uNumBits = i ? uIndexPrec2 : uIndexPrec2 - 1u;
if (uStartBit + uNumBits > 128)
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Invalid block encountered during decoding\n");
#endif
FillWithErrorColors(pOut);
@ -2755,7 +2755,7 @@ void D3DX_BC7::Decode(HDRColorA* pOut) const noexcept
}
else
{
#ifdef _DEBUG
#if defined(_WIN32) && defined(_DEBUG)
OutputDebugStringA("BC7: Reserved mode 8 encountered during decoding\n");
#endif
// Per the BC7 format spec, we must return transparent black

View File

@ -90,12 +90,22 @@ jobs:
}
- task: CMake@1
displayName: CMake DirectXTex
displayName: CMake DirectXTex (Config) dbg
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: -B out -DCMAKE_PREFIX_PATH=$(DEST_DIR)usr/local/share;$(DEST_DIR)usr/local/cmake
cmakeArgs: -B out -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=$(DEST_DIR)usr/local/share;$(DEST_DIR)usr/local/cmake
- task: CMake@1
displayName: CMake DirectXTex (Build)
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=$(DEST_DIR)usr/local/share;$(DEST_DIR)usr/local/cmake
- task: CMake@1
displayName: CMake DirectXTex (Build) rel
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out2 -v

View File

@ -90,12 +90,22 @@ jobs:
}
- task: CMake@1
displayName: CMake DirectXTex
displayName: CMake DirectXTex (Config) dbg
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: -B out -DCMAKE_PREFIX_PATH=$(DEST_DIR)usr/local/share;$(DEST_DIR)usr/local/cmake
cmakeArgs: -B out -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=$(DEST_DIR)usr/local/share;$(DEST_DIR)usr/local/cmake
- task: CMake@1
displayName: CMake DirectXTex (Build)
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=$(DEST_DIR)usr/local/share;$(DEST_DIR)usr/local/cmake
- task: CMake@1
displayName: CMake DirectXTex (Build) rel
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out2 -v