mirror of
https://github.com/microsoft/DirectXTex
synced 2024-12-26 03:11:02 +00:00
Avoid static initialization order fiasco (#196)
This commit is contained in:
parent
01823b7830
commit
216e2b0388
@ -37,12 +37,12 @@ namespace
|
|||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
struct WICTranslate
|
struct WICTranslate
|
||||||
{
|
{
|
||||||
GUID wic;
|
const GUID& wic;
|
||||||
DXGI_FORMAT format;
|
DXGI_FORMAT format;
|
||||||
bool srgb;
|
bool srgb;
|
||||||
};
|
};
|
||||||
|
|
||||||
const WICTranslate g_WICFormats[] =
|
constexpr WICTranslate g_WICFormats[] =
|
||||||
{
|
{
|
||||||
{ GUID_WICPixelFormat128bppRGBAFloat, DXGI_FORMAT_R32G32B32A32_FLOAT, false },
|
{ GUID_WICPixelFormat128bppRGBAFloat, DXGI_FORMAT_R32G32B32A32_FLOAT, false },
|
||||||
|
|
||||||
|
@ -79,12 +79,12 @@ namespace
|
|||||||
|
|
||||||
struct WICConvert
|
struct WICConvert
|
||||||
{
|
{
|
||||||
GUID source;
|
const GUID& source;
|
||||||
GUID target;
|
const GUID& target;
|
||||||
TEX_ALPHA_MODE alphaMode;
|
TEX_ALPHA_MODE alphaMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
const WICConvert g_WICConvert[] =
|
constexpr WICConvert g_WICConvert[] =
|
||||||
{
|
{
|
||||||
// Directly support the formats listed in XnaTexUtil::g_WICFormats, so no conversion required
|
// Directly support the formats listed in XnaTexUtil::g_WICFormats, so no conversion required
|
||||||
// Note target GUID in this conversion table must be one of those directly supported formats.
|
// Note target GUID in this conversion table must be one of those directly supported formats.
|
||||||
|
@ -63,11 +63,11 @@ namespace
|
|||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
struct WICTranslate
|
struct WICTranslate
|
||||||
{
|
{
|
||||||
GUID wic;
|
const GUID& wic;
|
||||||
DXGI_FORMAT format;
|
DXGI_FORMAT format;
|
||||||
};
|
};
|
||||||
|
|
||||||
const WICTranslate g_WICFormats[] =
|
constexpr WICTranslate g_WICFormats[] =
|
||||||
{
|
{
|
||||||
{ GUID_WICPixelFormat128bppRGBAFloat, DXGI_FORMAT_R32G32B32A32_FLOAT },
|
{ GUID_WICPixelFormat128bppRGBAFloat, DXGI_FORMAT_R32G32B32A32_FLOAT },
|
||||||
|
|
||||||
@ -98,11 +98,11 @@ namespace
|
|||||||
|
|
||||||
struct WICConvert
|
struct WICConvert
|
||||||
{
|
{
|
||||||
GUID source;
|
const GUID& source;
|
||||||
GUID target;
|
const GUID& target;
|
||||||
};
|
};
|
||||||
|
|
||||||
const WICConvert g_WICConvert[] =
|
constexpr WICConvert g_WICConvert[] =
|
||||||
{
|
{
|
||||||
// Note target GUID in this conversion table must be one of those directly supported formats (above).
|
// Note target GUID in this conversion table must be one of those directly supported formats (above).
|
||||||
|
|
||||||
|
@ -50,11 +50,11 @@ namespace
|
|||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
struct WICTranslate
|
struct WICTranslate
|
||||||
{
|
{
|
||||||
GUID wic;
|
const GUID& wic;
|
||||||
DXGI_FORMAT format;
|
DXGI_FORMAT format;
|
||||||
};
|
};
|
||||||
|
|
||||||
const WICTranslate g_WICFormats[] =
|
constexpr WICTranslate g_WICFormats[] =
|
||||||
{
|
{
|
||||||
{ GUID_WICPixelFormat128bppRGBAFloat, DXGI_FORMAT_R32G32B32A32_FLOAT },
|
{ GUID_WICPixelFormat128bppRGBAFloat, DXGI_FORMAT_R32G32B32A32_FLOAT },
|
||||||
|
|
||||||
@ -87,11 +87,11 @@ namespace
|
|||||||
|
|
||||||
struct WICConvert
|
struct WICConvert
|
||||||
{
|
{
|
||||||
GUID source;
|
const GUID& source;
|
||||||
GUID target;
|
const GUID& target;
|
||||||
};
|
};
|
||||||
|
|
||||||
const WICConvert g_WICConvert[] =
|
constexpr WICConvert g_WICConvert[] =
|
||||||
{
|
{
|
||||||
// Note target GUID in this conversion table must be one of those directly supported formats (above).
|
// Note target GUID in this conversion table must be one of those directly supported formats (above).
|
||||||
|
|
||||||
|
@ -47,11 +47,11 @@ namespace
|
|||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
struct WICTranslate
|
struct WICTranslate
|
||||||
{
|
{
|
||||||
GUID wic;
|
const GUID& wic;
|
||||||
D3DFORMAT format;
|
D3DFORMAT format;
|
||||||
};
|
};
|
||||||
|
|
||||||
const WICTranslate g_WICFormats[] =
|
constexpr WICTranslate g_WICFormats[] =
|
||||||
{
|
{
|
||||||
{ GUID_WICPixelFormat128bppRGBAFloat, D3DFMT_A32B32G32R32F },
|
{ GUID_WICPixelFormat128bppRGBAFloat, D3DFMT_A32B32G32R32F },
|
||||||
|
|
||||||
@ -80,11 +80,11 @@ namespace
|
|||||||
|
|
||||||
struct WICConvert
|
struct WICConvert
|
||||||
{
|
{
|
||||||
GUID source;
|
const GUID& source;
|
||||||
GUID target;
|
const GUID& target;
|
||||||
};
|
};
|
||||||
|
|
||||||
const WICConvert g_WICConvert[] =
|
constexpr WICConvert g_WICConvert[] =
|
||||||
{
|
{
|
||||||
// Note target GUID in this conversion table must be one of those directly supported formats (above).
|
// Note target GUID in this conversion table must be one of those directly supported formats (above).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user