Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
bec1863
Fix handling of debug names for VkCommandBuffers
Oct 15, 2026
d5025c6
Add serializers for VK_KHR_device_address_commands types
Oct 1, 2026
9523643
Add stub function hooks for VK_KHR_device_address_commands
Oct 1, 2026
239a67a
Fill out cmd and resource hooks for VK_KHR_device_address_commands
Oct 6, 2026
0e4c59c
Fill out copy hooks for VK_KHR_device_address_commands
Oct 13, 2026
4c764df
Fill out vkCmdDispatchIndirect2 and vkCmdDrawIndexedIndirect2 hooks
Oct 13, 2026
98a9208
Fill out hooks for vkCmdDrawIndirect2 and indirect meshlet 2 functions
Oct 16, 2026
d3fbb43
Finish indirect hooks for VK_KHR_device_address_commands
Oct 19, 2026
13324a0
Add test for VK_KHR_device_address_commands and enable extension
Oct 2, 2026
198bd9d
Update VK_KHR_device_address_commands in internal doc
baldurk Oct 23, 2026
39be707
Ensure consistent thread usage of ICaptureAccess in the UI
baldurk Oct 23, 2026
64b3775
Fix recompression of remote captures not working correctly
baldurk Oct 23, 2026
f1c7eff
Prevent absolutely ridiculous and silly linux behaviour to kill programs
baldurk Oct 23, 2026
7bacf7f
If saving a remote capture on shutdown, wait for transfer before exit
baldurk Oct 23, 2026
b62af7c
Return success from SPIR-V parse, add overload to move SPIR-V words
baldurk Oct 23, 2026
8f675fa
Fix check for unbounded cbuffer arrays on DXBC
baldurk Oct 23, 2026
0f3010d
Don't consider DXIL blobs to ever use vendor extensions
baldurk Oct 23, 2026
e61e44e
Remove debug code leftover
baldurk Oct 23, 2026
948df72
Remove linked shaderc support in demos - no longer supported
baldurk Oct 23, 2026
ba62371
Create D3D12 ExecuteIndirect patching shader at startup
baldurk Oct 23, 2026
3f51938
Rename shadowed variable
baldurk Oct 23, 2026
e38dda6
Remove unused lambda capture
baldurk Oct 24, 2026
38af0c9
Remove another unused lambda capture
baldurk Oct 24, 2026
6c7dd63
Remove -Wno-unused-lambda-capture so we get those errors on normal clang
baldurk Oct 24, 2026
e99d699
Fix other instances of -Wunused-lambda-capture
baldurk Oct 24, 2026
0a91fea
Intercept obsolete form of EGL surface creation functions. Closes #3924
baldurk Oct 26, 2026
65b29ca
Adjust bytecode handling to reduce redundant copies held in memory
baldurk Oct 26, 2026
3ea44b8
Add tests for separate debug info on D3D + Vulkan, and embedding
baldurk Oct 26, 2026
0384f09
Add needed default argument for python function
baldurk Oct 26, 2026
36a95cc
Use m_DeferredInit to guard waiting in python calls that need reflector
baldurk Aug 27, 2026
824c86a
Leak iconv lock to preserve better shutdown order
baldurk Aug 27, 2026
5867c46
Add lock around accessing shutdown functions
baldurk Aug 27, 2026
0ae1472
Fix glslang global lock to not alloc each time!
baldurk Aug 27, 2026
aac221a
Fix leak in BufferViewer
baldurk Aug 27, 2026
e8d39bb
Add VK_Device_Address_Commands tests to CMakeLists.txt
baldurk Oct 26, 2026
660a4f0
Improve display of callstacks while loading from remote
baldurk Oct 26, 2026
437fe7e
Add access invoke which deliberately goes onto the replay thread
baldurk Oct 26, 2026
27fc73a
Fix access invoke callbacks relying on replay thread
baldurk Oct 26, 2026
2395565
Don't remote support for RGP captures over remote proxy
baldurk Oct 27, 2026
6cdf730
Mark RGP unsupported on both sides of proxy
baldurk Oct 27, 2026
7abab64
Add a global value to GL_Shader_Debug_Zoo
baldurk Oct 27, 2026
41a17ba
Don't set shader path tag when not available
baldurk Oct 27, 2026
205bfd5
Check fully dynamic attachment setup doesn't break
baldurk Oct 27, 2026
d014cc6
Don't double-delete buffer if aborting buffer fetch while UI is closed
baldurk Oct 27, 2026
9304525
Remove redundant OnEventChanged calls in buffer viewer
baldurk Oct 27, 2026
16a859d
Fix GLES texdisplay fragment shader compile errors
Zorro666 Oct 27, 2026
363cc7c
For sanity only restore hooking env vars if we have something to restore
baldurk Oct 29, 2026
d4f5a7e
Use correct GLSL version to compile debug sampling shader
baldurk Oct 29, 2026
b1620e0
Use matching name for GL input/output variables
baldurk Oct 29, 2026
31479b8
Ensure GL_Shader_Debug_Zoo is compiled into tests
baldurk Oct 29, 2026
682a9b2
Use other name for debug sampling UBO
baldurk Oct 29, 2026
10f9c2b
Properly push and pop copy read buffer binding
baldurk Oct 29, 2026
2c39ab7
Don't fetch sampler properties for texture buffer bindings
baldurk Oct 29, 2026
d059e15
Bind shader debug program for uniform setting
baldurk Oct 29, 2026
2982210
Set GL marker regions on consistent context
baldurk Oct 29, 2026
8e0a313
Fix potential crash if an empty set of states is debugged
baldurk Oct 29, 2026
b0c749c
Use correct context for shader debugging programs
baldurk Oct 29, 2026
a679886
Update the Prev/Next buttons state on capture load
Zorro666 Oct 30, 2026
b0e1370
Fixup EventBrowser support for handling filtering in StepNext/Prev
Zorro666 Oct 30, 2026
1d83c25
Bump version to v1.48
baldurk Oct 31, 2026
0a2278d
Ensure interface names better match between debugging and reflection
baldurk Nov 2, 2026
5c76c20
Don't clamp mesh vertex count by unused vertex buffers
baldurk Nov 2, 2026
3067fc8
Improve visual spacing on event browser toolbars
baldurk Nov 2, 2026
aa42dd6
Fix vulkan capture open progress bar being stalled for much of the read
baldurk Nov 2, 2026
f039dcd
Add a filtering system for the constant buffer viewer. Closes #3889
baldurk Nov 2, 2026
b23be09
Fix compilation on older Qt versions
baldurk Nov 2, 2026
e55f7a5
DXBC Debugger: perform addition in OPCODE_UADDC
Zorro666 Oct 23, 2026
bf6fe56
VK_Resource_Usage improvements
Zorro666 Nov 3, 2026
282b28b
Reset parent command buffer RenderState after executing a secondary
Zorro666 Sep 24, 2026
fd09bb3
Add a dialog for directly-launching pixel shader debug. Closes #3422
baldurk Nov 3, 2026
34fbfb4
Add D3D11/Vk demos that do rasterization with no outputs
baldurk Nov 3, 2026
2835a73
Fix color mask display when color write enable is static
ShabbyX Nov 6, 2026
7c7e913
Fix VS2026 Release build linker error about missing symbol memset
Zorro666 Nov 6, 2026
0c319e9
Added helper function VulkanEventNode::AddResourceUsage
Zorro666 Aug 13, 2026
ce216bd
Added Vulkan helper AddEventResourceUsage()
Zorro666 Nov 10, 2026
3211e1e
Added Vulkan helper GetLoadingEventNode()
Zorro666 Nov 10, 2026
e0399b6
Remove any semaphores when replaying vkQueueSubmit2
Zorro666 Nov 10, 2026
5ebc85a
Add Action and Callbacks to vkCmdBuildAccelerationStructuresIndirectKHR
Zorro666 Nov 10, 2026
ae2f8db
Add option to hard-break on validation errors in tests
baldurk Nov 9, 2026
3e14350
Remove VK_EXT_Buffer_Address test
baldurk Nov 10, 2026
4b338b4
Add helper for setting environment variable values
baldurk Nov 10, 2026
46ea9dc
Mute a couple of validation messages on vulkan tests
baldurk Nov 10, 2026
31cad11
Enable features/extensions in vulkan tests that we use
baldurk Nov 10, 2026
0b15a71
Move extra renderpass dependencies to helper creator
baldurk Nov 10, 2026
b345046
Ensure we delete all resources before test shutdown
baldurk Nov 10, 2026
0a04b74
Reduce the number of descriptor sets in VK_Descriptor_Variable_Count
baldurk Nov 10, 2026
a73b921
Prefer using spirv-as for assembly SPIR-V assembly if possible
baldurk Nov 10, 2026
77b4d53
Disable OBS during tests - it introduces validation errors
baldurk Nov 10, 2026
eb8d045
Don't add duplicate validation features structs
baldurk Nov 10, 2026
e3c29f8
Fix normal validation issues in vulkan tests
baldurk Nov 10, 2026
8a55fc2
Fix sync/barrier issues in vulkan tests
baldurk Nov 10, 2026
8330d91
Don't double-delete main window
baldurk Nov 10, 2026
ac17f5c
Disable 3D depth textures entirely in VK_Texture_Zoo
baldurk Nov 10, 2026
75b3b7b
Adjust the markers in VK_Resource_Usage
Zorro666 Nov 10, 2026
0cb2ab3
Apply -Wno-deprecated-literal-operator to demos project
Zorro666 Oct 29, 2026
f3c399b
Mark the VkEvent as referenced in device event APIs: Set/Reset/GetStatus
Zorro666 Nov 10, 2026
060c0c5
Added tests helper setName overload for vkEvent
Zorro666 Nov 10, 2026
66f213f
Extend VK_Resource_Usage C++ to test device VkEvent APIs
Zorro666 Nov 10, 2026
1aec691
Preparation for sharing Vulkan RenderState tracking in Loading & Replay
Zorro666 Nov 5, 2026
e3f42ff
Unify Vulkan RenderState tracking in Loading & Replay: Event APIs
Zorro666 Nov 6, 2026
282dd08
Unify Vulkan RenderState tracking in Loading & Replay: Draw APIs
Zorro666 Nov 6, 2026
19acf16
Unify Vulkan RenderState tracking in Loading & Replay: Image APIs
Zorro666 Nov 6, 2026
7dd0d73
Unify Vulkan RenderState tracking in Loading & Replay: Buffer APIs
Zorro666 Nov 6, 2026
3577e67
Unify Vulkan RenderState tracking in Loading & Replay: Memory APIs
Zorro666 Nov 6, 2026
7fcf4bc
Unify Vulkan RenderState tracking in Loading & Replay: TraceRays APIs
Zorro666 Nov 6, 2026
f442690
Unify Vulkan RenderState tracking in Loading & Replay: RenderState APIs
Zorro666 Nov 6, 2026
925da83
Unify Vulkan RenderState tracking in Loading & Replay: RenderPass APIs
Zorro666 Nov 6, 2026
58df213
Unify Vulkan RenderState tracking in Loading & Replay: Pipeline APIs
Zorro666 Nov 6, 2026
abf8497
Unify Vulkan RenderState tracking in Loading & Replay: Desc Buffer APIs
Zorro666 Nov 6, 2026
f801bcd
Unify Vulkan RenderState tracking in Loading & Replay: Push APIs
Zorro666 Nov 6, 2026
117452e
Unify Vulkan RenderState tracking in Loading & Replay: QueryPool APIs
Zorro666 Nov 6, 2026
c076e5b
Unify Vulkan RenderState tracking in Loading & Replay: Feedback APIs
Zorro666 Nov 6, 2026
d33e041
Unify Vulkan RenderState tracking in Loading & Replay: Cond Render APIs
Zorro666 Nov 6, 2026
86cadb8
Unify Vulkan RenderState tracking in Loading & Replay: Acc Struct APIs
Zorro666 Nov 10, 2026
d92e570
Fix missing display of legacy bare uniforms
baldurk Nov 11, 2026
c2472f3
Added helper D3D12EventNode::AddResourceUsage
Zorro666 Nov 12, 2026
fc21fa5
Renamed D3D12CommandData::AddCPUUsage -> AddEventResourceUsage
Zorro666 Nov 12, 2026
36d65eb
Added helper D3D12CommandData::GetLoadingEventNode
Zorro666 Nov 12, 2026
df1ef00
Fix D3D12EventNode memory leak of D3D12RenderState
Zorro666 Nov 13, 2026
9bc1d5d
Added D3D12CommandData::m_Loading
Zorro666 Nov 12, 2026
de38b92
Preparation for sharing D3D12 Loading & Replay code per API
Zorro666 Nov 12, 2026
37f0c3b
Share D3D12 Loading & Replay code per API: CommandList APIs
Zorro666 Nov 12, 2026
f2fe793
Share D3D12 Loading & Replay code per API: CommandList1 APIs
Zorro666 Nov 12, 2026
7703f5e
Share D3D12 Loading & Replay code per API: CommandList2 APIs
Zorro666 Nov 12, 2026
3535447
Share D3D12 Loading & Replay code per API: CommandList4 APIs
Zorro666 Nov 12, 2026
ccd637e
Share D3D12 Loading & Replay code per API: CommandList5 APIs
Zorro666 Nov 12, 2026
69b1a1e
Share D3D12 Loading & Replay code per API: CommandList6 APIs
Zorro666 Nov 12, 2026
9f49122
Share D3D12 Loading & Replay code per API: CommandList7 APIs
Zorro666 Nov 12, 2026
2113e36
Share D3D12 Loading & Replay code per API: CommandList8 APIs
Zorro666 Nov 12, 2026
5ad6088
Share D3D12 Loading & Replay code per API: CommandList9 APIs
Zorro666 Nov 12, 2026
d029432
Merge RenderDoc v1.x through 5ad608809
dotm5 Nov 16, 2026
f653a04
Keep the Windows build and functional test entry points compatible
dotm5 Nov 16, 2026
11a57f6
Validate Bootstrap exports with the selected toolchain
dotm5 Nov 16, 2026
e87d094
Use zero-initialized virtual memory for the shim path
dotm5 Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/imgs/icons/filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion docs/window/buffer_viewer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ When opening a buffer for view, it can display both fixed non-repeating "struct-

