mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-16 15:00:14 +02:00
texconv/diag/assemble updated with format name aliases like DXT3 and FP16
This commit is contained in:
parent
dce34a8b2b
commit
2b2f90259a
@ -220,6 +220,14 @@ const SValue g_pFormats [] =
|
|||||||
{ nullptr, DXGI_FORMAT_UNKNOWN }
|
{ nullptr, DXGI_FORMAT_UNKNOWN }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const SValue g_pFormatAliases [] =
|
||||||
|
{
|
||||||
|
{ L"FP16", DXGI_FORMAT_R16G16B16A16_FLOAT },
|
||||||
|
{ L"FP32", DXGI_FORMAT_R32G32B32A32_FLOAT },
|
||||||
|
|
||||||
|
{ nullptr, DXGI_FORMAT_UNKNOWN }
|
||||||
|
};
|
||||||
|
|
||||||
const SValue g_pFilters [] =
|
const SValue g_pFilters [] =
|
||||||
{
|
{
|
||||||
{ L"POINT", TEX_FILTER_POINT },
|
{ L"POINT", TEX_FILTER_POINT },
|
||||||
@ -518,6 +526,8 @@ namespace
|
|||||||
|
|
||||||
wprintf(L"\n <format>: ");
|
wprintf(L"\n <format>: ");
|
||||||
PrintList(13, g_pFormats);
|
PrintList(13, g_pFormats);
|
||||||
|
wprintf(L" ");
|
||||||
|
PrintList(13, g_pFormatAliases);
|
||||||
|
|
||||||
wprintf(L"\n <filter>: ");
|
wprintf(L"\n <filter>: ");
|
||||||
PrintList(13, g_pFilters);
|
PrintList(13, g_pFilters);
|
||||||
@ -1016,11 +1026,15 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case OPT_FORMAT:
|
case OPT_FORMAT:
|
||||||
format = (DXGI_FORMAT)LookupByName(pValue, g_pFormats);
|
format = static_cast<DXGI_FORMAT>(LookupByName(pValue, g_pFormats));
|
||||||
if (!format)
|
if (!format)
|
||||||
{
|
{
|
||||||
wprintf(L"Invalid value specified with -f (%ls)\n", pValue);
|
format = static_cast<DXGI_FORMAT>(LookupByName(pValue, g_pFormatAliases));
|
||||||
return 1;
|
if (!format)
|
||||||
|
{
|
||||||
|
wprintf(L"Invalid value specified with -f (%ls)\n", pValue);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -280,6 +280,20 @@ const SValue g_pFormats[] =
|
|||||||
{ nullptr, DXGI_FORMAT_UNKNOWN }
|
{ nullptr, DXGI_FORMAT_UNKNOWN }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const SValue g_pFormatAliases[] =
|
||||||
|
{
|
||||||
|
{ L"DXT1", DXGI_FORMAT_BC1_UNORM },
|
||||||
|
{ L"DXT2", DXGI_FORMAT_BC2_UNORM },
|
||||||
|
{ L"DXT3", DXGI_FORMAT_BC2_UNORM },
|
||||||
|
{ L"DXT4", DXGI_FORMAT_BC3_UNORM },
|
||||||
|
{ L"DXT5", DXGI_FORMAT_BC3_UNORM },
|
||||||
|
|
||||||
|
{ L"FP16", DXGI_FORMAT_R16G16B16A16_FLOAT },
|
||||||
|
{ L"FP32", DXGI_FORMAT_R32G32B32A32_FLOAT },
|
||||||
|
|
||||||
|
{ nullptr, DXGI_FORMAT_UNKNOWN }
|
||||||
|
};
|
||||||
|
|
||||||
const SValue g_pReadOnlyFormats[] =
|
const SValue g_pReadOnlyFormats[] =
|
||||||
{
|
{
|
||||||
DEFFMT(R32G32B32A32_TYPELESS),
|
DEFFMT(R32G32B32A32_TYPELESS),
|
||||||
@ -730,6 +744,8 @@ namespace
|
|||||||
|
|
||||||
wprintf(L"\n <format>: ");
|
wprintf(L"\n <format>: ");
|
||||||
PrintList(13, g_pFormats);
|
PrintList(13, g_pFormats);
|
||||||
|
wprintf(L" ");
|
||||||
|
PrintList(13, g_pFormatAliases);
|
||||||
|
|
||||||
wprintf(L"\n <filter>: ");
|
wprintf(L"\n <filter>: ");
|
||||||
PrintList(13, g_pFilters);
|
PrintList(13, g_pFilters);
|
||||||
@ -1080,13 +1096,17 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case OPT_FORMAT:
|
case OPT_FORMAT:
|
||||||
format = (DXGI_FORMAT)LookupByName(pValue, g_pFormats);
|
format = static_cast<DXGI_FORMAT>(LookupByName(pValue, g_pFormats));
|
||||||
if (!format)
|
if (!format)
|
||||||
{
|
{
|
||||||
wprintf(L"Invalid value specified with -f (%ls)\n", pValue);
|
format = static_cast<DXGI_FORMAT>(LookupByName(pValue, g_pFormatAliases));
|
||||||
wprintf(L"\n");
|
if (!format)
|
||||||
PrintUsage();
|
{
|
||||||
return 1;
|
wprintf(L"Invalid value specified with -f (%ls)\n", pValue);
|
||||||
|
wprintf(L"\n");
|
||||||
|
PrintUsage();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -196,6 +196,14 @@ const SValue g_pFormats[] =
|
|||||||
{ nullptr, DXGI_FORMAT_UNKNOWN }
|
{ nullptr, DXGI_FORMAT_UNKNOWN }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const SValue g_pFormatAliases [] =
|
||||||
|
{
|
||||||
|
{ L"FP16", DXGI_FORMAT_R16G16B16A16_FLOAT },
|
||||||
|
{ L"FP32", DXGI_FORMAT_R32G32B32A32_FLOAT },
|
||||||
|
|
||||||
|
{ nullptr, DXGI_FORMAT_UNKNOWN }
|
||||||
|
};
|
||||||
|
|
||||||
const SValue g_pReadOnlyFormats[] =
|
const SValue g_pReadOnlyFormats[] =
|
||||||
{
|
{
|
||||||
DEFFMT(R32G32B32A32_TYPELESS),
|
DEFFMT(R32G32B32A32_TYPELESS),
|
||||||
@ -542,6 +550,8 @@ namespace
|
|||||||
|
|
||||||
wprintf(L"\n <format>: ");
|
wprintf(L"\n <format>: ");
|
||||||
PrintList(13, g_pFormats);
|
PrintList(13, g_pFormats);
|
||||||
|
wprintf(L" ");
|
||||||
|
PrintList(13, g_pFormatAliases);
|
||||||
|
|
||||||
wprintf(L"\n <filter>: ");
|
wprintf(L"\n <filter>: ");
|
||||||
PrintList(13, g_pFilters);
|
PrintList(13, g_pFilters);
|
||||||
@ -3098,11 +3108,15 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
diffFormat = (DXGI_FORMAT)LookupByName(pValue, g_pFormats);
|
diffFormat = static_cast<DXGI_FORMAT>(LookupByName(pValue, g_pFormats));
|
||||||
if (!diffFormat)
|
if (!diffFormat)
|
||||||
{
|
{
|
||||||
wprintf(L"Invalid value specified with -f (%ls)\n", pValue);
|
diffFormat = static_cast<DXGI_FORMAT>(LookupByName(pValue, g_pFormatAliases));
|
||||||
return 1;
|
if (!diffFormat)
|
||||||
|
{
|
||||||
|
wprintf(L"Invalid value specified with -f (%ls)\n", pValue);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user