texconv/diag/assemble updated with format name aliases like DXT3 and FP16

This commit is contained in:
Chuck Walbourn
2018-02-22 00:17:49 -08:00
parent dce34a8b2b
commit 2b2f90259a
3 changed files with 59 additions and 11 deletions

View File

@@ -196,6 +196,14 @@ const SValue g_pFormats[] =
{ 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[] =
{
DEFFMT(R32G32B32A32_TYPELESS),
@@ -542,6 +550,8 @@ namespace
wprintf(L"\n <format>: ");
PrintList(13, g_pFormats);
wprintf(L" ");
PrintList(13, g_pFormatAliases);
wprintf(L"\n <filter>: ");
PrintList(13, g_pFilters);
@@ -3098,11 +3108,15 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
}
else
{
diffFormat = (DXGI_FORMAT)LookupByName(pValue, g_pFormats);
diffFormat = static_cast<DXGI_FORMAT>(LookupByName(pValue, g_pFormats));
if (!diffFormat)
{
wprintf(L"Invalid value specified with -f (%ls)\n", pValue);
return 1;
diffFormat = static_cast<DXGI_FORMAT>(LookupByName(pValue, g_pFormatAliases));
if (!diffFormat)
{
wprintf(L"Invalid value specified with -f (%ls)\n", pValue);
return 1;
}
}
}
break;