The format is defined initially by whatever reflection data is available. The format can be customised, as detailed in :doc:`../how/how_buffer_format`.

Constant buffers are assumed to be AoS data in all cases. Other views of buffers via non-constant bindings such as UAVs and storage buffers, or views opened directly from a buffer from the resource inspector, will default towards SoA data unless the layout explicitly declares a fixed set of SoA data.
Constant buffers are assumed to be SoA data in all cases. Other views of buffers via non-constant bindings such as UAVs and storage buffers, or views opened directly from a buffer from the resource inspector, will default towards AoS data unless the layout explicitly declares a fixed set of SoA data.

.. figure:: ../imgs/Screenshots/AOSBuffer.png

Expand All @@ -28,6 +28,15 @@ The initial values of the offset and length will be taken from the relevant bind

In addition to this, you can specify a row offset which is useful in remaining at the same row while watching the change in a buffer between different events.

Filtering in constant buffer view
---------------------------------

.. |filter| image:: ../imgs/icons/filter.png

When viewing a constant buffer and it is known that the data is only a small set of fixed data, an additional |filter| option is available.

This will add a filtering toolbar that allows a subset of the variables to be shown. The filter is a set of words, space separated, that by default match case insensitively against variables in the declared structure. Any variable that matches any of the words will be displayed. If the name of a structure is matched, all children of that structure will be displayed.

