diff --git a/DirectXTex/DirectXTex.h b/DirectXTex/DirectXTex.h index 4d08229..4ee0a39 100644 --- a/DirectXTex/DirectXTex.h +++ b/DirectXTex/DirectXTex.h @@ -17,7 +17,9 @@ #include #if !defined(__d3d11_h__) && !defined(__d3d11_x_h__) && !defined(__d3d12_h__) && !defined(__d3d12_x_h__) && !defined(__XBOX_D3D12_X__) -#if defined(_XBOX_ONE) && defined(_TITLE) +#ifdef _GAMING_XBOX +#include +#elif defined(_XBOX_ONE) && defined(_TITLE) #include #else #include diff --git a/DirectXTex/DirectXTexConvert.cpp b/DirectXTex/DirectXTexConvert.cpp index 7634ffd..16c2fbe 100644 --- a/DirectXTex/DirectXTexConvert.cpp +++ b/DirectXTex/DirectXTexConvert.cpp @@ -4407,13 +4407,13 @@ namespace } // Check for special cases -#if defined(_XBOX_ONE) && defined(_TITLE) +#if (defined(_XBOX_ONE) && defined(_TITLE)) || defined(_GAMING_XBOX) if (sformat == DXGI_FORMAT_R16G16B16A16_FLOAT || sformat == DXGI_FORMAT_R16_FLOAT || tformat == DXGI_FORMAT_R16G16B16A16_FLOAT || tformat == DXGI_FORMAT_R16_FLOAT) { - // Use non-WIC code paths as these conversions are not supported by Xbox One XDK + // Use non-WIC code paths as these conversions are not supported by Xbox version of WIC return false; } #endif diff --git a/DirectXTex/DirectXTexD3D11.cpp b/DirectXTex/DirectXTexD3D11.cpp index 872d243..00c7127 100644 --- a/DirectXTex/DirectXTexD3D11.cpp +++ b/DirectXTex/DirectXTexD3D11.cpp @@ -11,7 +11,9 @@ #include "DirectXTexP.h" -#if !defined(_XBOX_ONE) || !defined(_TITLE) +#ifdef _GAMING_XBOX +#error This module is not supported for GDK +#elif !defined(_XBOX_ONE) || !defined(_TITLE) #include #endif diff --git a/DirectXTex/DirectXTexD3D12.cpp b/DirectXTex/DirectXTexD3D12.cpp index 7aa4c10..9463846 100644 --- a/DirectXTex/DirectXTexD3D12.cpp +++ b/DirectXTex/DirectXTexD3D12.cpp @@ -16,7 +16,7 @@ #pragma clang diagnostic ignored "-Wsign-conversion" #endif -#if defined(_XBOX_ONE) && defined(_TITLE) +#if (defined(_XBOX_ONE) && defined(_TITLE)) || defined(_GAMING_XBOX) #include "d3dx12_x.h" #else #define D3DX12_NO_STATE_OBJECT_HELPERS diff --git a/DirectXTex/DirectXTexMipmaps.cpp b/DirectXTex/DirectXTexMipmaps.cpp index d9753bb..c496ac4 100644 --- a/DirectXTex/DirectXTexMipmaps.cpp +++ b/DirectXTex/DirectXTexMipmaps.cpp @@ -632,11 +632,11 @@ namespace return false; } -#if defined(_XBOX_ONE) && defined(_TITLE) +#if (defined(_XBOX_ONE) && defined(_TITLE)) || defined(_GAMING_XBOX) if (format == DXGI_FORMAT_R16G16B16A16_FLOAT || format == DXGI_FORMAT_R16_FLOAT) { - // Use non-WIC code paths as these conversions are not supported by Xbox One XDK + // Use non-WIC code paths as these conversions are not supported by Xbox version of WIC return false; } #endif diff --git a/DirectXTex/DirectXTexP.h b/DirectXTex/DirectXTexP.h index adbc635..073063d 100644 --- a/DirectXTex/DirectXTexP.h +++ b/DirectXTex/DirectXTexP.h @@ -91,7 +91,9 @@ #include -#if defined(_XBOX_ONE) && defined(_TITLE) +#ifdef _GAMING_XBOX +#include +#elif defined(_XBOX_ONE) && defined(_TITLE) #include #include #elif (_WIN32_WINNT >= _WIN32_WINNT_WIN10) diff --git a/DirectXTex/DirectXTexResize.cpp b/DirectXTex/DirectXTexResize.cpp index 4f94287..5e845e7 100644 --- a/DirectXTex/DirectXTexResize.cpp +++ b/DirectXTex/DirectXTexResize.cpp @@ -190,11 +190,11 @@ namespace return false; } -#if defined(_XBOX_ONE) && defined(_TITLE) +#if (defined(_XBOX_ONE) && defined(_TITLE)) || defined(_GAMING_XBOX) if (format == DXGI_FORMAT_R16G16B16A16_FLOAT || format == DXGI_FORMAT_R16_FLOAT) { - // Use non-WIC code paths as these conversions are not supported by Xbox One XDK + // Use non-WIC code paths as these conversions are not supported by Xbox version of WIC return false; } #endif diff --git a/DirectXTex/DirectXTexUtil.cpp b/DirectXTex/DirectXTexUtil.cpp index b3bbf31..795d9f2 100644 --- a/DirectXTex/DirectXTexUtil.cpp +++ b/DirectXTex/DirectXTexUtil.cpp @@ -11,14 +11,14 @@ #include "DirectXTexP.h" -#if defined(_XBOX_ONE) && defined(_TITLE) -static_assert(XBOX_DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT == DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT, "Xbox One XDK mismatch detected"); -static_assert(XBOX_DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT == DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT, "Xbox One XDK mismatch detected"); -static_assert(XBOX_DXGI_FORMAT_D16_UNORM_S8_UINT == DXGI_FORMAT_D16_UNORM_S8_UINT, "Xbox One XDK mismatch detected"); -static_assert(XBOX_DXGI_FORMAT_R16_UNORM_X8_TYPELESS == DXGI_FORMAT_R16_UNORM_X8_TYPELESS, "Xbox One XDK mismatch detected"); -static_assert(XBOX_DXGI_FORMAT_X16_TYPELESS_G8_UINT == DXGI_FORMAT_X16_TYPELESS_G8_UINT, "Xbox One XDK mismatch detected"); -static_assert(XBOX_DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM == DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM, "Xbox One XDK mismatch detected"); -static_assert(XBOX_DXGI_FORMAT_R4G4_UNORM == DXGI_FORMAT_R4G4_UNORM, "Xbox One XDK mismatch detected"); +#if (defined(_XBOX_ONE) && defined(_TITLE)) || defined(_GAMING_XBOX) +static_assert(XBOX_DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT == DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT, "Xbox mismatch detected"); +static_assert(XBOX_DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT == DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT, "Xbox mismatch detected"); +static_assert(XBOX_DXGI_FORMAT_D16_UNORM_S8_UINT == DXGI_FORMAT_D16_UNORM_S8_UINT, "Xbox mismatch detected"); +static_assert(XBOX_DXGI_FORMAT_R16_UNORM_X8_TYPELESS == DXGI_FORMAT_R16_UNORM_X8_TYPELESS, "Xbox mismatch detected"); +static_assert(XBOX_DXGI_FORMAT_X16_TYPELESS_G8_UINT == DXGI_FORMAT_X16_TYPELESS_G8_UINT, "Xbox mismatch detected"); +static_assert(XBOX_DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM == DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM, "Xbox mismatch detected"); +static_assert(XBOX_DXGI_FORMAT_R4G4_UNORM == DXGI_FORMAT_R4G4_UNORM, "Xbox mismatch detected"); #endif #if (_WIN32_WINNT >= _WIN32_WINNT_WIN10) diff --git a/DirectXTex/DirectXTexWIC.cpp b/DirectXTex/DirectXTexWIC.cpp index f6be52a..9b73048 100644 --- a/DirectXTex/DirectXTexWIC.cpp +++ b/DirectXTex/DirectXTexWIC.cpp @@ -334,7 +334,7 @@ namespace sRGB = (flags & WIC_FLAGS_DEFAULT_SRGB) != 0; } } -#if defined(_XBOX_ONE) && defined(_TITLE) +#if (defined(_XBOX_ONE) && defined(_TITLE)) || defined(_GAMING_XBOX) else if (memcmp(&containerFormat, &GUID_ContainerFormatJpeg, sizeof(GUID)) == 0) { if (SUCCEEDED(metareader->GetMetadataByName(L"/app1/ifd/exif/{ushort=40961}", &value)) && value.vt == VT_UI2) @@ -642,7 +642,7 @@ namespace (void)metawriter->RemoveMetadataByName(L"/sRGB/RenderingIntent"); } } -#if defined(_XBOX_ONE) && defined(_TITLE) +#if (defined(_XBOX_ONE) && defined(_TITLE)) || defined(_GAMING_XBOX) else if (memcmp(&containerFormat, &GUID_ContainerFormatJpeg, sizeof(GUID)) == 0) { // Set Software name