Skip to content

Commit edede05

Browse files
committed
Added option to break into debbuger, new debug view
1 parent 17ef666 commit edede05

File tree

7 files changed

+17
-12
lines changed

7 files changed

+17
-12
lines changed

RtxOptions.md

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ Tables below enumerate all the options and their defaults set by RTX Remix. Note
202202
|rtx.enableAlwaysCalculateAABB|bool|False|Calculate an Axis Aligned Bounding Box for every draw call\.<br> This may improve instance tracking across frames for skinned and vertex shaded calls\.|
203203
|rtx.enableAsyncTextureUpload|bool|True||
204204
|rtx.enableBillboardOrientationCorrection|bool|True||
205+
|rtx.enableBreakIntoDebuggerOnPressingB|bool|False|Enables a break into a debugger at the start of InjectRTX\(\) on a press of key 'B'\.<br>If debugger is not attached at the time, it will wait until a debugger is attached and break into it then\.|
205206
|rtx.enableCulling|bool|True|Enable front/backface culling for opaque objects\. Objects with alpha blend or alpha test are not culled\.|
206207
|rtx.enableCullingInSecondaryRays|bool|False|Enable front/backface culling for opaque objects\. Objects with alpha blend or alpha test are not culled\. Only applies in secondary rays, defaults to off\. Generally helps with light bleeding from objects that aren't watertight\.|
207208
|rtx.enableDLSSEnhancement|bool|True|Enhances lighting details when DLSS is on\.|

