diff --git a/docs/API.aml b/docs/API.aml
new file mode 100644
index 000000000..f84c97a42
--- /dev/null
+++ b/docs/API.aml
@@ -0,0 +1,773 @@
+
+
+
+
+ Reference for RenderDoc in-application API
+
+
+
+
+ 0
+ This page describes the RenderDoc API exposed to applications being captured, both in
+ overall organisation as well as a specific reference on each function.
+
+
+
+
+ Overview
+
+ Overview text
+
+
+
+
+
+ GetAPIVersion
+
+ void GetAPIVersion(int *major, int *minor, int *patch);
+
+ This function returns the actual API version of the implementation returned. Version numbers
+ follow
+ semantic versioning
+ Semantic Versioning information
+ http://semver.org/
+ which means the implementation returned may have a higher minor and/or patch version than requested:
+
+ New patch versions are identical and backwards compatible in functionality.
+ New minor versions add new functionality in a backwards compatible way.
+
+
+
+
+ Parameters
+
+ GetAPIVersion()
+
+ int *major will be filled with the major version of the implementation's version.
+ int *minor will be filled with the minor version of the implementation's version.
+ int *patch which will be filled with the patch version of the implementation's version.
+
+
+
+
+ Return Value
+
+ None
+
+
+
+
+
+
+
+ SetCaptureOptionU32 and SetCaptureOptionF32
+
+ void SetCaptureOptionU32(RENDERDOC_CaptureOption opt, uint32_t val);
+ void SetCaptureOptionF32(RENDERDOC_CaptureOption opt, float val);
+
+ This pair of functions sets one of the different options for tweaking some behaviours of capturing. Note that each option only takes
+ effect from after it is set - so it is advised to set these options as early as possible, ideally before any graphics API
+ has been initialised.
+
+
+
+
+ Parameters
+
+ SetCaptureOptionU32()
+
+ RENDERDOC_CaptureOption opt specifies which capture option should be set.
+ uint32_t val the unsigned integer value to set for the above option.
+
+ SetCaptureOptionF32()
+
+ RENDERDOC_CaptureOption opt specifies which capture option should be set.
+ float val the floating point value to set for the above option.
+
+
+
+
+ Notes
+
+ RENDERDOC_CaptureOption opt can take one of the following values:
+
+ eRENDERDOC_Option_AllowVSync specifies whether the application is allowed to enable vsync. Default is on.
+ eRENDERDOC_Option_AllowFullscreen specifies whether the application is allowed to enter exclusive fullscreen. Default is on.
+ eRENDERDOC_Option_DebugDeviceMode specifies whether (where possible) API-specific debugging is enabled. Default is off.
+ eRENDERDOC_Option_CaptureCallstacks specifies whether each API call should save a callstack. Default is off.
+ eRENDERDOC_Option_CaptureCallstacksOnlyDraws specifies whether - if CaptureCallstacks is enabled - callstacks are only saved on drawcalls. Default is off.
+ eRENDERDOC_Option_DelayForDebugger specifies a delay in seconds after launching a process to pause, to allow debuggers to attach. Default is 0.
+ eRENDERDOC_Option_VerifyMapWrites specifies whether any 'map' type resource memory updates should be bounds-checked for overruns. Default is off.
+ eRENDERDOC_Option_HookIntoChildren specifies whether child processes launched by the initial application should be hooked as well - commonly if a launcher process is needed to run the application. Default is off.
+ eRENDERDOC_Option_RefAllResources specifies whether all live resources at the time of capture should be included in the log, even if they are not referenced by the frame. Default is off.
+ eRENDERDOC_Option_SaveAllInitials specifies whether all initial states of resources at the start of the frame should be saved, rather than omitting large resource contents which are detected to be likely unused. Default is off.
+ eRENDERDOC_Option_CaptureAllCmdLists specifies whether all command lists should be captured on APIs where multithreaded submission is not optimal such as D3D11, rather than only capturing those submitted during the frame. Default is off.
+ eRENDERDOC_Option_DebugOutputMute specifies whether to mute any API debug output messages when DebugDeviceMode is enabled. Default is on.
+
+
+
+
+ Return Value
+
+ The functions return 1 if the option is valid, and the value set on the option is within valid ranges.
+ The functions return 0 if the option is not a RENDERDOC_CaptureOption enum, or the value is not valid for the option.
+
+
+
+
+
+
+
+
+
+ GetCaptureOptionU32 and GetCaptureOptionF32
+
+ uint32_t GetCaptureOptionU32(RENDERDOC_CaptureOption opt);
+ float GetCaptureOptionF32(RENDERDOC_CaptureOption opt);
+
+ This pair of functions gets the current value of one of the different options listed above in SetCaptureOption.
+
+
+
+
+ Parameters
+
+ GetCaptureOptionU32()
+
+ RENDERDOC_CaptureOption opt specifies which capture option should be retrieved.
+
+ GetCaptureOptionF32()
+
+ RENDERDOC_CaptureOption opt specifies which capture option should be retrieved.
+
+
+
+
+ Notes
+
+ See above in above in SetCaptureOption for the valid values of RENDERDOC_CaptureOption.
+
+
+
+ Return Value
+
+ The function returns the value of the capture option, if the option is a valid RENDERDOC_CaptureOption enum.
+ GetCaptureOptionU32 returns 0xffffffff if the option is not a RENDERDOC_CaptureOption enum.
+ GetCaptureOptionF32 returns -FLT_MAX if the option is not a RENDERDOC_CaptureOption enum.
+
+
+
+
+
+
+
+
+ SetFocusToggleKeys
+
+ void SetFocusToggleKeys(RENDERDOC_InputButton *keys, int num);
+
+ This function changes the key bindings in-application for changing the focussed window.
+
+
+
+
+ Parameters
+
+ SetFocusToggleKeys()
+
+ RENDERDOC_InputButton *keys lists the keys to bind. If this parameter is NULL, num must be 0.
+ int num specifies the number of keys in the keys array. If 0, the keybinding is disabled.
+
+
+
+
+ Notes
+
+ RENDERDOC_InputButton can take one of the following values:
+
+ eRENDERDOC_Key_0 .. eRENDERDOC_Key_9 are the number keys. The values of these match ASCII for '0' .. '9'.
+ eRENDERDOC_Key_A .. eRENDERDOC_Key_Z are the letter keys. The values of these match ASCII for 'A' .. 'Z'.
+
+ eRENDERDOC_Key_Divide is the Divide key.
+ eRENDERDOC_Key_Multiply is the Multiply key.
+ eRENDERDOC_Key_Subtract is the Subtract key.
+ eRENDERDOC_Key_Plus is the Plus key.
+
+ eRENDERDOC_Key_F1 .. eRENDERDOC_Key_F12 are the function keys.
+
+ eRENDERDOC_Key_Home is the Home key.
+ eRENDERDOC_Key_End is the End key.
+ eRENDERDOC_Key_Insert is the Insert key.
+ eRENDERDOC_Key_Delete is the Delete key.
+ eRENDERDOC_Key_PageUp is the PageUp key.
+ eRENDERDOC_Key_PageDn is the PageDn key.
+
+ eRENDERDOC_Key_Backspace is the Backspace key.
+ eRENDERDOC_Key_Tab is the Tab key.
+ eRENDERDOC_Key_PrtScrn is the PrtScrn key.
+ eRENDERDOC_Key_Pause is the Pause key.
+
+
+
+
+ Return Value
+
+ None
+
+
+
+
+
+
+
+
+
+ SetFocusToggleKeys
+
+ void SetCaptureKeys(RENDERDOC_InputButton *keys, int num);
+
+ This function changes the key bindings in-application for triggering a capture on the current window.
+
+
+
+
+ Parameters
+
+ SetCaptureKeys()
+
+ RENDERDOC_InputButton *keys lists the keys to bind. If this parameter is NULL, num must be 0.
+ int num specifies the number of keys in the keys array. If 0, the keybinding is disabled.
+
+
+
+
+ Notes
+
+ See above in above in SetFocusToggleKeys for the valid values of RENDERDOC_InputButton.
+
+
+
+ Return Value
+
+ None
+
+
+
+
+
+
+
+
+ GetOverlayBits
+
+ uint32_t GetOverlayBits();
+
+ This function returns the current mask which determines what sections of the overlay render on each window.
+
+
+
+
+ Parameters
+
+
+ None
+
+
+
+
+ Notes
+
+ The mask can contain some subset of bits from RENDERDOC_OverlayBits:
+
+ eRENDERDOC_Overlay_Enabled is an overall enable/disable bit. If this is disabled, no overlay renders.
+ eRENDERDOC_Overlay_FrameRate shows the average, min and max frame time in milliseconds, and the average framerate.
+ eRENDERDOC_Overlay_FrameNumber shows the current frame number, as counted by the number of presents.
+ eRENDERDOC_Overlay_CaptureList shows how many total captures have been made, and a list of captured frames in the last few seconds.
+
+ eRENDERDOC_Key_F1 .. eRENDERDOC_Key_F12 are the function keys.
+
+ eRENDERDOC_Overlay_Default is the default set of bits, which is the value of the mask at startup.
+ eRENDERDOC_Overlay_All is equal to ~0U so all bits are enabled.
+ eRENDERDOC_Overlay_None is equal to 0 so all bits are disabled.
+
+
+
+
+ Return Value
+
+ This function returns the current RENDERDOC_OverlayBits mask.
+
+
+
+
+
+
+
+
+ MaskOverlayBits
+
+ void MaskOverlayBits(uint32_t And, uint32_t Or);
+
+ This function modifies the current mask which determines what sections of the overlay render on each window.
+
+
+
+
+ Parameters
+
+ MaskOverlayBits()
+
+ uint32_t And is a 32-bit value the mask is binary-AND'd with before processing Or.
+ uint32_t Or is a 32-bit value the mask is binary-OR'd with after processing And.
+
+
+
+
+ Notes
+
+ See above in above in GetOverlayBits for the bits in the mask.
+
+
+
+ Return Value
+
+ None
+
+
+
+
+
+
+
+ Shutdown
+
+ void Shutdown();
+
+ This function will attempt to shut down and remove RenderDoc and its hooks from the target process. It must be called as early as
+ possible in the process, and will have undefined results if any graphics API functions have been called.
+
+
+
+
+ Parameters
+
+
+ None
+
+
+
+
+ Return Value
+
+ None
+
+
+
+
+
+
+
+ UnloadCrashHandler
+
+ void UnloadCrashHandler();
+
+ This function will remove RenderDoc's crash handler from the target process. If you have your own crash handler
+ that you want to handle any exceptions, RenderDoc's handler could interfere so it can be disabled.
+
+
+
+
+ Parameters
+
+
+ None
+
+
+
+
+ Return Value
+
+ None
+
+
+
+
+
+
+
+ SetLogFilePathTemplate and GetLogFilePathTemplate
+
+ void SetLogFilePathTemplate(const char *pathtemplate);
+ const char *GetLogFilePathTemplate();
+
+ This pair of functions controls the template for where new captures will be saved. The template can
+ either be a relative or absolute path, which determines where captures will be saved and how they will
+ be named.
+
+
+ If the path template is my_captures/example then captures saved will be e.g.
+ my_captures/example_frame123.rdc and my_captures/example_frame456.rdc.
+ Relative paths will be saved relative to the process's current working directory.
+
+
+ The default template is in a folder controlled by the UI - initially the system temporary folder, and
+ the filename is the executable's filename.
+
+
+
+
+ Parameters
+
+ SetLogFilePathTemplate()
+
+ const char *pathtemplate specifies the capture path template to set, as UTF-8 null-terminated string.
+
+ GetLogFilePathTemplate()
+
+
+ None
+
+
+
+
+
+ Return Value
+
+ SetLogFilePathTemplate() does not return any value.
+ GetLogFilePathTemplate() returns the current capture path template as a UTF-8 null-terminated string.
+
+
+
+
+
+
+
+ GetNumCaptures
+
+ uint32_t GetNumCaptures();
+
+ This function returns the number of frame captures that have been made.
+
+
+
+
+ Parameters
+
+
+ None
+
+
+
+
+ Return Value
+
+ Returns the number of frame captures that have been made
+
+
+
+
+
+
+
+
+ GetCapture
+
+ uint32_t GetCapture(uint32_t idx, char *logfile, uint32_t *pathlength, uint64_t *timestamp);
+
+ This function returns the details of a particular frame capture, as specified by an
+ index from 0 to GetNumCaptures()-1.
+
+
+
+
+ Parameters
+
+ GetCapture()
+
+ uint32_t idx specifies which capture to return the details of. Must be less than the return value of GetNumCaptures().
+ char *logfile is an optional parameter filled with the UTF-8 null-terminated path to the file. There must be enough space in the array to contain all characters including the null terminator. If set to NULL, nothing is written.
+ uint32_t *pathlength is an optional parameter filled with the byte length of the above logfile including the null-terminator. If set to NULL, nothing is written.
+ uint64_t *timestamp is an optional parameter filled with the 64-bit timestamp of the file - equivalent to the time() system call. If set to NULL, nothing is written.
+
+
+
+
+ Notes
+
+
+ It is advised to call this function twice - first to obtain pathlength so that sufficient space
+ can be allocated. Then again to actually retrieve the path.
+
+
+ The path follows the template set in SetLogFilePathTemplate() so
+ it may not be an absolute path.
+
+
+
+
+ Return Value
+
+ Returns 1 if the capture index was valid, or 0 if it was out of range.
+
+
+
+
+
+
+ TriggerCapture
+
+ void TriggerCapture();
+
+ This function will trigger a capture as if the user had pressed one of the capture hotkeys.
+ The capture will be taken from the next frame presented to whichever window is considered current.
+
+
+
+
+ Parameters
+
+
+ None
+
+
+
+
+ Return Value
+
+ None
+
+
+
+
+
+
+
+ IsRemoteAccessConnected
+
+ uint32_t IsRemoteAccessConnected();
+
+ This function returns a value to indicate whether the RenderDoc UI is currently connected to
+ the current process.
+
+
+
+
+ Parameters
+
+
+ None
+
+
+
+
+ Return Value
+
+ Returns 1 if the RenderDoc UI is currently connected, or 0 otherwise.
+
+
+
+
+
+
+
+ LaunchReplayUI
+
+ uint32_t LaunchReplayUI(uint32_t connectRemoteAccess, const char *cmdline);
+
+ This function will determine the closest matching replay UI executable for the current RenderDoc module and launch it.
+
+
+
+
+ Parameters
+
+ LaunchReplayUI()
+
+ uint32_t connectRemoteAccess should be set to 1 if the UI should immediately connect to the application.
+ const char *cmdline is an optional UTF-8 null-terminated string to be appended to the command line, e.g. a capture filename. If this parameter is NULL, the command line will be unmodified.
+
+
+
+
+ Return Value
+
+ If the UI was successfully launched, this function will return the PID of the new process. Otherwise it will return 0.
+
+
+
+
+
+
+
+ SetActiveWindow
+
+ void SetActiveWindow(RENDERDOC_DevicePointer device, RENDERDOC_WindowHandle wndHandle);
+
+ This function will explicitly set which window is considered active. The active window is the one that will be captured
+ when the keybind to trigger a capture is pressed.
+
+
+
+
+ Parameters
+
+ SetActiveWindow()
+
+ RENDERDOC_DevicePointer device is a handle to the API 'device' object that will be set active. Must be valid.
+ RENDERDOC_WindowHandle wndHandle is a handle to the platform window handle that will be set active. Must be valid.
+
+
+
+
+ Notes
+
+
+ RENDERDOC_DevicePointer is a typedef to void *. The contents of it are API specific:
+
+ For D3D11 it must be the ID3D11Device device object.
+ For OpenGL it must be the HGLRC or GLXContext context object.
+ For Vulkan it must be the dispatch table pointer within the VkInstance. This is a pointer-sized value at the location pointed to by the VkInstance. NOTE - this is not the actual VkInstance pointer itself.
+
+
+
+ RENDERDOC_WindowHandle is a typedef to void *. It is the platform specific HWND, xcb_window_t, or Xlib Window.
+
+
+
+
+ Return Value
+
+ None
+
+
+
+
+
+
+
+ StartFrameCapture
+
+ void StartFrameCapture(RENDERDOC_DevicePointer device, RENDERDOC_WindowHandle wndHandle);
+
+ This function will immediately begin a capture for the specified device/window combination.
+
+
+
+
+ Parameters
+
+ StartFrameCapture()
+
+ RENDERDOC_DevicePointer device is a handle to the API 'device' object that will be set active. May be NULL to wildcard match.
+ RENDERDOC_WindowHandle wndHandle is a handle to the platform window handle that will be set active. May be NULL to wildcard match.
+
+
+
+
+ Notes
+
+
+ RENDERDOC_DevicePointer and RENDERDOC_WindowHandle are described above in SetActiveWindow().
+
+
+ device and wndHandle can either or both be set to NULL to wildcard match
+ against active device/window combinations. This wildcard matching can be used if the handle is difficult to obtain where
+ frame captures are triggered.
+
+
+ For example if device is NULL but wndHandle is set, RenderDoc will begin
+ a capture on the first API it finds that is active on that window.
+
+
+ If the wildcard match has multiple possible candidates, it is not defined which will be chosen. Wildcard matching should only
+ be used when e.g. it is known that only one API is active on a window, or there is only one window active for a given API.
+
+
+ If no window has been created and all rendering is off-screen, NULL can be specified for the window handle and the device
+ object can be passed to select that API. If both are set to NULL, RenderDoc will simply choose one at random so is only
+ recommended for the case where only one is present.
+
+
+
+
+ Return Value
+
+ None
+
+
+
+
+
+
+
+ IsFrameCapturing
+
+ uint32_t IsFrameCapturing();
+
+ This function returns a value to indicate whether the current frame is capturing.
+
+
+
+
+ Parameters
+
+
+ None
+
+
+
+
+ Return Value
+
+ Returns 1 if the frame is currently capturing, or 0 otherwise.
+
+
+
+
+
+
+
+ EndFrameCapture
+
+ void EndFrameCapture(RENDERDOC_DevicePointer device, RENDERDOC_WindowHandle wndHandle);
+
+ This function will immediately end an active capture for the specified device/window combination.
+
+
+
+
+ Parameters
+
+ EndFrameCapture()
+
+ RENDERDOC_DevicePointer device is a handle to the API 'device' object that will be set active. May be NULL to wildcard match.
+ RENDERDOC_WindowHandle wndHandle is a handle to the platform window handle that will be set active. May be NULL to wildcard match.
+
+
+
+
+ Notes
+
+
+ RENDERDOC_DevicePointer and RENDERDOC_WindowHandle are described above in SetActiveWindow().
+
+
+ Wildcard matching of device and wndHandle is described above in BeginFrameCapture().
+
+
+ There will be undefined results if there is not an active frame capture for the device/window combination.
+
+
+
+
+ Return Value
+
+ None
+
+
+
+
+
+
+
+
diff --git a/docs/Layout.content b/docs/Layout.content
index 907963ed4..4d0ba8489 100644
--- a/docs/Layout.content
+++ b/docs/Layout.content
@@ -38,6 +38,14 @@
+
+
+
+
+
+
+
+
@@ -50,7 +58,7 @@
-
+
diff --git a/docs/TipsNTricks.aml b/docs/TipsNTricks.aml
index 34bbb620c..4bef9e010 100644
--- a/docs/TipsNTricks.aml
+++ b/docs/TipsNTricks.aml
@@ -46,7 +46,7 @@
You can double click on a thumbnail in the texture viewer to open a
locked texture tabYou can close tabs by middle clicking on them.
- You can trigger a capture from code. renderdoc.dll exports an API for this
+ You can trigger a capture from code. renderdoc.dll exports an in-application API for this
purpose, defined in renderdoc_app.h in the distributions:
#include "renderdoc_app.h"
@@ -76,7 +76,7 @@ if(rdoc_api) rdoc_api->TriggerCapture();
To get API debug or error messages, enable "Create Debug Device" when capturing
then check out the window.Detecting RenderDoc from your code can either be done by trying to load and
- use the renderdoc in-program API, or through API specific ways:
+ use the renderdoc in-application API, or through API specific ways:
// For D3D11:
ID3D11Device *devicePointer = ...;
diff --git a/docs/renderdoc.shfbproj b/docs/renderdoc.shfbproj
index 8b105b044..99069cd88 100644
--- a/docs/renderdoc.shfbproj
+++ b/docs/renderdoc.shfbproj
@@ -84,6 +84,7 @@
+