mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-28 05:11:37 +00:00
Print description of recently compiled render thread pipelines.
This commit is contained in:
parent
888ca67d79
commit
96d6e0ceda
4 changed files with 75 additions and 1 deletions
|
|
@ -122,6 +122,7 @@ find_package(zstd CONFIG REQUIRED)
|
||||||
find_package(Stb REQUIRED)
|
find_package(Stb REQUIRED)
|
||||||
find_package(unofficial-concurrentqueue REQUIRED)
|
find_package(unofficial-concurrentqueue REQUIRED)
|
||||||
find_package(imgui CONFIG REQUIRED)
|
find_package(imgui CONFIG REQUIRED)
|
||||||
|
find_path(CONJURE_ENUM_INCLUDE_DIRS "conjure_enum.hpp")
|
||||||
|
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12)
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12)
|
||||||
add_custom_command(TARGET UnleashedRecomp POST_BUILD
|
add_custom_command(TARGET UnleashedRecomp POST_BUILD
|
||||||
|
|
@ -164,6 +165,7 @@ target_include_directories(UnleashedRecomp PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/api
|
${CMAKE_CURRENT_SOURCE_DIR}/api
|
||||||
${SWA_THIRDPARTY_ROOT}/ddspp
|
${SWA_THIRDPARTY_ROOT}/ddspp
|
||||||
${Stb_INCLUDE_DIR}
|
${Stb_INCLUDE_DIR}
|
||||||
|
${CONJURE_ENUM_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_precompile_headers(UnleashedRecomp PUBLIC ${SWA_PRECOMPILED_HEADERS})
|
target_precompile_headers(UnleashedRecomp PUBLIC ${SWA_PRECOMPILED_HEADERS})
|
||||||
|
|
|
||||||
|
|
@ -239,6 +239,8 @@ static xxHashMap<std::unique_ptr<RenderPipeline>> g_pipelines;
|
||||||
static std::atomic<uint32_t> g_pipelinesCreatedInRenderThread;
|
static std::atomic<uint32_t> g_pipelinesCreatedInRenderThread;
|
||||||
static std::atomic<uint32_t> g_pipelinesCreatedAsynchronously;
|
static std::atomic<uint32_t> g_pipelinesCreatedAsynchronously;
|
||||||
static std::atomic<uint32_t> g_pipelinesDropped;
|
static std::atomic<uint32_t> g_pipelinesDropped;
|
||||||
|
static std::string g_pipelineDebugText;
|
||||||
|
static Mutex g_debugMutex;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static std::atomic<uint32_t> g_compilingModelCount;
|
static std::atomic<uint32_t> g_compilingModelCount;
|
||||||
|
|
@ -1680,6 +1682,9 @@ static void DrawImGui()
|
||||||
ImGui::Text("Pipelines Dropped: %d", g_pipelinesDropped.load());
|
ImGui::Text("Pipelines Dropped: %d", g_pipelinesDropped.load());
|
||||||
ImGui::Text("Compiling Model Count: %d", g_compilingModelCount.load());
|
ImGui::Text("Compiling Model Count: %d", g_compilingModelCount.load());
|
||||||
ImGui::Text("Pending Model Count: %d", g_pendingModelCount.load());
|
ImGui::Text("Pending Model Count: %d", g_pendingModelCount.load());
|
||||||
|
|
||||||
|
std::lock_guard lock(g_debugMutex);
|
||||||
|
ImGui::TextUnformatted(g_pipelineDebugText.c_str());
|
||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -2737,6 +2742,71 @@ static RenderPipeline* CreateGraphicsPipelineInRenderThread(PipelineState pipeli
|
||||||
++g_pipelinesCreatedInRenderThread;
|
++g_pipelinesCreatedInRenderThread;
|
||||||
pipeline->setName(std::format("{} {} {:X}",
|
pipeline->setName(std::format("{} {} {:X}",
|
||||||
pipelineState.vertexShader->name, pipelineState.pixelShader != nullptr ? pipelineState.pixelShader->name : "<none>", hash));
|
pipelineState.vertexShader->name, pipelineState.pixelShader != nullptr ? pipelineState.pixelShader->name : "<none>", hash));
|
||||||
|
|
||||||
|
auto enumToString = []<typename T>(T value)
|
||||||
|
{
|
||||||
|
return FIX8::conjure_enum<T>::enum_to_string(value);
|
||||||
|
};
|
||||||
|
|
||||||
|
std::lock_guard lock(g_debugMutex);
|
||||||
|
g_pipelineDebugText = std::format(
|
||||||
|
"PipelineState {:X}:\n"
|
||||||
|
" vertexShader: {}\n"
|
||||||
|
" pixelShader: {}\n"
|
||||||
|
" instancing: {}\n"
|
||||||
|
" zEnable: {}\n"
|
||||||
|
" zWriteEnable: {}\n"
|
||||||
|
" srcBlend: {}\n"
|
||||||
|
" destBlend: {}\n"
|
||||||
|
" cullMode: {}\n"
|
||||||
|
" zFunc: {}\n"
|
||||||
|
" alphaBlendEnable: {}\n"
|
||||||
|
" blendOp: {}\n"
|
||||||
|
" slopeScaledDepthBias: {}\n"
|
||||||
|
" depthBias: {}\n"
|
||||||
|
" srcBlendAlpha: {}\n"
|
||||||
|
" destBlendAlpha: {}\n"
|
||||||
|
" blendOpAlpha: {}\n"
|
||||||
|
" colorWriteEnable: {:X}\n"
|
||||||
|
" primitiveTopology: {}\n"
|
||||||
|
" vertexStrides[0]: {}\n"
|
||||||
|
" vertexStrides[1]: {}\n"
|
||||||
|
" vertexStrides[2]: {}\n"
|
||||||
|
" vertexStrides[3]: {}\n"
|
||||||
|
" renderTargetFormat: {}\n"
|
||||||
|
" depthStencilFormat: {}\n"
|
||||||
|
" sampleCount: {}\n"
|
||||||
|
" enableAlphaToCoverage: {}\n"
|
||||||
|
" specConstants: {:X}\n",
|
||||||
|
hash,
|
||||||
|
pipelineState.vertexShader->name,
|
||||||
|
pipelineState.pixelShader != nullptr ? pipelineState.pixelShader->name : "<none>",
|
||||||
|
pipelineState.instancing,
|
||||||
|
pipelineState.zEnable,
|
||||||
|
pipelineState.zWriteEnable,
|
||||||
|
enumToString(pipelineState.srcBlend),
|
||||||
|
enumToString(pipelineState.destBlend),
|
||||||
|
enumToString(pipelineState.cullMode),
|
||||||
|
enumToString(pipelineState.zFunc),
|
||||||
|
pipelineState.alphaBlendEnable,
|
||||||
|
enumToString(pipelineState.blendOp),
|
||||||
|
pipelineState.slopeScaledDepthBias,
|
||||||
|
pipelineState.depthBias,
|
||||||
|
enumToString(pipelineState.srcBlendAlpha),
|
||||||
|
enumToString(pipelineState.destBlendAlpha),
|
||||||
|
enumToString(pipelineState.blendOpAlpha),
|
||||||
|
pipelineState.colorWriteEnable,
|
||||||
|
enumToString(pipelineState.primitiveTopology),
|
||||||
|
pipelineState.vertexStrides[0],
|
||||||
|
pipelineState.vertexStrides[1],
|
||||||
|
pipelineState.vertexStrides[2],
|
||||||
|
pipelineState.vertexStrides[3],
|
||||||
|
enumToString(pipelineState.renderTargetFormat),
|
||||||
|
enumToString(pipelineState.depthStencilFormat),
|
||||||
|
pipelineState.sampleCount,
|
||||||
|
pipelineState.enableAlphaToCoverage,
|
||||||
|
pipelineState.specConstants)
|
||||||
|
+ g_pipelineDebugText;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
#include <o1heap.h>
|
#include <o1heap.h>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <wrl/client.h>
|
#include <wrl/client.h>
|
||||||
|
#include <conjure_enum.hpp>
|
||||||
|
|
||||||
using Microsoft::WRL::ComPtr;
|
using Microsoft::WRL::ComPtr;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
{
|
{
|
||||||
"name": "imgui",
|
"name": "imgui",
|
||||||
"features": [ "sdl2-binding" ]
|
"features": [ "sdl2-binding" ]
|
||||||
}
|
},
|
||||||
|
"conjure-enum"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue