Skip to content

Commit 2b5773a

Browse files
Merge branch 'graph-gui' into 'main'
[REMIX-4649] Add graph visualization GUI See merge request lightspeedrtx/dxvk-remix-nv!1727
2 parents 37b6daf + ed2b0a8 commit 2b5773a

File tree

11 files changed

+525
-6
lines changed

11 files changed

+525
-6
lines changed

src/dxvk/imgui/dxvk_imgui.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "dxvk_imgui.h"
3737
#include "rtx_render/rtx_imgui.h"
3838
#include "dxvk_device.h"
39+
#include "rtx_render/graph/rtx_graph_gui.h"
3940
#include "rtx_render/rtx_utils.h"
4041
#include "rtx_render/rtx_shader_manager.h"
4142
#include "rtx_render/rtx_camera.h"
@@ -582,7 +583,8 @@ namespace dxvk {
582583
: m_device (device)
583584
, m_hwnd (nullptr)
584585
, m_about (new ImGuiAbout)
585-
, m_splash (new ImGuiSplash) {
586+
, m_splash (new ImGuiSplash)
587+
, m_graphGUI (new RtxGraphGUI) {
586588
// Clamp Option ranges
587589

588590
RTX_OPTION_CLAMP(reflexStatRangeInterpolationRate, 0.0f, 1.0f);
@@ -2475,6 +2477,14 @@ namespace dxvk {
24752477
showEnhancementsTab(ctx);
24762478
ImGui::Unindent();
24772479
}
2480+
2481+
// Graph Visualization Section
2482+
ImGui::Separator();
2483+
if (ImGui::CollapsingHeader("Graph Visualization", ImGuiTreeNodeFlags_DefaultOpen)) {
2484+
ImGui::Indent();
2485+
m_graphGUI->showGraphVisualization(ctx);
2486+
ImGui::Unindent();
2487+
}
24782488
}
24792489

24802490
void ImGUI::showEnhancementsTab(const Rc<DxvkContext>& ctx) {

src/dxvk/imgui/dxvk_imgui.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ namespace dxvk {
4747
class ImGuiCapture;
4848
class DxvkDevice;
4949
class DxvkContext;
50+
class RtxGraphGUI;
5051

5152
/**
5253
* \brief DXVK ImGUI
@@ -165,6 +166,7 @@ namespace dxvk {
165166
float m_reflexLatencyStatsWindowHeight = 650.f;
166167
bool m_reflexLatencyStatsOpen = false;
167168
bool m_lastRenderVsyncStatus = false;
169+
std::unique_ptr<RtxGraphGUI> m_graphGUI;
168170

169171
static constexpr const char* tabNames[] = { "Rendering", "Game Setup", "Enhancements", "About" , "Dev Settings"};
170172
Tabs m_curTab = kTab_Count;
@@ -241,6 +243,7 @@ namespace dxvk {
241243
void onCloseMenus();
242244
void onOpenMenus();
243245
void freeUnusedMemory();
246+
244247
};
245248

246249
}

src/dxvk/meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@ dxvk_src = files([
339339
'rtx_render/graph/rtx_graph_batch.cpp',
340340
'rtx_render/graph/rtx_graph_batch.h',
341341
'rtx_render/graph/rtx_graph_component_macros.h',
342+
'rtx_render/graph/rtx_graph_gui.cpp',
343+
'rtx_render/graph/rtx_graph_gui.h',
342344
'rtx_render/graph/rtx_graph_instance.cpp',
343345
'rtx_render/graph/rtx_graph_instance.h',
344346
'rtx_render/graph/rtx_graph_manager.h',

src/dxvk/rtx_render/graph/rtx_graph_batch.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ void RtGraphBatch::Initialize(const RtGraphTopology& topology) {
9393
return;
9494
}
9595

96+
// Store pointer to topology for GUI access (safe because topology lives in stable asset storage)
97+
m_topology = &topology;
98+
9699
for (size_t i = 0; i < topology.propertyTypes.size(); i++) {
97100
m_properties.push_back(propertyVectorFromType(topology.propertyTypes[i]));
98101
}

src/dxvk/rtx_render/graph/rtx_graph_batch.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "rtx_graph_types.h"
2626
#include "rtx_graph_instance.h"
2727
#include "../../dxvk_context.h"
28+
#include <cassert>
2829

2930
namespace dxvk {
3031

@@ -82,8 +83,23 @@ class RtGraphBatch {
8283
return true;
8384
}
8485

86+
// GUI access methods
87+
const std::vector<std::unique_ptr<RtComponentBatch>>& getComponentBatches() const {
88+
return m_componentBatches;
89+
}
90+
91+
const std::vector<RtComponentPropertyVector>& getProperties() const {
92+
return m_properties;
93+
}
94+
95+
const RtGraphTopology& getTopology() const {
96+
assert(m_topology != nullptr && "Topology not initialized");
97+
return *m_topology;
98+
}
99+
85100
private:
86101
XXH64_hash_t m_graphHash;
102+
const RtGraphTopology* m_topology = nullptr;
87103
std::vector<std::unique_ptr<RtComponentBatch>> m_componentBatches;
88104
std::vector<uint32_t> m_batchesWithSceneOverrides;
89105
std::vector<RtComponentPropertyVector> m_properties;

0 commit comments

Comments
 (0)