Main Interfaces¶
Context¶
- class qrenderdoc.CaptureContext¶
The capture context that the python script is running in.
- APIProps()¶
Retrieve the
APIProperties
for the currently loaded capture.- Returns:
The API properties.
- Return type:
- AddCaptureViewer(viewer)¶
Register a new instance of
CaptureViewer
to receive capture event notifications.- Parameters:
viewer# (CaptureViewer) – The viewer to register.
- AddDockWindow(newWindow, ref, refWindow, percentage=0.5)¶
- AddDockWindow(newWindow, ref, refWindow) None
Adds a new window within the docking system.
- Parameters:
newWindow# (QWidget) – The new window to add.
ref# (DockReference) – The location to add the new window, possibly relative to
refWindow
.refWindow# (QWidget) – The window to refer to if the new window is being added relative, or can be
None
if the new location is absolute.percentage# (float) – Optionally the percentage to split the area. If omitted, a 50% split is used.
- AddMessages(msgs)¶
Add messages into the list returned by
DebugMessages()
. Initially set to unread.- Parameters:
msgs# (List[renderdoc.DebugMessage]) – A list of debug messages to add.
- BuiltinWindowClosed(window)¶
Marks a built-in window as closed.
This function is intended for internal use by the built-in windows for singleton management, and should not be called by user code.
- Parameters:
window# (QWidget) – The built-in window that closed.
- CloseCapture()¶
Close the currently open capture file.
- Config()¶
Retrieve the current persistant config.
- Returns:
The current persistant config manager.
- Return type:
- ConnectToRemoteServer(host)¶
Connect to a remote server.
- Parameters:
host# (RemoteHost) – The host to connect to.
- CreateBuiltinWindow(objectName)¶
Creates and returns a built-in window.
This function is intended for internal use for restoring layouts, and generally should not be used by user code.
- Parameters:
objectName# (str) – The built-in name of a singleton window.
- Returns:
The handle to the existing or newly created window of this type.
- Return type:
QWidget
- CreateWindowingData(window)¶
Create an opaque pointer suitable for passing to
CreateOutput()
or other functions that expect windowing data.Note
This function must be called on the main UI thread.
- Parameters:
window# (QWidget) – The window to create windowing data for.
- Returns:
The windowing data.
- Return type:
- CurAction()¶
Retrieve the current action.
- Returns:
The current action, or
None
if no action is selected.- Return type:
- CurD3D11PipelineState()¶
Retrieve the current
D3D11State
pipeline state.The return value will be
None
if the capture is not using the D3D11 API. You should determine the API of the capture first before fetching it.- Returns:
The current D3D11 pipeline state.
- Return type:
- CurD3D12PipelineState()¶
Retrieve the current
D3D12State
pipeline state.The return value will be
None
if the capture is not using the D3D12 API. You should determine the API of the capture first before fetching it.- Returns:
The current D3D12 pipeline state.
- Return type:
- CurGLPipelineState()¶
Retrieve the current
GLState
pipeline state.The return value will be
None
if the capture is not using the OpenGL API. You should determine the API of the capture first before fetching it.- Returns:
The current OpenGL pipeline state.
- Return type:
- CurPipelineState()¶
Retrieve the current
PipeState
abstracted pipeline state.This pipeline state will always be valid, and allows queries that will work regardless of the capture’s API.
- Returns:
The current API-agnostic abstracted pipeline state.
- Return type:
- CurRootActions()¶
Retrieve the root list of actions in the current capture.
- Returns:
The root actions.
- Return type:
- CurSelectedAction()¶
Retrieve the currently selected action.
In most cases, prefer using
CurAction()
. SeeCaptureViewer.OnSelectedEventChanged()
for more information for how this differs.- Returns:
The currently selected action.
- Return type:
- CurSelectedEvent()¶
Retrieve the currently selected
eventId
.In most cases, prefer using
CurEvent()
. SeeCaptureViewer.OnSelectedEventChanged()
for more information for how this differs.- Returns:
The current selected event.
- Return type:
int
- CurVulkanPipelineState()¶
Retrieve the current
VKState
pipeline state.The return value will be
None
if the capture is not using the Vulkan API. You should determine the API of the capture first before fetching it.- Returns:
The current Vulkan pipeline state.
- Return type:
- CurWindowingSystem()¶
Retrieve the current windowing system in use.
- Returns:
The active windowing system.
- Return type:
- CustomShaderEncodings()¶
Retrieve the list of
ShaderEncoding
that are available for building custom shaders for the currently loaded capture. SeeBuildCustomShader()
.- Returns:
The available encodings.
- Return type:
List[renderdoc.ShaderEncoding]
- CustomShaderSourcePrefixes()¶
Retrieve the list of prefixes for each
ShaderEncoding
that should be added to custom compiled shaders. SeeGetCustomShaderSourcePrefixes()
.- Returns:
A list of pairs, listing a prefix for each shader encoding referenced.
- Return type:
- DebugMessages()¶
Retrieve the current list of debug messages. This includes messages from the capture as well as messages generated during replay and analysis.
- Returns:
The debug messages generated to date.
- Return type:
List[renderdoc.DebugMessage]
- DebugShader(bind, shader, pipeline, trace, debugContext)¶
Show a new
ShaderViewer
window, showing a read-only view of a debug trace through the execution of a given shader.- Parameters:
bind# (renderdoc.ShaderBindpointMapping) – The bindpoint mapping for the shader to view.
shader# (renderdoc.ShaderReflection) – The reflection data for the shader to view.
pipeline# (renderdoc.ResourceId) – The pipeline state object, if applicable, that this shader is bound to.
trace# (renderdoc.ShaderDebugTrace) – The execution trace of the debugged shader.
debugContext# (str) – A human-readable context string describing which invocation of this shader was debugged. For example ‘Pixel 12,34 at eventId 678’.
- Returns:
The new
ShaderViewer
window opened, but not shown.- Return type:
- EditShader(id, stage, entryPoint, files, knownTool, shaderEncoding, flags, saveCallback, revertCallback)¶
Show a new
ShaderViewer
window, showing an editable view of a given shader.- Parameters:
id# (renderdoc.ResourceId) – The shader object, if applicable, that’s being edited. If this edit corresponds to no shader object (such as if it’s a custom shader) this can be a null ID.
stage# (renderdoc.ShaderStage) – The shader stage for this shader.
entryPoint# (str) – The entry point to be used when compiling the edited shader.
files# (List[Tuple[str,str]]) – The source files, with each tuple being a pair of the filename and the file contents.
knownTool# (renderdoc.KnownShaderTool) – The preferred tool to use to compile, if known.
shaderEncoding# (renderdoc.ShaderEncoding) – The encoding of the input files.
flags# (renderdoc.ShaderCompileFlags) – The flags originally used to compile the shader.
saveCallback# (ShaderViewer.SaveCallback) – The callback function to call when a save/update is triggered.
revertCallback# (ShaderViewer.RevertCallback) – The callback function to call when the shader is to be reverted - either by user request or because the shader viewer was closed.
- Returns:
The new
ShaderViewer
window opened but not shown for editing.- Return type:
- ExportCapture(fmt, exportfile)¶
Exports the current capture file to a given path with a specified capture file format.
The capture must be available locally, if it’s not this function will fail.
- Parameters:
fmt# (renderdoc.CaptureFileFormat) – The capture file format to export to.
exportfile# (str) – The path to export the capture file to.
- Extensions()¶
Retrieve the manager for extensions.
- Returns:
The current extension manager.
- Return type:
- FrameInfo()¶
Retrieve the
FrameDescription
for the currently loaded capture.- Returns:
The frame information.
- Return type:
- GetAPIInspector()¶
Retrieve the current singleton
APIInspector
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetAction(eventId)¶
Retrieve the information about an action at a given
eventId
.- Parameters:
- Returns:
The information about the action, or
None
if theeventId
doesn’t correspond to an action.- Return type:
- GetBookmarks()¶
Get the current list of bookmarks in the capture. Each bookmark is associated with an eventId and has some text attached. There will only be at most one bookmark for any given eventId.
The list of bookmarks is not necessarily sorted by eventId. Thus, bookmark 1 is always bookmark 1 until it is removed, the indices do not shift as new bookmarks are added or removed.
- Returns:
The currently set bookmarks.
- Return type:
List[EventBookmark]
- GetBuffer(id)¶
Retrieve the information about a particular buffer.
- Parameters:
id# (renderdoc.ResourceId) – The ID of the buffer to query about.
- Returns:
The information about a buffer, or
None
if the ID does not correspond to a buffer.- Return type:
- GetBuffers()¶
Retrieve the list of buffers in the current capture.
- Returns:
The list of buffers.
- Return type:
- GetCaptureDialog()¶
Retrieve the current singleton
CaptureDialog
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetCaptureFilename()¶
Retrieve the filename for the currently loaded capture.
- Returns:
The filename of the current capture.
- Return type:
str
- GetCaptureModifications()¶
Get a bitmask indicating which modifications (if any) have been made to the capture in the UI which aren’t reflected in the capture file on disk.
- Returns:
The modifications (if any) that have been made to the capture.
- Return type:
- GetCommentView()¶
Retrieve the current singleton
CommentView
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetDebugMessageView()¶
Retrieve the current singleton
DebugMessageView
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetDiagnosticLogView()¶
Retrieve the current singleton
LogView
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetEventBrowser()¶
Retrieve the current singleton
EventBrowser
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetFatalError()¶
If a capture is loaded, return the current fatal error status.
- Returns:
If a capture is currently loaded, return the fatal error status.
- Return type:
- GetFirstAction()¶
Retrieve the first action in the capture.
- Returns:
The first action.
- Return type:
- GetLastAction()¶
Retrieve the last action in the capture.
- Returns:
The last action.
- Return type:
- GetMainWindow()¶
Retrieve the current singleton
MainWindow
.- Returns:
The current window.
- Return type:
- GetMeshPreview()¶
Retrieve the current singleton
BufferViewer
configured for mesh viewing.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetNotes(key)¶
Retrieve the contents for a given notes field.
Examples of fields are:
‘comments’ for generic comments to be displayed in a text field
‘hwinfo’ for a plaintext summary of the hardware and driver configuration of the system.
- Parameters:
key# (str) – The name of the notes field to retrieve.
- Returns:
The contents, or an empty string if the field doesn’t exist.
- Return type:
str
- GetPerformanceCounterViewer()¶
Retrieve the current singleton
PerformanceCounterViewer
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetPipelineViewer()¶
Retrieve the current singleton
PipelineStateViewer
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetPythonShell()¶
Retrieve the current singleton
PythonShell
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetRGPInterop()¶
Returns the current interop handle for RGP.
This may return
None
in several cases:if there is no capture loaded
if no RGP profile has been associated with the current capture yet (See
OpenRGPProfile()
)if RGP failed to launch or connect.
The handle returned is invalidated when the capture is closed, or if
OpenRGPProfile()
is called.- Returns:
The RGP interop connection handle.
- Return type:
- GetResource(id)¶
Retrieve the information about a particular resource.
- Parameters:
id# (renderdoc.ResourceId) – The ID of the resource to query about.
- Returns:
The information about a resource, or
None
if the ID does not correspond to a resource.- Return type:
- GetResourceInspector()¶
Retrieve the current singleton
ResourceInspector
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetResourceName(id)¶
Retrieve the human-readable name for the resource to display.
This will first check to see if a custom name has been set for the resource, and if so use that. See
SetResourceCustomName()
. If no custom name has been set, it will use the resource name found in the capture, either a name set via API-specific debug methods, or an auto-generated name based on the resource type.- Parameters:
id# (renderdoc.ResourceId) – The ID of the resource to query.
- Returns:
The current name of the resource.
- Return type:
str
- GetResourceNameUnsuffixed(id)¶
Returns the same name as
GetResourceName()
but without any added suffix, e.g. to indicate the resource’s status such as (Edited).- Parameters:
id# (renderdoc.ResourceId) – The ID of the resource to query.
- Returns:
The unsuffixed resource name.
- Return type:
str
- GetResourceReplacement(id)¶
Return the id of a replacement for the given resource. See
RegisterReplacement()
andIsResourceReplaced()
.- Parameters:
id# (renderdoc.ResourceId) – The id of the resource to check.
- Returns:
The replacement id, or a null id if the resource hasn’t been replaced
- Return type:
- GetResources()¶
Retrieve the list of resources in the current capture.
- Returns:
The list of resources.
- Return type:
- GetStatisticsViewer()¶
Retrieve the current singleton
StatisticsViewer
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetStructuredFile()¶
Retrieve the
SDFile
for the currently open capture.- Returns:
The structured file.
- Return type:
- GetTexture(id)¶
Retrieve the information about a particular texture.
- Parameters:
id# (renderdoc.ResourceId) – The ID of the texture to query about.
- Returns:
The information about a texture, or
None
if the ID does not correspond to a texture.- Return type:
- GetTextureViewer()¶
Retrieve the current singleton
TextureViewer
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- GetTextures()¶
Retrieve the list of textures in the current capture.
- Returns:
The list of textures.
- Return type:
- GetTimelineBar()¶
Retrieve the current singleton
TimelineBar
.- Returns:
The current window, which is created (but not shown) it there wasn’t one open.
- Return type:
- HasAPIInspector()¶
Check if there is a current
APIInspector
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasCaptureDialog()¶
Check if there is a current
CaptureDialog
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasCommentView()¶
Check if there is a current
CommentView
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasDebugMessageView()¶
Check if there is a current
DebugMessageView
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasDiagnosticLogView()¶
Check if there is a current
DiagnosticLogView
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasEventBrowser()¶
Check if there is a current
EventBrowser
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasMeshPreview()¶
Check if there is a current mesh previewing
BufferViewer
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasPerformanceCounterViewer()¶
Check if there is a current
PerformanceCounterViewer
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasPipelineViewer()¶
Check if there is a current
PipelineStateViewer
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasPythonShell()¶
Check if there is a current
PythonShell
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasResourceCustomName(id)¶
Checks whether a runtime custom name has been set with
SetResourceCustomName()
.In general,
IsAutogeneratedName()
should be preferred to check if the resource name is default generated just from the ID, or if it has been set to some human readable name. This function will only check if a name has been set in the UI itself, a resource could still have a custom name that was set programmatically during capture time.- Parameters:
id# (renderdoc.ResourceId) – The ID of the resource to query.
- Returns:
Whether the name for the resource has been customised with
SetResourceCustomName()
.- Return type:
bool
- HasResourceInspector()¶
Check if there is a current
ResourceInspector
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasStatisticsViewer()¶
Check if there is a current
StatisticsViewer
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasTextureViewer()¶
Check if there is a current
TextureViewer
open.- Returns:
True
if there is a window open.- Return type:
bool
- HasTimelineBar()¶
Check if there is a current
TimelineBar
open.- Returns:
True
if there is a window open.- Return type:
bool
- ImportCapture(fmt, importfile, rdcfile)¶
Imports a capture file from a non-native format, via conversion to temporary rdc.
This converts the file to a specified temporary .rdc and loads it, closing any existing capture.
The capture must be available locally, if it’s not this function will fail.
- Parameters:
fmt# (renderdoc.CaptureFileFormat) – The capture file format to import from.
importfile# (str) – The path to import from.
rdcfile# (str) – The temporary path to save the rdc file to.
- Returns:
True
if the import operation was successful and the capture was loaded.- Return type:
bool
- IsAutogeneratedName(id)¶
Determines whether the name for the given resource has been customised at all, either during capture time or with
SetResourceCustomName()
.If not, the name is just auto-generated based on the ID and resource type, so depending on circumstance it may be preferable to omit the name.
- Parameters:
id# (renderdoc.ResourceId) – The ID of the resource to query.
- Returns:
Whether the name for the resource has just been auto-generated.
- Return type:
bool
- IsCaptureLoaded()¶
Check whether or not a capture is currently loaded.
- Returns:
True
if a capture is loaded.- Return type:
bool
- IsCaptureLoading()¶
Check whether or not a capture is currently loading in-progress.
- Returns:
True
if a capture is currently loading.- Return type:
bool
- IsCaptureLocal()¶
Check whether or not the current capture is stored locally, or on a remote host.
- Returns:
True
if a capture is local.- Return type:
bool
- IsCaptureTemporary()¶
Check whether or not the current capture is considered temporary. Captures that were made by an application and then have not been explicitly saved anywhere are temporary and will be cleaned up on close (with a final prompt to save). Once they are save to disk, they are no longer temporary and treated like any other capture.
- Returns:
True
if a capture is temporary.- Return type:
bool
- IsResourceReplaced(id)¶
Determine if a resource has been replaced. See
RegisterReplacement()
.- Parameters:
id# (renderdoc.ResourceId) – The id of the resource to check.
- Returns:
True
if the resource has been replaced.- Return type:
bool
- LoadCapture(captureFile, opts, origFilename, temporary, local)¶
Open a capture file for replay.
- Parameters:
captureFile# (str) – The actual path to the capture file.
opts# (renderdoc.ReplayOptions) – The options controlling how the capture should be replayed.
origFilename# (str) – The original filename, if the capture was copied remotely for replay.
temporary# (bool) –
True
if this is a temporary capture which should prompt the user for either save or delete on close.local# (bool) –
True
ifcaptureFile
refers to a file on the local machine.
- MarkMessagesRead()¶
Mark all messages as read, resets
UnreadMessageCount()
to 0.
- OpenRGPProfile(filename)¶
Sets the path to the RGP profile to use with
GetRGPInterop()
, launches RGP and opens an interop connection. This function will block (with a progress dialog) until either an error is encountered or else the connection is successfully established.This could be newly created, or extracted from an embedded section in the RDC.
The connection is automatically closed when the capture is closed. If OpenRGPProfile is called again, any previous connection will be closed.
- Parameters:
filename# (str) – The filename of the extracted temporary RGP capture on disk.
- Returns:
Whether RGP launched successfully.
- Return type:
bool
- RaiseDockWindow(dockWindow)¶
Raises a window within its docking manager so it becomes the focus of wherever it is currently docked.
- Parameters:
dockWindow# (QWidget) – The window to raise.
- RecompressCapture()¶
Recompress the current capture as much as possible.
- RefreshStatus()¶
Replay the capture to the current event again, to pick up any changes that might have been made.
- RegisterReplacement(arg2, to)¶
Register that a resource has replaced, so that the UI can be updated to reflect the change.
This should be called at the same time as
ReplayController.ReplaceResource()
.- Parameters:
from# (renderdoc.ResourceId) – The id of the resource being replaced.
to# (renderdoc.ResourceId) – The id of the resource replacing it.
- RemoveBookmark(eventId)¶
Remove a bookmark at a given eventId.
If no bookmark exists, this function will do nothing.
- Parameters:
eventId# (int) – The eventId of the bookmark to remove.
- RemoveCaptureViewer(viewer)¶
Unregister an instance of
CaptureViewer
from receiving notifications.- Parameters:
viewer# (CaptureViewer) – The viewer to unregister.
- Replay()¶
Retrieve the replay manager for access to the internal RenderDoc replay controller.
- Returns:
The current replay manager.
- Return type:
- ResourceNameCacheID()¶
Returns an index that can be used to cache the results of resource naming.
In some cases (e.g. formatting in widgets) there might be high frequency fetches to names without an easy way to force a refresh on a rename. Instead, the index here can be cached and compared each time to see if any names have changed.
The index starts at 1, so initialising an internal cache to 0 will cause the first check to be considered out of date
- Returns:
An incrementing index that can be used as a quick check if any names have changed.
- Return type:
int
- SaveCaptureTo(captureFile)¶
Saves the current capture file to a given path.
If the capture was temporary, this save action means it is no longer temporary and will be treated like any other capture.
Any modifications to the capture (see
GetCaptureModifications()
) will be applied at the same time.- Parameters:
captureFile# (str) – The path to save the capture file to.
- Returns:
True
if the save operation was successful.- Return type:
bool
- SetBookmark(mark)¶
Set or update a bookmark.
A bookmark will be added at the specified eventId, or if one already exists then the attached text will be replaced.
- Parameters:
mark# (EventBookmark) – The bookmark to add.
- SetEventID(exclude, selectedEventId, eventId, force=False)¶
- SetEventID(exclude, selectedEventId, eventId) None
Move the current replay to a new event in the capture.
- Parameters:
exclude# (List[CaptureViewer]) – A list of viewers to exclude from being notified of this change, to stop infinite recursion.
selectedEventId# (int) – The selected
eventId
. SeeCaptureViewer.OnSelectedEventChanged()
for more information.eventId# (int) – The new current
eventId
. SeeCaptureViewer.OnEventChanged()
for more information.force# (bool) – Optional parameter, if
True
then the replay will ‘move’ even if it is moving to the sameeventId
as it’s currently on.
- SetNotes(key, contents)¶
Set the contents for a given notes field.
See
GetNotes()
for a list of possible common field keys.
- SetResourceCustomName(id, name)¶
Set a custom name for a resource.
This allows an override to the name returned by
GetResourceName()
, most useful when there are no pre-existing debug names specified in the capture.To remove a custom name that has been set previously, specify the empty string as the name. Then the custom name will be removed, and instead
GetResourceName()
will fall back to returning any name fetched from the capture.- Parameters:
id# (renderdoc.ResourceId) – The ID of the resource to name.
name# (str) – The name to provide, or an empty string to remove any previous custom name.
- ShowAPIInspector()¶
Raise the current
APIInspector
, showing it in the default place if needed.
- ShowCaptureDialog()¶
Raise the current
CaptureDialog
, showing it in the default place if needed.
- ShowCommentView()¶
Raise the current
CommentView
, showing it in the default place if needed.
- ShowDebugMessageView()¶
Raise the current
DebugMessageView
, showing it in the default place if needed.
- ShowDiagnosticLogView()¶
Raise the current
DiagnosticLogView
, showing it in the default place if needed.
- ShowEventBrowser()¶
Raise the current
EventBrowser
, showing it in the default place if needed.
- ShowMeshPreview()¶
Raise the current mesh previewing
BufferViewer
, showing it in the default place if needed.
- ShowPerformanceCounterViewer()¶
Raise the current
PerformanceCounterViewer
, showing it in the default place if needed.
- ShowPipelineViewer()¶
Raise the current
PipelineStateViewer
, showing it in the default place if needed.
- ShowPythonShell()¶
Raise the current
PythonShell
, showing it in the default place if needed.
- ShowResourceInspector()¶
Raise the current
ResourceInspector
, showing it in the default place if needed.
- ShowStatisticsViewer()¶
Raise the current
StatisticsViewer
, showing it in the default place if needed.
- ShowTextureViewer()¶
Raise the current
TextureViewer
, showing it in the default place if needed.
- ShowTimelineBar()¶
Raise the current
TimelineBar
, showing it in the default place if needed.
- TargetShaderEncodings()¶
Retrieve the list of
ShaderEncoding
that are available for building target shaders for the currently loaded capture. SeeBuildTargetShader()
.- Returns:
The available encodings.
- Return type:
List[renderdoc.ShaderEncoding]
- TempCaptureFilename(appname)¶
Retrieve the absolute path where a given temporary capture should be stored. data.
- Parameters:
appname# (str) – The name of the application to use as part of the template.
- Returns:
The absolute path.
- Return type:
str
- UnreadMessageCount()¶
Retrieve how many messages in
DebugMessages()
are currently unread.- Returns:
The number of unread messages.
- Return type:
int
- UnregisterReplacement(id)¶
Register that a replacement has been removed, so that the UI can be updated to reflect the change.
This should be called at the same time as
ReplayController.RemoveReplacement()
.See
ReplaceResource()
.- Parameters:
id# (renderdoc.ResourceId) – The id of the original resource that was previously replaced.
- ViewBuffer(byteOffset, byteSize, id, format)¶
- ViewBuffer(byteOffset, byteSize, id) None
Show a new
BufferViewer
window, showing a read-only view of buffer data.- Parameters:
byteOffset# (int) – The offset in bytes to the start of the buffer data to show.
byteSize# (int) – The number of bytes in the buffer to show.
id# (renderdoc.ResourceId) – The ID of the buffer to fetch data from.
format# (str) – Optionally a HLSL/GLSL style formatting string.
- Returns:
The new
BufferViewer
window opened, but not shown.- Return type:
- ViewConstantBuffer(stage, slot, idx)¶
Show a new
BufferViewer
window, showing a read-only view of a the variables in a constant buffer with their values.- Parameters:
stage# (renderdoc.ShaderStage) – The stage that the constant buffer is bound to.
slot# (int) – The index in the shader’s constant buffer list to look up.
idx# (int) – For APIs that support arrayed resource binds, the index in the constant buffer array.
- Returns:
The new
BufferViewer
window opened, but not shown.- Return type:
- ViewPixelHistory(id, x, y, display)¶
Show a new
PixelHistoryView
window, showing the results from a pixel history operation.- Parameters:
id# (renderdoc.ResourceId) – The ID of the texture to show the history of.
x# (int) – The x co-ordinate of the pixel to search for.
y# (int) – The y co-ordinate of the pixel to search for.
display# (renderdoc.TextureDisplay) – The texture display configuration to use when looking up the history.
- Returns:
The new
PixelHistoryView
window opened, but not shown.- Return type:
- ViewShader(shader, pipeline)¶
Show a new
ShaderViewer
window, showing a read-only view of a given shader.- Parameters:
shader# (renderdoc.ShaderReflection) – The reflection data for the shader to view.
pipeline# (renderdoc.ResourceId) – The pipeline state object, if applicable, that this shader is bound to.
- Returns:
The new
ShaderViewer
window opened, but not shown.- Return type:
- ViewShaderMessages(stages)¶
Show a new
ShaderMessageViewer
window, showing the current event’s messages.- Parameters:
stages# (renderdoc.ShaderStageMask) – The initial stages being viewed.
- Returns:
The new
ShaderMessageViewer
window opened, but not shown.- Return type:
- ViewTextureAsBuffer(id, sub, format)¶
- ViewTextureAsBuffer(id, sub) None
Show a new
BufferViewer
window, showing a read-only view of a texture’s raw bytes.- Parameters:
id# (renderdoc.ResourceId) – The ID of the texture itself.
sub# (renderdoc.Subresource) – The subresource within this texture to use.
format# (str) – Optionally a HLSL/GLSL style formatting string.
- Returns:
The new
BufferViewer
window opened, but not shown.- Return type:
Replay Manager¶
- class qrenderdoc.ReplayManager¶
A manager for accessing the underlying replay information that isn’t already abstracted in UI side structures. This manager controls and serialises access to the underlying
ReplayController
, as well as handling remote server connections.- InvokeCallback(controller)¶
Not a member function - the signature for any
InvokeCallback
callbacks.- Parameters:
controller (renderdoc.ReplayController) – The controller to access. Must not be cached or used after the callback returns.
- DirectoryBrowseCallback(path, entries)¶
Not a member function - the signature for any
DirectoryBrowseCallback
callbacks.- Parameters:
path (str) – The path that was queried for.
entries (List[renderdoc.PathEntry]) – The entries underneath the path, as relevant.
- AsyncInvoke(tag, method)¶
- AsyncInvoke(method) None
Make a tagged non-blocking invoke call onto the replay thread.
This tagged function is for cases when we might send a request - e.g. to pick a vertex or pixel - and want to pre-empt it with a new request before the first has returned. Either because some other work is taking a while or because we’re sending requests faster than they can be processed.
The manager processes only the request on the top of the queue, so when a new tagged invoke comes in, we remove any other requests in the queue before it that have the same tag.
- BlockInvoke(m)¶
Make a blocking invoke call onto the replay thread.
- Parameters:
method# (InvokeCallback) – The function to callback on the replay thread.
- CancelReplayLoop()¶
Cancels the active replay loop. See
ReplayLoop()
.
- ConnectToRemoteServer(host)¶
Connect to a remote server.
- Parameters:
host# (RemoteHost) – The host to connect to.
- Returns:
Whether or not the connection was successful.
- Return type:
- CopyCaptureFromRemote(remotepath, localpath, window)¶
Copy a capture from the remote host to the local machine.
- CopyCaptureToRemote(localpath, window)¶
Copy a capture from the local machine to the remote host.
- CurrentRemote()¶
Retrieves the host that the manager is currently connected to.
- Returns:
The host connected to, or an invalid RemoteHost if no connection is active.
- Return type:
- DeleteCapture(capturefile, local)¶
Delete a capture file, whether local or remote.
- DisconnectFromRemoteServer()¶
Disconnect from the server the manager is currently connected to.
- ExecuteAndInject(exe, workingDir, cmdLine, env, capturefile, opts)¶
Launch an application and inject into it to allow capturing.
This happens either locally, or on the remote server, depending on whether a connection is active.
- Parameters:
exe# (str) – The path to the executable to run.
workingDir# (str) – The working directory to use when running the application. If blank, the directory containing the executable is used.
cmdLine# (str) – The command line to use when running the executable, it will be processed in a platform specific way to generate arguments.
env# (List[renderdoc.EnvironmentModification]) – Any environment changes that should be made when running the program.
capturefile# (str) – The location to save any captures, if running locally.
opts# (renderdoc.CaptureOptions) – The capture options to use when injecting into the program.
- Returns:
The
ExecuteResult
indicating both the status of the operation (success or failure) and any reason for failure, or else the ident where the new application is listening for target control if everything succeeded.- Return type:
- GetCaptureAccess()¶
Retrieves the capture file handle for the currently open file.
- Returns:
The file handle active, or
None
if no capture is open.- Return type:
- GetCurrentProcessingTime()¶
Return the amount of time that the currently active command on the replay thread has been executing for.
This can be used to identify if a command is long-running to display a progress bar or notification.
- Returns:
The time in seconds that the current command has been executing for, or 0.0 if no command is executing.
- Return type:
float
- GetHomeFolder(synchronous, callback)¶
Query the remote host for its home directory.
If a capture is open, the callback will happen on the replay thread, otherwise it will happen in a blocking fashion on the current thread.
- Parameters:
synchronous# (bool) – If a capture is open, then
True
will useBlockInvoke()
to call the callback. Otherwise ifFalse
thenAsyncInvoke()
will be used.callback# (DirectoryBrowseCallback) – The function to callback on the replay thread.
- GetRemoteSupport()¶
Retrieve a list of drivers that the current remote server supports.
- Returns:
The list of supported replay drivers.
- Return type:
List[str]
- ListFolder(path, synchronous, callback)¶
Query the remote host for the contents of a path.
If a capture is open, the callback will happen on the replay thread, otherwise it will happen in a blocking fashion on the current thread.
- Parameters:
path# (str) – The path to query the contents of.
synchronous# (bool) – If a capture is open, then
True
will useBlockInvoke()
to call the callback. Otherwise ifFalse
thenAsyncInvoke()
will be used.callback# (DirectoryBrowseCallback) – The function to callback on the replay thread.
- PingRemote()¶
Ping the remote server to ensure the connection is still alive.
- ShutdownServer()¶
Shutdown the server the manager is currently connected to.
RGP Interop Control¶
CaptureViewer Interface¶
- class qrenderdoc.CaptureViewer¶
An interface implemented by any object wanting to be notified of capture events.
- OnCaptureClosed()¶
Called whenever a capture is closed.
- OnCaptureLoaded()¶
Called whenever a capture is opened.
- OnEventChanged(eventId)¶
Called whenever the effective current event changes.
- OnSelectedEventChanged(eventId)¶
Called whenever the current selected event changes. This is distinct from the actual effective current event, since for example selecting a marker region will change the current event to be the last event inside that region, to be consistent with selecting an item reflecting the current state after that item.
The selected event shows the
eventId
that was actually selected, which will usually but not always be the same as the current effectiveeventId
.The distinction for this callback is not normally desired, instead use
OnEventChanged()
to be notified whenever the current event changes. The API inspector uses this to display API events up to a marker region.
Utilities¶
- class qrenderdoc.DockReference(value)¶
Specifies the relationship between the existing dock window and the new one when adding a new dock window or moving an existing dock window.
- LastUsedArea¶
The existing dock window is not used, the new dock window is placed wherever the last dock window was placed.
- NewFloatingArea¶
The existing dock window is not used, the new dock window is placed in a new floating area.
- EmptySpace¶
The existing dock window is not used, the new dock window is placed in empty area in the dockarea.
- NoArea¶
The existing dock window is not used, the new window is hidden.
- AddTo¶
The new dock window is placed in a tab set with the existing dock window.
- LeftOf¶
The new dock window is placed to the left of the existing dock window, at a specified proportion.
- RightOf¶
The new dock window is placed to the right of the existing dock window, at a specified proportion.
- TopOf¶
The new dock window is placed above the existing dock window, at a specified proportion.
- BottomOf¶
The new dock window is placed below the existing dock window, at a specified proportion.
- LeftWindowSide¶
The new dock window is placed left of all docks in the window, at a specified proportion.
- RightWindowSide¶
The new dock window is placed right of all docks in the window, at a specified proportion.
- TopWindowSide¶
The new dock window is placed above all docks in the window, at a specified proportion.
- BottomWindowSide¶
The new dock window is placed below all docks in the window, at a specified proportion.
- MainToolArea¶
The new dock window is placed in the ‘main’ tool area as defined by finding an existing known window and using that as the main area. In the default layout this is where most windows are placed.
- LeftToolArea¶
The new dock window is placed in the ‘left’ tool area as defined by finding an existing known window and using that as the main area, then adding to the left of that. In the default layout this is where the event browser is placed.
- TransientPopupArea¶
The new dock window is docked with other similar transient views like constant buffer or pixel history windows, if they exist, or else docked to the right of the main window.
- class qrenderdoc.CaptureModifications(value)¶
Details any changes that have been made to a capture in the UI which can be saved to disk but currently aren’t. Note that detection is conservative - e.g. if a change is made, then cancelled out by reversing the change, this will still count as ‘modified’ even if the end result is the same data. In that sense it’s analogous to adding and then deleting some characters in a text editor, since there is no actual undo system.
This is a bitmask, so several values can be present at once.
- NoModifications¶
Fixed value of 0 indicating no modifications have been made.
- Renames¶
One or more resources have been given a custom name which hasn’t been saved.
- Bookmarks¶
Event bookmarks have been added or removed.
- Notes¶
The general notes field has been changed.
- EditedShaders¶
There are shader editing changes (new edits or reverts).
- All¶
Fixed value with all bits set, indication all modifications have been made.
- class qrenderdoc.CaptureSettings¶
Contains all of the settings that control how to capture an executable.
- autoStart¶
True
if this capture settings object should be immediately executed upon load.
- commandLine¶
The command line to pass when running
executable
.
- environment¶
The environment changes to apply.
- Type:
- executable¶
The path to the executable to run.
- inject¶
True
if the described capture is an inject-into-process instead of a launched executable.
- numQueuedFrames¶
The number of queued frames to capture, or 0 if no frames are queued to be captured.
- options¶
The settings for the capture.
- Type:
- queuedFrameCap¶
The first queued frame to capture. Ignored if
numQueuedFrames
is 0.
- workingDir¶
The path to the working directory to run in, or blank for the executable’s directory.