Skip to content

Commit

Permalink
Added option to break into debbuger, new debug view
Browse files Browse the repository at this point in the history
  • Loading branch information
pkristof committed Nov 11, 2024
1 parent 17ef666 commit edede05
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions RtxOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ Tables below enumerate all the options and their defaults set by RTX Remix. Note
|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\.|
|rtx.enableAsyncTextureUpload|bool|True||
|rtx.enableBillboardOrientationCorrection|bool|True||
|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\.|
|rtx.enableCulling|bool|True|Enable front/backface culling for opaque objects\. Objects with alpha blend or alpha test are not culled\.|
|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\.|
|rtx.enableDLSSEnhancement|bool|True|Enhances lighting details when DLSS is on\.|
Expand Down
1 change: 1 addition & 0 deletions src/dxvk/imgui/dxvk_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1509,6 +1509,7 @@ namespace dxvk {
ImGui::Indent();
ImGui::Checkbox("Enable Instance Debugging", &RtxOptions::enableInstanceDebuggingToolsObject());
ImGui::Checkbox("Disable Draw Calls Post RTX Injection", &RtxOptions::Get()->skipDrawCallsPostRTXInjectionObject());
ImGui::Checkbox("Break into Debugger On Press of Key 'B'", &RtxOptions::enableBreakIntoDebuggerOnPressingBObject());
if (ImGui::Checkbox("Block Input to Game in UI", &RtxOptions::Get()->blockInputToGameInUIObject())) {
sendUIActivationMessage();
}
Expand Down
7 changes: 7 additions & 0 deletions src/dxvk/rtx_render/rtx_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,13 @@ namespace dxvk {
void RtxContext::injectRTX(std::uint64_t cachedReflexFrameId, Rc<DxvkImage> targetImage) {
ScopedCpuProfileZone();

if (RtxOptions::enableBreakIntoDebuggerOnPressingB() && ImGUI::checkHotkeyState({VirtualKey{ 'B' }}, true)) {
while (!::IsDebuggerPresent()) {
::Sleep(100);
}
__debugbreak();
}

commitGraphicsState<true, false>();

m_device->setPresentThrottleDelay(RtxOptions::Get()->getPresentThrottleDelay());
Expand Down
1 change: 1 addition & 0 deletions src/dxvk/rtx_render/rtx_debug_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ namespace dxvk {
{DEBUG_VIEW_NOISY_DEMODULATED_SECONDARY_COMBINED_SPECULAR_RADIANCE,"Secondary Combined Specular: Demodulated Noisy Color"},
{DEBUG_VIEW_DENOISED_SECONDARY_COMBINED_SPECULAR_RADIANCE, "Secondary Combined Specular: Denoised Color"},

{DEBUG_VIEW_NOISY_PATHRACED_RAW_INDIRECT_RADIANCE, "Pathtraced Indirect (raw): Noisy Color" },
{DEBUG_VIEW_NOISY_PRIMARY_DIRECT_RADIANCE, "Primary Direct: Noisy Color" },
{DEBUG_VIEW_NOISY_PRIMARY_INDIRECT_RADIANCE, "Primary Indirect: Noisy Color" },
{DEBUG_VIEW_NOISY_PRIMARY_RADIANCE, "Primary: Noisy Color" },
Expand Down
3 changes: 3 additions & 0 deletions src/dxvk/rtx_render/rtx_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,9 @@ namespace dxvk {
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.");

// Developer Options
RTX_OPTION_FLAG_ENV("rtx", bool, enableBreakIntoDebuggerOnPressingB, false, RtxOptionFlags::NoSave, "RTX_BREAK_INTO_DEBUGGER_ON_PRESSING_B",
"Enables a break into a debugger at the start of InjectRTX() on a press of key \'B\'.\n"
"If debugger is not attached at the time, it will wait until a debugger is attached and break into it then.");
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");
RTX_OPTION("rtx", Vector2i, drawCallRange, Vector2i(0, INT32_MAX), "");
RTX_OPTION("rtx", Vector3, instanceOverrideWorldOffset, Vector3(0.f, 0.f, 0.f), "");
Expand Down
15 changes: 3 additions & 12 deletions src/dxvk/shaders/rtx/algorithm/integrator_indirect.slangh
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,6 @@ void accumulateRadiance(inout PathState pathState, vec3 radiance)
accumulateRadiance(pathState.radiance, pathState, radiance);
}

void evalEmission(
inout PathState pathState,
PolymorphicSurfaceMaterialInteraction polymorphicSurfaceMaterialInteraction)
{
// Add in Emissive contribution

const vec3 emissiveRadiance = polymorphicSurfaceMaterialInteractionEvalEmissiveRadiance(polymorphicSurfaceMaterialInteraction);

accumulateRadiance(pathState, emissiveRadiance);
}


// Calculate a point's screen space position, if it's outside the screen, move it to screen boundary.
// Return if the point is inside the screen.
bool calculateScreenBoundedPixelCoordinate(mat4 transformMatrix, vec3 position, inout ivec2 pixelCoordinate)
Expand Down Expand Up @@ -1137,6 +1125,9 @@ void integratorIndirectPathOutputDebugView(
storeInDebugView(ivec2(pixelCoordinate), 0);
}
break;
case DEBUG_VIEW_NOISY_PATHRACED_RAW_INDIRECT_RADIANCE:
storeInDebugView(ivec2(pathState.pixelCoordinate), pathState.radiance);
break;
case DEBUG_VIEW_NOISY_SECONDARY_INDIRECT_RADIANCE:
if (!geometryFlags.primarySelectedIntegrationSurface)
{
Expand Down
1 change: 1 addition & 0 deletions src/dxvk/shaders/rtx/utility/debug_view_indices.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
#define DEBUG_VIEW_DENOISED_SECONDARY_COMBINED_DIFFUSE_RADIANCE 148
#define DEBUG_VIEW_DENOISED_SECONDARY_COMBINED_SPECULAR_RADIANCE 149

#define DEBUG_VIEW_NOISY_PATHRACED_RAW_INDIRECT_RADIANCE 150

#define DEBUG_VIEW_NOISY_PRIMARY_DIRECT_RADIANCE 155
#define DEBUG_VIEW_NOISY_PRIMARY_INDIRECT_RADIANCE 156
Expand Down

0 comments on commit edede05

Please sign in to comment.