mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-04 04:16:12 +01:00
.edtiorconfig driven reformat of source (#271)
This commit is contained in:
@@ -65,12 +65,12 @@ namespace
|
||||
template<UINT TNameLength>
|
||||
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_ const char(&name)[TNameLength]) noexcept
|
||||
{
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, name);
|
||||
#else
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(resource);
|
||||
UNREFERENCED_PARAMETER(name);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
@@ -116,7 +116,7 @@ namespace
|
||||
const GUID& target;
|
||||
};
|
||||
|
||||
constexpr WICConvert g_WICConvert [] =
|
||||
constexpr WICConvert g_WICConvert[] =
|
||||
{
|
||||
// Note target GUID in this conversion table must be one of those directly supported formats (above).
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace
|
||||
|
||||
BOOL WINAPI InitializeWICFactory(PINIT_ONCE, PVOID, PVOID *ifactory) noexcept
|
||||
{
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
HRESULT hr = CoCreateInstance(
|
||||
CLSID_WICImagingFactory2,
|
||||
nullptr,
|
||||
@@ -206,14 +206,14 @@ namespace
|
||||
);
|
||||
return SUCCEEDED(hr) ? TRUE : FALSE;
|
||||
}
|
||||
#else
|
||||
#else
|
||||
return SUCCEEDED(CoCreateInstance(
|
||||
CLSID_WICImagingFactory,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(IWICImagingFactory),
|
||||
ifactory)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
IWICImagingFactory* GetWIC() noexcept
|
||||
@@ -242,13 +242,13 @@ namespace
|
||||
return g_WICFormats[i].format;
|
||||
}
|
||||
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
#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
|
||||
#endif
|
||||
|
||||
return DXGI_FORMAT_UNKNOWN;
|
||||
}
|
||||
@@ -454,7 +454,7 @@ namespace
|
||||
{
|
||||
if (memcmp(&GUID_WICPixelFormat96bppRGBFixedPoint, &pixelFormat, sizeof(WICPixelFormatGUID)) == 0)
|
||||
{
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
if (g_WIC2)
|
||||
{
|
||||
memcpy_s(&convertGUID, sizeof(WICPixelFormatGUID), &GUID_WICPixelFormat96bppRGBFloat, sizeof(GUID));
|
||||
@@ -462,7 +462,7 @@ namespace
|
||||
bpp = 96;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
memcpy_s(&convertGUID, sizeof(WICPixelFormatGUID), &GUID_WICPixelFormat128bppRGBAFloat, sizeof(GUID));
|
||||
format = DXGI_FORMAT_R32G32B32A32_FLOAT;
|
||||
@@ -493,7 +493,7 @@ namespace
|
||||
bpp = WICBitsPerPixel(pixelFormat);
|
||||
}
|
||||
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
if ((format == DXGI_FORMAT_R32G32B32_FLOAT) && d3dContext && textureView)
|
||||
{
|
||||
// Special case test for optional device support for autogen mipchains for R32G32B32_FLOAT
|
||||
@@ -507,7 +507,7 @@ namespace
|
||||
bpp = 128;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (loadFlags & WIC_LOADER_FORCE_RGBA32)
|
||||
{
|
||||
@@ -773,7 +773,7 @@ namespace
|
||||
_In_opt_ ID3D11Resource** texture,
|
||||
_In_opt_ ID3D11ShaderResourceView** textureView) noexcept
|
||||
{
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
if (texture || textureView)
|
||||
{
|
||||
CHAR strFileA[MAX_PATH];
|
||||
@@ -815,11 +815,11 @@ namespace
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(fileName);
|
||||
UNREFERENCED_PARAMETER(texture);
|
||||
UNREFERENCED_PARAMETER(textureView);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
@@ -37,12 +37,12 @@ namespace DirectX
|
||||
#define WIC_LOADER_FLAGS_DEFINED
|
||||
enum WIC_LOADER_FLAGS : uint32_t
|
||||
{
|
||||
WIC_LOADER_DEFAULT = 0,
|
||||
WIC_LOADER_FORCE_SRGB = 0x1,
|
||||
WIC_LOADER_IGNORE_SRGB = 0x2,
|
||||
WIC_LOADER_DEFAULT = 0,
|
||||
WIC_LOADER_FORCE_SRGB = 0x1,
|
||||
WIC_LOADER_IGNORE_SRGB = 0x2,
|
||||
WIC_LOADER_SRGB_DEFAULT = 0x4,
|
||||
WIC_LOADER_FIT_POW2 = 0x20,
|
||||
WIC_LOADER_MAKE_SQUARE = 0x40,
|
||||
WIC_LOADER_FIT_POW2 = 0x20,
|
||||
WIC_LOADER_MAKE_SQUARE = 0x40,
|
||||
WIC_LOADER_FORCE_RGBA32 = 0x80,
|
||||
};
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace
|
||||
const GUID& target;
|
||||
};
|
||||
|
||||
constexpr WICConvert g_WICConvert [] =
|
||||
constexpr WICConvert g_WICConvert[] =
|
||||
{
|
||||
// Note target GUID in this conversion table must be one of those directly supported formats (above).
|
||||
|
||||
@@ -198,12 +198,12 @@ namespace
|
||||
template<UINT TNameLength>
|
||||
inline void SetDebugObjectName(_In_ ID3D12DeviceChild* resource, _In_z_ const wchar_t(&name)[TNameLength]) noexcept
|
||||
{
|
||||
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
resource->SetName(name);
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(resource);
|
||||
UNREFERENCED_PARAMETER(name);
|
||||
#endif
|
||||
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
resource->SetName(name);
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(resource);
|
||||
UNREFERENCED_PARAMETER(name);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline uint32_t CountMips(uint32_t width, uint32_t height) noexcept
|
||||
@@ -634,7 +634,7 @@ namespace
|
||||
_In_z_ const wchar_t* fileName,
|
||||
_In_ ID3D12Resource** texture) noexcept
|
||||
{
|
||||
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
#if !defined(NO_D3D12_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
if (texture && *texture)
|
||||
{
|
||||
const wchar_t* pstrName = wcsrchr(fileName, '\\');
|
||||
@@ -649,10 +649,10 @@ namespace
|
||||
|
||||
(*texture)->SetName(pstrName);
|
||||
}
|
||||
#else
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(fileName);
|
||||
UNREFERENCED_PARAMETER(texture);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ namespace DirectX
|
||||
#define WIC_LOADER_FLAGS_DEFINED
|
||||
enum WIC_LOADER_FLAGS : uint32_t
|
||||
{
|
||||
WIC_LOADER_DEFAULT = 0,
|
||||
WIC_LOADER_FORCE_SRGB = 0x1,
|
||||
WIC_LOADER_IGNORE_SRGB = 0x2,
|
||||
WIC_LOADER_DEFAULT = 0,
|
||||
WIC_LOADER_FORCE_SRGB = 0x1,
|
||||
WIC_LOADER_IGNORE_SRGB = 0x2,
|
||||
WIC_LOADER_SRGB_DEFAULT = 0x4,
|
||||
WIC_LOADER_MIP_AUTOGEN = 0x8,
|
||||
WIC_LOADER_MIP_RESERVE = 0x10,
|
||||
WIC_LOADER_FIT_POW2 = 0x20,
|
||||
WIC_LOADER_MAKE_SQUARE = 0x40,
|
||||
WIC_LOADER_MIP_AUTOGEN = 0x8,
|
||||
WIC_LOADER_MIP_RESERVE = 0x10,
|
||||
WIC_LOADER_FIT_POW2 = 0x20,
|
||||
WIC_LOADER_MAKE_SQUARE = 0x40,
|
||||
WIC_LOADER_FORCE_RGBA32 = 0x80,
|
||||
};
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace
|
||||
const GUID& target;
|
||||
};
|
||||
|
||||
constexpr WICConvert g_WICConvert [] =
|
||||
constexpr WICConvert g_WICConvert[] =
|
||||
{
|
||||
// Note target GUID in this conversion table must be one of those directly supported formats (above).
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace
|
||||
//--------------------------------------------------------------------------------------
|
||||
BOOL WINAPI InitializeWICFactory(PINIT_ONCE, PVOID, PVOID* ifactory) noexcept
|
||||
{
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
HRESULT hr = CoCreateInstance(
|
||||
CLSID_WICImagingFactory2,
|
||||
nullptr,
|
||||
@@ -187,14 +187,14 @@ namespace
|
||||
);
|
||||
return SUCCEEDED(hr) ? TRUE : FALSE;
|
||||
}
|
||||
#else
|
||||
#else
|
||||
return SUCCEEDED(CoCreateInstance(
|
||||
CLSID_WICImagingFactory,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(IWICImagingFactory),
|
||||
ifactory)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
IWICImagingFactory* GetWIC() noexcept
|
||||
|
||||
@@ -35,10 +35,10 @@ namespace DirectX
|
||||
#define WIC_LOADER_FLAGS_DEFINED
|
||||
enum WIC_LOADER_FLAGS : uint32_t
|
||||
{
|
||||
WIC_LOADER_DEFAULT = 0,
|
||||
WIC_LOADER_MIP_AUTOGEN = 0x8,
|
||||
WIC_LOADER_FIT_POW2 = 0x20,
|
||||
WIC_LOADER_MAKE_SQUARE = 0x40,
|
||||
WIC_LOADER_DEFAULT = 0,
|
||||
WIC_LOADER_MIP_AUTOGEN = 0x8,
|
||||
WIC_LOADER_FIT_POW2 = 0x20,
|
||||
WIC_LOADER_MAKE_SQUARE = 0x40,
|
||||
WIC_LOADER_FORCE_RGBA32 = 0x80,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user