Skip to content

Commit

Permalink
Latest from internal.Includes:
Browse files Browse the repository at this point in the history
* resource crash fix
* texture save/load refactor
* drag and drop assets into gigi viewer
  • Loading branch information
Atrix256 committed Dec 19, 2024
1 parent 071d06e commit 20c6655
Show file tree
Hide file tree
Showing 897 changed files with 98,675 additions and 100,023 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**/.vs/*
**/x64/Debug/*
**/x64/Release/*
**/Debug/*
**/Release/*
**/out/**/*.obj
Debug-windows-x86_64/
imgui.ini
Expand Down
111 changes: 100 additions & 11 deletions GigiCompilerLib/Backends/DX12/Backend_DX12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ struct BackendDX12 : public BackendBase
case TextureFormat::D24_Unorm_S8: return "DXGI_FORMAT_R24_UNORM_X8_TYPELESS";
case TextureFormat::BC7_Unorm: return "DXGI_FORMAT_BC7_UNORM";
case TextureFormat::BC7_Unorm_sRGB: return "DXGI_FORMAT_BC7_UNORM_SRGB";
case TextureFormat::BC6_UF16: return "DXGI_FORMAT_BC6H_UF16";
case TextureFormat::BC6_SF16: return "DXGI_FORMAT_BC6H_SF16";
}

Assert(false, "Unhandled TextureFormat: %s (%i)", EnumToString(textureFormat), (int)textureFormat);
Expand Down Expand Up @@ -760,15 +762,27 @@ struct BackendDX12 : public BackendBase
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n " << VariableToString(variable, renderGraph) << " = ImGui::Button(\"" << variable.name << "\");"
"\n ShowToolTip(\"" << variable.comment << "\");"
;

if (!variable.comment.empty())
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ShowToolTip(\"" << variable.comment << "\");"
;
}
}
else
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ImGui::Checkbox(\"" << variable.name << "\", &" << VariableToString(variable, renderGraph) << ");"
"\n ShowToolTip(\"" << variable.comment << "\");"
;

if (!variable.comment.empty())
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ShowToolTip(\"" << variable.comment << "\");"
;
}
}
break;
}
Expand All @@ -778,8 +792,14 @@ struct BackendDX12 : public BackendBase
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ImGui::InputInt(\"" << variable.name << "\", &" << VariableToString(variable, renderGraph) << ", 0);"
"\n ShowToolTip(\"" << variable.comment << "\");"
;

if (!variable.comment.empty())
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ShowToolTip(\"" << variable.comment << "\");"
;
}
}
else
{
Expand All @@ -796,7 +816,16 @@ struct BackendDX12 : public BackendBase
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n };"
"\n ImGui::Combo(\"" << variable.name << "\", (int*)&" << VariableToString(variable, renderGraph) << ", labels, " << e.items.size() << ");"
"\n ShowToolTip(\"" << variable.comment << "\");"
;

if (!variable.comment.empty())
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ShowToolTip(\"" << variable.comment << "\");"
;
}

stringReplacementMap["/*$(IMGUI)*/"] <<
"\n }"
;
}
Expand All @@ -810,7 +839,16 @@ struct BackendDX12 : public BackendBase
"\n int localVar = (int)" << VariableToString(variable, renderGraph) << ";"
"\n if(ImGui::InputInt(\"" << variable.name << "\", &localVar, 0))"
"\n " << VariableToString(variable, renderGraph) << " = (unsigned int)localVar;"
"\n ShowToolTip(\"" << variable.comment << "\");"
;

if (!variable.comment.empty())
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ShowToolTip(\"" << variable.comment << "\");"
;
}

stringReplacementMap["/*$(IMGUI)*/"] <<
"\n }";
break;
}
Expand All @@ -832,7 +870,16 @@ struct BackendDX12 : public BackendBase
"\n ImGui::Text(\"" << variable.name << "\");"
"\n ImGui::PopItemWidth();"
"\n ImGui::PopID();"
"\n ShowToolTip(\"" << variable.comment << "\");"
;

if (!variable.comment.empty())
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ShowToolTip(\"" << variable.comment << "\");"
;
}

stringReplacementMap["/*$(IMGUI)*/"] <<
"\n }";
break;
}
Expand All @@ -858,16 +905,31 @@ struct BackendDX12 : public BackendBase
"\n ImGui::Text(\"" << variable.name << "\");"
"\n ImGui::PopItemWidth();"
"\n ImGui::PopID();"
"\n ShowToolTip(\"" << variable.comment << "\");"
;