Exporting and display
---------------------

Expand Down
46 changes: 18 additions & 28 deletions qrenderdoc/Code/Interface/QRDInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -2111,42 +2111,32 @@ If no tag is present, the callback will be processed as normal.
// Returns false when capture access is unavailable, or an async request has
// no running worker. Synchronous access also works before replay starts.
//
// Hidden from swig: Python uses a force-blocking capture-access invoker.
// this is hidden from swig as for python the threading is less controlled there so we wrap the
// ICaptureAccess with a force-blocking invoker
virtual bool AccessInvoke(std::function<void(ICaptureAccess *)> callback, bool blocking,
bool forceReplay, rdcstr tag) = 0;

// Capture operations can use a replay-worker tag for progress reporting.
bool AccessInvoke(std::function<void(ICaptureAccess *)> callback, bool blocking, rdcstr tag)
{
if(!GetCaptureAccess())
return false;

auto invoke = [this, callback](IReplayController *) {
if(ICaptureAccess *access = GetCaptureAccess())
callback(access);
};

if(!blocking)
{
if(!IsRunning())
return false;
AsyncInvoke(invoke, tag);
}
else if(CurrentRemote().IsConnected() && IsRunning())
{
BlockInvoke(invoke);
}
else
{
// GPU enumeration must also work before a remote capture starts a worker.
callback(GetCaptureAccess());
}

return true;
return AccessInvoke(callback, blocking, !blocking, tag);
}

