mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-04 04:16:12 +01:00
NVTT 1.x wrote A8L8 as RGB instead of LUMINANCE (#229)
This commit is contained in:
@@ -701,6 +701,11 @@ namespace
|
||||
return DXGI_FORMAT_B4G4R4A4_UNORM;
|
||||
}
|
||||
|
||||
if (ISBITMASK(0x00ff, 0, 0, 0xff00))
|
||||
{
|
||||
return DXGI_FORMAT_R8G8_UNORM; // NVTT versions 1.x wrote this as RGB instead of LUMINANCE
|
||||
}
|
||||
|
||||
// No DXGI format maps to ISBITMASK(0x0f00,0x00f0,0x000f,0) aka D3DFMT_X4R4G4B4
|
||||
|
||||
// No 3:3:2, 3:3:2:8, or paletted DXGI formats aka D3DFMT_A8R3G3B2, D3DFMT_R3G3B2, D3DFMT_P8, D3DFMT_A8P8, etc.
|
||||
|
||||
@@ -781,6 +781,11 @@ namespace
|
||||
return DXGI_FORMAT_B4G4R4A4_UNORM;
|
||||
}
|
||||
|
||||
if (ISBITMASK(0x00ff, 0, 0, 0xff00))
|
||||
{
|
||||
return DXGI_FORMAT_R8G8_UNORM; // NVTT versions 1.x wrote this as RGB instead of LUMINANCE
|
||||
}
|
||||
|
||||
// No DXGI format maps to ISBITMASK(0x0f00,0x00f0,0x000f,0) aka D3DFMT_X4R4G4B4
|
||||
|
||||
// No 3:3:2, 3:3:2:8, or paletted DXGI formats aka D3DFMT_A8R3G3B2, D3DFMT_R3G3B2, D3DFMT_P8, D3DFMT_A8P8, etc.
|
||||
|
||||
@@ -585,6 +585,10 @@ namespace
|
||||
{
|
||||
return D3DFMT_A8R3G3B2;
|
||||
}
|
||||
if (ISBITMASK(0x00ff, 0, 0, 0xff00))
|
||||
{
|
||||
return D3DFMT_A8L8; // NVTT versions 1.x wrote this as RGB instead of LUMINANCE
|
||||
}
|
||||
break;
|
||||
|
||||
case 8:
|
||||
@@ -609,6 +613,10 @@ namespace
|
||||
{
|
||||
return D3DFMT_L8;
|
||||
}
|
||||
if (ISBITMASK(0x00ff, 0, 0, 0xff00))
|
||||
{
|
||||
return D3DFMT_A8L8; // Some DDS writers assume the bitcount should be 8 instead of 16
|
||||
}
|
||||
}
|
||||
|
||||
if (16 == ddpf.RGBBitCount)
|
||||
|
||||
Reference in New Issue
Block a user