if (!variable.comment.empty())
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ShowToolTip(\"" << variable.comment << "\");"
;
}

stringReplacementMap["/*$(IMGUI)*/"] <<
"\n }";
break;
}
case DataFieldType::Float:
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ImGui::InputFloat(\"" << variable.name << "\", &" << VariableToString(variable, renderGraph) << ");"
"\n ShowToolTip(\"" << variable.comment << "\");"
;

if (!variable.comment.empty())
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ShowToolTip(\"" << variable.comment << "\");"
;
}
break;
}
case DataFieldType::Float2:
Expand All @@ -884,7 +946,16 @@ struct BackendDX12 : public BackendBase
"\n ImGui::Text(\"" << variable.name << "\");"
"\n ImGui::PopItemWidth();"
"\n ImGui::PopID();"
"\n ShowToolTip(\"" << variable.comment << "\");"
;

if (!variable.comment.empty())
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ShowToolTip(\"" << variable.comment << "\");"
;
}

stringReplacementMap["/*$(IMGUI)*/"] <<
"\n }"
;
break;
Expand Down Expand Up @@ -913,7 +984,16 @@ struct BackendDX12 : public BackendBase
"\n ImGui::Text(\"" << variable.name << "\");"
"\n ImGui::PopItemWidth();"
"\n ImGui::PopID();"
"\n ShowToolTip(\"" << variable.comment << "\");"
;

if (!variable.comment.empty())
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ShowToolTip(\"" << variable.comment << "\");"
;
}

stringReplacementMap["/*$(IMGUI)*/"] <<
"\n }"
;
}
Expand Down Expand Up @@ -945,7 +1025,16 @@ struct BackendDX12 : public BackendBase
"\n ImGui::Text(\"" << variable.name << "\");"
"\n ImGui::PopItemWidth();"
"\n ImGui::PopID();"
"\n ShowToolTip(\"" << variable.comment << "\");"
;

if (!variable.comment.empty())
{
stringReplacementMap["/*$(IMGUI)*/"] <<
"\n ShowToolTip(\"" << variable.comment << "\");"
;
}

stringReplacementMap["/*$(IMGUI)*/"] <<
"\n }"
;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ static void MakeStringReplacementForNode(std::unordered_map<std::string, std::os
"\n"
"\n if(context->m_profile)"
"\n {"
"\n context->m_profileData[s_timerIndex].m_label = \"" << node.name << "\";"
"\n context->m_profileData[s_timerIndex].m_cpu = (float)std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - startPointCPU).count();"
"\n context->m_profileData[(s_timerIndex-1)/2].m_label = \"" << node.name << "\";"
"\n context->m_profileData[(s_timerIndex-1)/2].m_cpu = (float)std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - startPointCPU).count();"
"\n commandList->EndQuery(context->m_internal.m_TimestampQueryHeap, D3D12_QUERY_TYPE_TIMESTAMP, s_timerIndex++);"
"\n }"
"\n }";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Debug/
MinSizeRel/
Release/
RelWithDebInfo/
.vs/
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ target_include_directories(/*$(Name)*/ PRIVATE ./imgui/)
/*$(if:DX12.AgilitySDKRequired:true)*/target_include_directories(/*$(Name)*/ PRIVATE ./AgilitySDK/include/)/*$(endif)*/
target_include_directories(/*$(Name)*/ PRIVATE ./DX12Utils/tinyexr/)
target_include_directories(/*$(Name)*/ PRIVATE ./DX12Utils/tinyexr/deps/miniz/)
target_include_directories(/*$(Name)*/ PRIVATE ./WinPixEventRuntime.1.0.230302001/Include/)
target_include_directories(/*$(Name)*/ PRIVATE ./WinPixEventRuntime.1.0.240308001/Include/)

target_link_directories(/*$(Name)*/ PRIVATE ./WinPixEventRuntime.1.0.230302001/bin/x64/)
target_link_directories(/*$(Name)*/ PRIVATE ./WinPixEventRuntime.1.0.240308001/bin/x64/)

target_link_libraries(/*$(Name)*/ d3d12.lib dxgi.lib d3dcompiler.lib WinPixEventRuntime.lib)

Expand Down
Loading

0 comments on commit 20c6655

Please sign in to comment.