// simple blocking access
bool BlockAccessInvoke(std::function<void(ICaptureAccess *)> callback)
{
return AccessInvoke(callback, true, "");
return AccessInvoke(callback, true, false, "");
}
// Asynchronous access on the replay worker.
bool AsyncAccessInvoke(std::function<void(ICaptureAccess *)> callback)
{
return AccessInvoke(callback, false, "");
return AccessInvoke(callback, false, false, "");
}
// async access, will always be on the replay thread even locally so the UI thread can e.g.
// display a progress spinner
bool SlowAsyncAccessInvoke(std::function<void(ICaptureAccess *)> callback)
{
return AccessInvoke(callback, false, true, "");
}
#endif

Expand Down
30 changes: 30 additions & 0 deletions qrenderdoc/Code/ReplayManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,36 @@ void ReplayManager::BlockInvoke(ReplayManager::ReplayInvokeCallback m)
delete cmd;
}

bool ReplayManager::AccessInvoke(std::function<void(ICaptureAccess *)> callback, bool blocking,
bool forceReplay, rdcstr tag)
{
if(!GetCaptureAccess())
return false;

auto invoke = [this, callback](IReplayController *) {
if(ICaptureAccess *access = GetCaptureAccess())
callback(access);
};

if(!blocking)
{
if(!IsRunning())
return false;
AsyncInvoke(invoke, tag);
}
else if((CurrentRemote().IsConnected() || forceReplay) && IsRunning())
{
BlockInvoke(invoke);
}
else
{
// Synchronous queries such as GPU enumeration also run before replay starts.
callback(GetCaptureAccess());
}

return true;
}