src/dxvk/imgui/dxvk_imgui.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,7 @@ namespace dxvk {
15091509
ImGui::Indent();
15101510
ImGui::Checkbox("Enable Instance Debugging", &RtxOptions::enableInstanceDebuggingToolsObject());
15111511
ImGui::Checkbox("Disable Draw Calls Post RTX Injection", &RtxOptions::Get()->skipDrawCallsPostRTXInjectionObject());
1512+
ImGui::Checkbox("Break into Debugger On Press of Key 'B'", &RtxOptions::enableBreakIntoDebuggerOnPressingBObject());
15121513
if (ImGui::Checkbox("Block Input to Game in UI", &RtxOptions::Get()->blockInputToGameInUIObject())) {
15131514
sendUIActivationMessage();
15141515
}

src/dxvk/rtx_render/rtx_context.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,13 @@ namespace dxvk {
401401
void RtxContext::injectRTX(std::uint64_t cachedReflexFrameId, Rc<DxvkImage> targetImage) {
402402
ScopedCpuProfileZone();
403403

404+
if (RtxOptions::enableBreakIntoDebuggerOnPressingB() && ImGUI::checkHotkeyState({VirtualKey{ 'B' }}, true)) {
405+
while (!::IsDebuggerPresent()) {
406+
::Sleep(100);
407+
}
408+
__debugbreak();
409+
}
410+
404411
commitGraphicsState<true, false>();
405412

406413
m_device->setPresentThrottleDelay(RtxOptions::Get()->getPresentThrottleDelay());

src/dxvk/rtx_render/rtx_debug_view.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ namespace dxvk {
244244
{DEBUG_VIEW_NOISY_DEMODULATED_SECONDARY_COMBINED_SPECULAR_RADIANCE,"Secondary Combined Specular: Demodulated Noisy Color"},
245245
{DEBUG_VIEW_DENOISED_SECONDARY_COMBINED_SPECULAR_RADIANCE, "Secondary Combined Specular: Denoised Color"},
246246

247+
{DEBUG_VIEW_NOISY_PATHRACED_RAW_INDIRECT_RADIANCE, "Pathtraced Indirect (raw): Noisy Color" },
247248
{DEBUG_VIEW_NOISY_PRIMARY_DIRECT_RADIANCE, "Primary Direct: Noisy Color" },
248249
{DEBUG_VIEW_NOISY_PRIMARY_INDIRECT_RADIANCE, "Primary Indirect: Noisy Color" },
249250
{DEBUG_VIEW_NOISY_PRIMARY_RADIANCE, "Primary: Noisy Color" },

src/dxvk/rtx_render/rtx_options.h

+3
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,9 @@ namespace dxvk {
802802
RTX_OPTION_ENV("rtx", bool, enableMultiStageTextureFactorBlending, true, "RTX_ENABLE_MULTI_STAGE_TEXTURE_FACTOR_BLENDING", "Support texture factor blending in stage 1~7. Currently only support 1 additional blending stage, more than 1 additional blending stages will be ignored.");
803803

804804
// Developer Options
805+
RTX_OPTION_FLAG_ENV("rtx", bool, enableBreakIntoDebuggerOnPressingB, false, RtxOptionFlags::NoSave, "RTX_BREAK_INTO_DEBUGGER_ON_PRESSING_B",
806+
"Enables a break into a debugger at the start of InjectRTX() on a press of key \'B\'.\n"
807+
"If debugger is not attached at the time, it will wait until a debugger is attached and break into it then.");
805808
RTX_OPTION_FLAG("rtx", bool, enableInstanceDebuggingTools, false, RtxOptionFlags::NoSave, "NOTE: This will disable temporal correllation for instances, but allow the use of instance developer debug tools");
806809
RTX_OPTION("rtx", Vector2i, drawCallRange, Vector2i(0, INT32_MAX), "");
807810
RTX_OPTION("rtx", Vector3, instanceOverrideWorldOffset, Vector3(0.f, 0.f, 0.f), "");

src/dxvk/shaders/rtx/algorithm/integrator_indirect.slangh

+3-12
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,6 @@ void accumulateRadiance(inout PathState pathState, vec3 radiance)
9999
accumulateRadiance(pathState.radiance, pathState, radiance);
100100
}
101101

102-
void evalEmission(
103-
inout PathState pathState,
104-
PolymorphicSurfaceMaterialInteraction polymorphicSurfaceMaterialInteraction)
105-
{
106-
// Add in Emissive contribution
107-
108-
const vec3 emissiveRadiance = polymorphicSurfaceMaterialInteractionEvalEmissiveRadiance(polymorphicSurfaceMaterialInteraction);
109-
110-
accumulateRadiance(pathState, emissiveRadiance);
111-
}
112-
113-
114102
// Calculate a point's screen space position, if it's outside the screen, move it to screen boundary.
115103
// Return if the point is inside the screen.
116104
bool calculateScreenBoundedPixelCoordinate(mat4 transformMatrix, vec3 position, inout ivec2 pixelCoordinate)
@@ -1137,6 +1125,9 @@ void integratorIndirectPathOutputDebugView(
11371125
storeInDebugView(ivec2(pixelCoordinate), 0);
11381126
}
11391127
break;
1128+
case DEBUG_VIEW_NOISY_PATHRACED_RAW_INDIRECT_RADIANCE:
1129+
storeInDebugView(ivec2(pathState.pixelCoordinate), pathState.radiance);
1130+
break;
11401131
case DEBUG_VIEW_NOISY_SECONDARY_INDIRECT_RADIANCE:
11411132
if (!geometryFlags.primarySelectedIntegrationSurface)
11421133
{

src/dxvk/shaders/rtx/utility/debug_view_indices.h

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
#define DEBUG_VIEW_DENOISED_SECONDARY_COMBINED_DIFFUSE_RADIANCE 148
147147
#define DEBUG_VIEW_DENOISED_SECONDARY_COMBINED_SPECULAR_RADIANCE 149
148148

149+
#define DEBUG_VIEW_NOISY_PATHRACED_RAW_INDIRECT_RADIANCE 150
149150

150151
#define DEBUG_VIEW_NOISY_PRIMARY_DIRECT_RADIANCE 155
151152
#define DEBUG_VIEW_NOISY_PRIMARY_INDIRECT_RADIANCE 156

0 commit comments

Comments
 (0)