Skip to content

Commit

Permalink
Merge pull request #25 from Devaniti/patch-4
Browse files Browse the repository at this point in the history
Fixed DXGI_FORMAT output when using JSON
  • Loading branch information
sawickiap authored Dec 29, 2024
2 parents 5232afd + 79fff56 commit 1d9deaa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,34 +896,35 @@ static void PrintFormatInformation(ID3D12Device* device)
for(size_t formatIndex = 0; Enum_DXGI_FORMAT[formatIndex].m_Name != nullptr; ++formatIndex)
{
const DXGI_FORMAT format = (DXGI_FORMAT)Enum_DXGI_FORMAT[formatIndex].m_Value;
const wchar_t* name = Enum_DXGI_FORMAT[formatIndex].m_Name;

formatSupport.Format = format;

const FormatSupportResult formatSupportResult = CheckFormatSupport(device, formatSupport);
if(formatSupportResult == FormatSupportResult::Crashed)
{
fwprintf(stderr, L"ERROR: ID3D12Device::CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, %s) crashed.\n",
Enum_DXGI_FORMAT[formatIndex].m_Name);
name);
break;
}

if(g_UseJson)
{
Json::WriteString(std::format(L"{}", formatIndex));
Json::WriteString(std::format(L"{}", (size_t)format));
Json::BeginObject();
}
else
{
PrintIndent();
wprintf(L"%s:\n", Enum_DXGI_FORMAT[formatIndex].m_Name);
wprintf(L"%s:\n", name);
++g_Indent;
}

if(formatSupportResult == FormatSupportResult::Ok)
{
PrintFlags(L"Support1", formatSupport.Support1, Enum_D3D12_FORMAT_SUPPORT1);
PrintFlags(L"Support2", formatSupport.Support2, Enum_D3D12_FORMAT_SUPPORT2);
}

{

if(g_UseJson)
{
Json::WriteString(L"MultisampleQualityLevels");
Expand Down

0 comments on commit 1d9deaa

Please sign in to comment.