void ReplayManager::CancelReplayLoop()
{
m_Renderer->CancelReplayLoop();
Expand Down
3 changes: 3 additions & 0 deletions qrenderdoc/Code/ReplayManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class ReplayManager : public IReplayManager
using IReplayManager::AsyncInvoke;
void BlockInvoke(ReplayInvokeCallback m);

bool AccessInvoke(std::function<void(ICaptureAccess *)> callback, bool blocking, bool forceReplay,
rdcstr tag);

void CancelReplayLoop();

void CloseThread();
Expand Down
13 changes: 8 additions & 5 deletions qrenderdoc/Code/pyrenderdoc/PythonContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1767,14 +1767,16 @@ QWidget *PythonContext::QWidgetFromPy(PyObject *widget)

void PythonContext::reflectSource(QString src)
{
if(!m_Reflector)
if(m_DeferredInit == 0)
{
for(int i = 0; i < 50 && m_DeferredInit == 0; i++)
QThread::msleep(20);
m_DeferredInit = 1;

if(!m_Reflector)
{
m_DeferredInit = 1;
return;
}
}

PyGILState_STATE gil = PyGILState_Ensure();
Expand All @@ -1799,15 +1801,16 @@ void PythonContext::reflectSource(QString src)
void PythonContext::makeHelpContext()
{
// expand out members of renderdoc and qrenderdoc using the stubs
if(!m_StubRD || !m_StubQRD)
if(m_DeferredInit == 0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check the stub pointers after deferred initialization completes

If deferred initialization cannot find a valid pystubs path or either stub import fails, its worker still sets m_DeferredInit to one while leaving a stub pointer null. Opening the Python shell then calls makeHelpContext(), which now skips the pointer checks and passes that null pointer to PyDict_SetItemString(), causing a native crash instead of gracefully disabling help as before. Keep the wait conditional on initialization state, but validate both stub pointers unconditionally before using them.

Useful? React with 👍 / 👎.

{
for(int i = 0; i < 50 && m_DeferredInit == 0; i++)
QThread::msleep(20);

m_DeferredInit = 1;

if(!m_StubRD || !m_StubQRD)
{
m_DeferredInit = 1;
return;
}
}

PyGILState_STATE gil = PyGILState_Ensure();
Expand Down
7 changes: 7 additions & 0 deletions qrenderdoc/Code/pyrenderdoc/PythonInvokers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,13 @@ struct ReplayInvoker : IReplayManager
}

void BlockInvoke(ReplayInvokeCallback method) { return m_Replay.BlockInvoke(method); }

// won't be available to python but we implement this for compile time matching
bool AccessInvoke(std::function<void(ICaptureAccess *)> callback, bool blocking, bool forceReplay,
rdcstr tag)
{
return m_Replay.AccessInvoke(callback, blocking, forceReplay, tag);
}
};

struct IMainWindowInvoker : UIThreadInvoker<IMainWindow>
Expand Down
46 changes: 46 additions & 0 deletions qrenderdoc/Widgets/Extended/RDTreeView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,52 @@ void RDTreeView::applyExpansion(const RDTreeViewExpansionState &state, const Exp
applyExpansionToRow(state, model()->index(i, 0), 0, keygen);
}

RDTreeViewSelectedItemState RDTreeView::saveSelectedItemState()
{
RDTreeViewSelectedItemState ret;
QModelIndexList sel = selectionModel()->selectedIndexes();
if(!sel.empty())
{
QModelIndex i = sel[0].sibling(sel[0].row(), 0);
while(i.isValid())
{
ret.insert(0, qHash(i.data(Qt::DisplayRole).toString()));
i = i.parent();
}
}

return ret;
}

void RDTreeView::applySelectedItemState(RDTreeViewSelectedItemState state)
{
QModelIndex cur;

for(int i = 0; i < state.count(); i++)
{
bool found = false;

for(int row = 0, count = model()->rowCount(cur); row < count; row++)
{
QModelIndex check = model()->index(row, 0, cur);
if(qHash(model()->data(check).toString()) == state[i])
{
found = true;
cur = check;
break;
}
}

if(!found)
return;
}

QItemSelection sel(cur, cur.sibling(cur.row(), model()->columnCount() - 1));

scrollTo(cur);
selectionModel()->select(sel, QItemSelectionModel::ClearAndSelect);
}

void RDTreeView::copySelection()
{
QModelIndexList sel = selectionModel()->selectedRows();
Expand Down
4 changes: 4 additions & 0 deletions qrenderdoc/Widgets/Extended/RDTreeView.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
class RDTreeView;

typedef QSet<uint> RDTreeViewExpansionState;
typedef QList<uint> RDTreeViewSelectedItemState;

class RDTreeViewDelegate : public RichTextViewDelegate
{
Expand Down Expand Up @@ -129,6 +130,9 @@ class RDTreeView : public QTreeView
});
}

RDTreeViewSelectedItemState saveSelectedItemState();
void applySelectedItemState(RDTreeViewSelectedItemState state);

// Internally tracked expansions
RDTreeViewExpansionState &getInternalExpansion(uint expansionID)
{
Expand Down
105 changes: 105 additions & 0 deletions qrenderdoc/Widgets/PixelDebugSelector.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2021-2026 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/

#include "PixelDebugSelector.h"
#include "Code/QRDUtils.h"
#include "ui_PixelDebugSelector.h"

PixelDebugSelector::PixelDebugSelector(ICaptureContext &ctx, QWidget *parent)
: QDialog(parent), ui(new Ui::PixelDebugSelector), m_Ctx(ctx)
{
ui->setupUi(this);

setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

ui->x->setFont(Formatter::PreferredFont());
ui->y->setFont(Formatter::PreferredFont());
ui->primitive->setFont(Formatter::PreferredFont());
ui->sample->setFont(Formatter::PreferredFont());
ui->view->setFont(Formatter::PreferredFont());
}

PixelDebugSelector::~PixelDebugSelector()
{
delete ui;
}

void PixelDebugSelector::UpdateTarget()
{
const ActionDescription *action = m_Ctx.CurAction();

if(!action)
return;

const PipeState &pipe = m_Ctx.CurPipelineState();

ui->view->setMaximum(pipe.MultiviewBroadcastCount() - 1);
ui->viewLabel->setVisible(ui->view->maximum() > 1);
ui->view->setVisible(ui->view->maximum() > 1);
Comment on lines +58 to +59

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Show disambiguation controls when two choices are available

For a Vulkan render pass with exactly two multiview views, the spin-box maximum is one, so these checks hide the view selector even though view 1 is valid. Users therefore cannot select the second view for pixel debugging. The sample visibility checks below have the same off-by-one error for 2× sampling. Since these maxima are zero-based indices, show the controls when the maximum is greater than zero, not greater than one.

Useful? React with 👍 / 👎.


uint32_t sampleCount = pipe.GetOverrideSampleCount();

if(sampleCount == 0)
{
for(const Descriptor &d : pipe.GetOutputTargets())
{
const TextureDescription *tex = m_Ctx.GetTexture(d.resource);
if(tex)
sampleCount = qMax(sampleCount, tex->msSamp);
}
}

ui->sample->setMaximum(pipe.GetOverrideSampleCount() - 1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the resolved sample count for the sample selector

When a D3D11 draw uses an MSAA render target without a forced sample count, GetOverrideSampleCount() returns zero. The preceding loop correctly derives sampleCount from the output textures, but this line discards that result and subtracts one from the zero override instead. This gives the spin box an invalid maximum and hides the selector, preventing users from selecting individual MSAA samples. Set the maximum using the resolved sampleCount, with a lower bound of one before subtraction.

Useful? React with 👍 / 👎.

ui->sampleLabel->setVisible(ui->sample->maximum() > 1);
ui->sample->setVisible(ui->sample->maximum() > 1);
}

void PixelDebugSelector::on_selectedPixel_clicked()
{
rdcpair<int32_t, int32_t> sel = m_Ctx.GetTextureViewer()->GetPickedLocation();

ui->x->setValue(sel.first);
ui->y->setValue(sel.second);
}

void PixelDebugSelector::on_beginDebug_clicked()
{
DebugPixelInputs inputs;

bool ok = false;
inputs.primitive = ui->primitive->text().toUInt(&ok);
if(!ok)
inputs.primitive = ~0U;

inputs.sample = ui->sample->value();
inputs.view = ui->view->value();

emit beginDebug(ui->x->value(), ui->y->value(), inputs);
close();
}

void PixelDebugSelector::on_cancelDebug_clicked()
{
close();
}
Loading
Loading