renderdoc_app.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. /******************************************************************************
  2. * The MIT License (MIT)
  3. *
  4. * Copyright (c) 2015-2016 Baldur Karlsson
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. ******************************************************************************/
  24. #pragma once
  25. #if !defined(RENDERDOC_NO_STDINT)
  26. #include <stdint.h>
  27. #endif
  28. #if defined(WIN32)
  29. #define RENDERDOC_CC __cdecl
  30. #elif defined(__linux__)
  31. #define RENDERDOC_CC
  32. #elif defined(__APPLE__)
  33. #define RENDERDOC_CC
  34. #else
  35. #error "Unknown platform"
  36. #endif
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. //////////////////////////////////////////////////////////////////////////////////////////////////
  41. // Constants not used directly in below API
  42. // This is a GUID/magic value used for when applications pass a path where shader debug
  43. // information can be found to match up with a stripped shader.
  44. // the define can be used like so: const GUID RENDERDOC_ShaderDebugMagicValue =
  45. // RENDERDOC_ShaderDebugMagicValue_value
  46. #define RENDERDOC_ShaderDebugMagicValue_struct \
  47. { \
  48. 0xeab25520, 0x6670, 0x4865, 0x84, 0x29, 0x6c, 0x8, 0x51, 0x54, 0x00, 0xff \
  49. }
  50. // as an alternative when you want a byte array (assuming x86 endianness):
  51. #define RENDERDOC_ShaderDebugMagicValue_bytearray \
  52. { \
  53. 0x20, 0x55, 0xb2, 0xea, 0x70, 0x66, 0x65, 0x48, 0x84, 0x29, 0x6c, 0x8, 0x51, 0x54, 0x00, 0xff \
  54. }
  55. // truncated version when only a uint64_t is available (e.g. Vulkan tags):
  56. #define RENDERDOC_ShaderDebugMagicValue_truncated 0x48656670eab25520ULL
  57. //////////////////////////////////////////////////////////////////////////////////////////////////
  58. // RenderDoc capture options
  59. //
  60. typedef enum {
  61. // Allow the application to enable vsync
  62. //
  63. // Default - enabled
  64. //
  65. // 1 - The application can enable or disable vsync at will
  66. // 0 - vsync is force disabled
  67. eRENDERDOC_Option_AllowVSync = 0,
  68. // Allow the application to enable fullscreen
  69. //
  70. // Default - enabled
  71. //
  72. // 1 - The application can enable or disable fullscreen at will
  73. // 0 - fullscreen is force disabled
  74. eRENDERDOC_Option_AllowFullscreen = 1,
  75. // Record API debugging events and messages
  76. //
  77. // Default - disabled
  78. //
  79. // 1 - Enable built-in API debugging features and records the results into
  80. // the capture logfile, which is matched up with events on replay
  81. // 0 - no API debugging is forcibly enabled
  82. eRENDERDOC_Option_APIValidation = 2,
  83. eRENDERDOC_Option_DebugDeviceMode = 2, // deprecated name of this enum
  84. // Capture CPU callstacks for API events
  85. //
  86. // Default - disabled
  87. //
  88. // 1 - Enables capturing of callstacks
  89. // 0 - no callstacks are captured
  90. eRENDERDOC_Option_CaptureCallstacks = 3,
  91. // When capturing CPU callstacks, only capture them from drawcalls.
  92. // This option does nothing without the above option being enabled
  93. //
  94. // Default - disabled
  95. //
  96. // 1 - Only captures callstacks for drawcall type API events.
  97. // Ignored if CaptureCallstacks is disabled
  98. // 0 - Callstacks, if enabled, are captured for every event.
  99. eRENDERDOC_Option_CaptureCallstacksOnlyDraws = 4,
  100. // Specify a delay in seconds to wait for a debugger to attach, after
  101. // creating or injecting into a process, before continuing to allow it to run.
  102. //
  103. // 0 indicates no delay, and the process will run immediately after injection
  104. //
  105. // Default - 0 seconds
  106. //
  107. eRENDERDOC_Option_DelayForDebugger = 5,
  108. // Verify any writes to mapped buffers, by checking the memory after the
  109. // bounds of the returned pointer to detect any modification.
  110. //
  111. // Default - disabled
  112. //
  113. // 1 - Verify any writes to mapped buffers
  114. // 0 - No verification is performed, and overwriting bounds may cause
  115. // crashes or corruption in RenderDoc
  116. eRENDERDOC_Option_VerifyMapWrites = 6,
  117. // Hooks any system API calls that create child processes, and injects
  118. // RenderDoc into them recursively with the same options.
  119. //
  120. // Default - disabled
  121. //
  122. // 1 - Hooks into spawned child processes
  123. // 0 - Child processes are not hooked by RenderDoc
  124. eRENDERDOC_Option_HookIntoChildren = 7,
  125. // By default RenderDoc only includes resources in the final logfile necessary
  126. // for that frame, this allows you to override that behaviour.
  127. //
  128. // Default - disabled
  129. //
  130. // 1 - all live resources at the time of capture are included in the log
  131. // and available for inspection
  132. // 0 - only the resources referenced by the captured frame are included
  133. eRENDERDOC_Option_RefAllResources = 8,
  134. // By default RenderDoc skips saving initial states for resources where the
  135. // previous contents don't appear to be used, assuming that writes before
  136. // reads indicate previous contents aren't used.
  137. //
  138. // Default - disabled
  139. //
  140. // 1 - initial contents at the start of each captured frame are saved, even if
  141. // they are later overwritten or cleared before being used.
  142. // 0 - unless a read is detected, initial contents will not be saved and will
  143. // appear as black or empty data.
  144. eRENDERDOC_Option_SaveAllInitials = 9,
  145. // In APIs that allow for the recording of command lists to be replayed later,
  146. // RenderDoc may choose to not capture command lists before a frame capture is
  147. // triggered, to reduce overheads. This means any command lists recorded once
  148. // and replayed many times will not be available and may cause a failure to
  149. // capture.
  150. //
  151. // Note this is only true for APIs where multithreading is difficult or
  152. // discouraged. Newer APIs like Vulkan and D3D12 will ignore this option
  153. // and always capture all command lists since the API is heavily oriented
  154. // around it and the overheads have been reduced by API design.
  155. //
  156. // 1 - All command lists are captured from the start of the application
  157. // 0 - Command lists are only captured if their recording begins during
  158. // the period when a frame capture is in progress.
  159. eRENDERDOC_Option_CaptureAllCmdLists = 10,
  160. // Mute API debugging output when the API validation mode option is enabled
  161. //
  162. // Default - enabled
  163. //
  164. // 1 - Mute any API debug messages from being displayed or passed through
  165. // 0 - API debugging is displayed as normal
  166. eRENDERDOC_Option_DebugOutputMute = 11,
  167. } RENDERDOC_CaptureOption;
  168. // Sets an option that controls how RenderDoc behaves on capture.
  169. //
  170. // Returns 1 if the option and value are valid
  171. // Returns 0 if either is invalid and the option is unchanged
  172. typedef int(RENDERDOC_CC *pRENDERDOC_SetCaptureOptionU32)(RENDERDOC_CaptureOption opt, uint32_t val);
  173. typedef int(RENDERDOC_CC *pRENDERDOC_SetCaptureOptionF32)(RENDERDOC_CaptureOption opt, float val);
  174. // Gets the current value of an option as a uint32_t
  175. //
  176. // If the option is invalid, 0xffffffff is returned
  177. typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionU32)(RENDERDOC_CaptureOption opt);
  178. // Gets the current value of an option as a float
  179. //
  180. // If the option is invalid, -FLT_MAX is returned
  181. typedef float(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionF32)(RENDERDOC_CaptureOption opt);
  182. typedef enum {
  183. // '0' - '9' matches ASCII values
  184. eRENDERDOC_Key_0 = 0x30,
  185. eRENDERDOC_Key_1 = 0x31,
  186. eRENDERDOC_Key_2 = 0x32,
  187. eRENDERDOC_Key_3 = 0x33,
  188. eRENDERDOC_Key_4 = 0x34,
  189. eRENDERDOC_Key_5 = 0x35,
  190. eRENDERDOC_Key_6 = 0x36,
  191. eRENDERDOC_Key_7 = 0x37,
  192. eRENDERDOC_Key_8 = 0x38,
  193. eRENDERDOC_Key_9 = 0x39,
  194. // 'A' - 'Z' matches ASCII values
  195. eRENDERDOC_Key_A = 0x41,
  196. eRENDERDOC_Key_B = 0x42,
  197. eRENDERDOC_Key_C = 0x43,
  198. eRENDERDOC_Key_D = 0x44,
  199. eRENDERDOC_Key_E = 0x45,
  200. eRENDERDOC_Key_F = 0x46,
  201. eRENDERDOC_Key_G = 0x47,
  202. eRENDERDOC_Key_H = 0x48,
  203. eRENDERDOC_Key_I = 0x49,
  204. eRENDERDOC_Key_J = 0x4A,
  205. eRENDERDOC_Key_K = 0x4B,
  206. eRENDERDOC_Key_L = 0x4C,
  207. eRENDERDOC_Key_M = 0x4D,
  208. eRENDERDOC_Key_N = 0x4E,
  209. eRENDERDOC_Key_O = 0x4F,
  210. eRENDERDOC_Key_P = 0x50,
  211. eRENDERDOC_Key_Q = 0x51,
  212. eRENDERDOC_Key_R = 0x52,
  213. eRENDERDOC_Key_S = 0x53,
  214. eRENDERDOC_Key_T = 0x54,
  215. eRENDERDOC_Key_U = 0x55,
  216. eRENDERDOC_Key_V = 0x56,
  217. eRENDERDOC_Key_W = 0x57,
  218. eRENDERDOC_Key_X = 0x58,
  219. eRENDERDOC_Key_Y = 0x59,
  220. eRENDERDOC_Key_Z = 0x5A,
  221. // leave the rest of the ASCII range free
  222. // in case we want to use it later
  223. eRENDERDOC_Key_NonPrintable = 0x100,
  224. eRENDERDOC_Key_Divide,
  225. eRENDERDOC_Key_Multiply,
  226. eRENDERDOC_Key_Subtract,
  227. eRENDERDOC_Key_Plus,
  228. eRENDERDOC_Key_F1,
  229. eRENDERDOC_Key_F2,
  230. eRENDERDOC_Key_F3,
  231. eRENDERDOC_Key_F4,
  232. eRENDERDOC_Key_F5,
  233. eRENDERDOC_Key_F6,
  234. eRENDERDOC_Key_F7,
  235. eRENDERDOC_Key_F8,
  236. eRENDERDOC_Key_F9,
  237. eRENDERDOC_Key_F10,
  238. eRENDERDOC_Key_F11,
  239. eRENDERDOC_Key_F12,
  240. eRENDERDOC_Key_Home,
  241. eRENDERDOC_Key_End,
  242. eRENDERDOC_Key_Insert,
  243. eRENDERDOC_Key_Delete,
  244. eRENDERDOC_Key_PageUp,
  245. eRENDERDOC_Key_PageDn,
  246. eRENDERDOC_Key_Backspace,
  247. eRENDERDOC_Key_Tab,
  248. eRENDERDOC_Key_PrtScrn,
  249. eRENDERDOC_Key_Pause,
  250. eRENDERDOC_Key_Max,
  251. } RENDERDOC_InputButton;
  252. // Sets which key or keys can be used to toggle focus between multiple windows
  253. //
  254. // If keys is NULL or num is 0, toggle keys will be disabled
  255. typedef void(RENDERDOC_CC *pRENDERDOC_SetFocusToggleKeys)(RENDERDOC_InputButton *keys, int num);
  256. // Sets which key or keys can be used to capture the next frame
  257. //
  258. // If keys is NULL or num is 0, captures keys will be disabled
  259. typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureKeys)(RENDERDOC_InputButton *keys, int num);
  260. typedef enum {
  261. // This single bit controls whether the overlay is enabled or disabled globally
  262. eRENDERDOC_Overlay_Enabled = 0x1,
  263. // Show the average framerate over several seconds as well as min/max
  264. eRENDERDOC_Overlay_FrameRate = 0x2,
  265. // Show the current frame number
  266. eRENDERDOC_Overlay_FrameNumber = 0x4,
  267. // Show a list of recent captures, and how many captures have been made
  268. eRENDERDOC_Overlay_CaptureList = 0x8,
  269. // Default values for the overlay mask
  270. eRENDERDOC_Overlay_Default = (eRENDERDOC_Overlay_Enabled | eRENDERDOC_Overlay_FrameRate |
  271. eRENDERDOC_Overlay_FrameNumber | eRENDERDOC_Overlay_CaptureList),
  272. // Enable all bits
  273. eRENDERDOC_Overlay_All = ~0U,
  274. // Disable all bits
  275. eRENDERDOC_Overlay_None = 0,
  276. } RENDERDOC_OverlayBits;
  277. // returns the overlay bits that have been set
  278. typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetOverlayBits)();
  279. // sets the overlay bits with an and & or mask
  280. typedef void(RENDERDOC_CC *pRENDERDOC_MaskOverlayBits)(uint32_t And, uint32_t Or);
  281. // this function will attempt to shut down RenderDoc.
  282. //
  283. // Note: that this will only work correctly if done immediately after
  284. // the dll is loaded, before any API work happens. RenderDoc will remove its
  285. // injected hooks and shut down. Behaviour is undefined if this is called
  286. // after any API functions have been called.
  287. typedef void(RENDERDOC_CC *pRENDERDOC_Shutdown)();
  288. // This function will unload RenderDoc's crash handler.
  289. //
  290. // If you use your own crash handler and don't want RenderDoc's handler to
  291. // intercede, you can call this function to unload it and any unhandled
  292. // exceptions will pass to the next handler.
  293. typedef void(RENDERDOC_CC *pRENDERDOC_UnloadCrashHandler)();
  294. // Sets the logfile path template
  295. //
  296. // logfile is a UTF-8 string that gives a template for how captures will be named
  297. // and where they will be saved.
  298. //
  299. // Any extension is stripped off the path, and captures are saved in the directory
  300. // specified, and named with the filename and the frame number appended. If the
  301. // directory does not exist it will be created, including any parent directories.
  302. //
  303. // If pathtemplate is NULL, the template will remain unchanged
  304. //
  305. // Example:
  306. //
  307. // SetLogFilePathTemplate("my_captures/example");
  308. //
  309. // Capture #1 -> my_captures/example_frame123.rdc
  310. // Capture #2 -> my_captures/example_frame456.rdc
  311. typedef void(RENDERDOC_CC *pRENDERDOC_SetLogFilePathTemplate)(const char *pathtemplate);
  312. // returns the current logfile template, see SetLogFileTemplate above, as a UTF-8 string
  313. typedef const char *(RENDERDOC_CC *pRENDERDOC_GetLogFilePathTemplate)();
  314. // returns the number of captures that have been made
  315. typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetNumCaptures)();
  316. // This function returns the details of a capture, by index. New captures are added
  317. // to the end of the list.
  318. //
  319. // logfile will be filled with the absolute path to the capture file, as a UTF-8 string
  320. // pathlength will be written with the length in bytes of the logfile string
  321. // timestamp will be written with the time of the capture, in seconds since the Unix epoch
  322. //
  323. // Any of the parameters can be NULL and they'll be skipped.
  324. //
  325. // The function will return 1 if the capture index is valid, or 0 if the index is invalid
  326. // If the index is invalid, the values will be unchanged
  327. //
  328. // Note: when captures are deleted in the UI they will remain in this list, so the
  329. // logfile path may not exist anymore.
  330. typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetCapture)(uint32_t idx, char *logfile,
  331. uint32_t *pathlength, uint64_t *timestamp);
  332. // returns 1 if the RenderDoc UI is connected to this application, 0 otherwise
  333. typedef uint32_t(RENDERDOC_CC *pRENDERDOC_IsRemoteAccessConnected)();
  334. // This function will launch the Replay UI associated with the RenderDoc library injected
  335. // into the running application.
  336. //
  337. // if connectRemoteAccess is 1, the Replay UI will be launched with a command line parameter
  338. // to connect to this application
  339. // cmdline is the rest of the command line, as a UTF-8 string. E.g. a captures to open
  340. // if cmdline is NULL, the command line will be empty.
  341. //
  342. // returns the PID of the replay UI if successful, 0 if not successful.
  343. typedef uint32_t(RENDERDOC_CC *pRENDERDOC_LaunchReplayUI)(uint32_t connectRemoteAccess,
  344. const char *cmdline);
  345. // RenderDoc can return a higher version than requested if it's backwards compatible,
  346. // this function returns the actual version returned. If a parameter is NULL, it will be
  347. // ignored and the others will be filled out.
  348. typedef void(RENDERDOC_CC *pRENDERDOC_GetAPIVersion)(int *major, int *minor, int *patch);
  349. //////////////////////////////////////////////////////////////////////////
  350. // Capturing functions
  351. //
  352. // A device pointer is a pointer to the API's root handle.
  353. //
  354. // This would be an ID3D11Device, HGLRC/GLXContext, ID3D12Device, etc
  355. typedef void *RENDERDOC_DevicePointer;
  356. // A window handle is the OS's native window handle
  357. //
  358. // This would be an HWND, GLXDrawable, etc
  359. typedef void *RENDERDOC_WindowHandle;
  360. // This sets the RenderDoc in-app overlay in the API/window pair as 'active' and it will
  361. // respond to keypresses. Neither parameter can be NULL
  362. typedef void(RENDERDOC_CC *pRENDERDOC_SetActiveWindow)(RENDERDOC_DevicePointer device,
  363. RENDERDOC_WindowHandle wndHandle);
  364. // capture the next frame on whichever window and API is currently considered active
  365. typedef void(RENDERDOC_CC *pRENDERDOC_TriggerCapture)();
  366. // capture the next N frames on whichever window and API is currently considered active
  367. typedef void(RENDERDOC_CC *pRENDERDOC_TriggerMultiFrameCapture)(uint32_t numFrames);
  368. // When choosing either a device pointer or a window handle to capture, you can pass NULL.
  369. // Passing NULL specifies a 'wildcard' match against anything. This allows you to specify
  370. // any API rendering to a specific window, or a specific API instance rendering to any window,
  371. // or in the simplest case of one window and one API, you can just pass NULL for both.
  372. //
  373. // In either case, if there are two or more possible matching (device,window) pairs it
  374. // is undefined which one will be captured.
  375. //
  376. // Note: for headless rendering you can pass NULL for the window handle and either specify
  377. // a device pointer or leave it NULL as above.
  378. // Immediately starts capturing API calls on the specified device pointer and window handle.
  379. //
  380. // If there is no matching thing to capture (e.g. no supported API has been initialised),
  381. // this will do nothing.
  382. //
  383. // The results are undefined (including crashes) if two captures are started overlapping,
  384. // even on separate devices and/oror windows.
  385. typedef void(RENDERDOC_CC *pRENDERDOC_StartFrameCapture)(RENDERDOC_DevicePointer device,
  386. RENDERDOC_WindowHandle wndHandle);
  387. // Returns whether or not a frame capture is currently ongoing anywhere.
  388. //
  389. // This will return 1 if a capture is ongoing, and 0 if there is no capture running
  390. typedef uint32_t(RENDERDOC_CC *pRENDERDOC_IsFrameCapturing)();
  391. // Ends capturing immediately.
  392. //
  393. // This will return 1 if the capture succeeded, and 0 if there was an error capturing.
  394. typedef uint32_t(RENDERDOC_CC *pRENDERDOC_EndFrameCapture)(RENDERDOC_DevicePointer device,
  395. RENDERDOC_WindowHandle wndHandle);
  396. //////////////////////////////////////////////////////////////////////////////////////////////////
  397. // RenderDoc API versions
  398. //
  399. // RenderDoc uses semantic versioning (http://semver.org/).
  400. //
  401. // MAJOR version is incremented when incompatible API changes happen.
  402. // MINOR version is incremented when functionality is added in a backwards-compatible manner.
  403. // PATCH version is incremented when backwards-compatible bug fixes happen.
  404. //
  405. // Note that this means the API returned can be higher than the one you might have requested.
  406. // e.g. if you are running against a newer RenderDoc that supports 1.0.1, it will be returned
  407. // instead of 1.0.0. You can check this with the GetAPIVersion entry point
  408. typedef enum {
  409. eRENDERDOC_API_Version_1_0_0 = 10000, // RENDERDOC_API_1_0_0 = 1 00 00
  410. eRENDERDOC_API_Version_1_0_1 = 10001, // RENDERDOC_API_1_0_1 = 1 00 01
  411. eRENDERDOC_API_Version_1_0_2 = 10002, // RENDERDOC_API_1_0_2 = 1 00 02
  412. eRENDERDOC_API_Version_1_1_0 = 10100, // RENDERDOC_API_1_1_0 = 1 01 00
  413. } RENDERDOC_Version;
  414. // API version changelog:
  415. //
  416. // 1.0.0 - initial release
  417. // 1.0.1 - Bugfix: IsFrameCapturing() was returning false for captures that were triggered
  418. // by keypress or TriggerCapture, instead of Start/EndFrameCapture.
  419. // 1.0.2 - Refactor: Renamed eRENDERDOC_Option_DebugDeviceMode to eRENDERDOC_Option_APIValidation
  420. // 1.1.0 - Add feature: TriggerMultiFrameCapture(). Backwards compatible with 1.0.x since the new
  421. // function pointer is added to the end of the struct, the original layout is identical
  422. // eRENDERDOC_API_Version_1_1_0
  423. typedef struct
  424. {
  425. pRENDERDOC_GetAPIVersion GetAPIVersion;
  426. pRENDERDOC_SetCaptureOptionU32 SetCaptureOptionU32;
  427. pRENDERDOC_SetCaptureOptionF32 SetCaptureOptionF32;
  428. pRENDERDOC_GetCaptureOptionU32 GetCaptureOptionU32;
  429. pRENDERDOC_GetCaptureOptionF32 GetCaptureOptionF32;
  430. pRENDERDOC_SetFocusToggleKeys SetFocusToggleKeys;
  431. pRENDERDOC_SetCaptureKeys SetCaptureKeys;
  432. pRENDERDOC_GetOverlayBits GetOverlayBits;
  433. pRENDERDOC_MaskOverlayBits MaskOverlayBits;
  434. pRENDERDOC_Shutdown Shutdown;
  435. pRENDERDOC_UnloadCrashHandler UnloadCrashHandler;
  436. pRENDERDOC_SetLogFilePathTemplate SetLogFilePathTemplate;
  437. pRENDERDOC_GetLogFilePathTemplate GetLogFilePathTemplate;
  438. pRENDERDOC_GetNumCaptures GetNumCaptures;
  439. pRENDERDOC_GetCapture GetCapture;
  440. pRENDERDOC_TriggerCapture TriggerCapture;
  441. pRENDERDOC_IsRemoteAccessConnected IsRemoteAccessConnected;
  442. pRENDERDOC_LaunchReplayUI LaunchReplayUI;
  443. pRENDERDOC_SetActiveWindow SetActiveWindow;
  444. pRENDERDOC_StartFrameCapture StartFrameCapture;
  445. pRENDERDOC_IsFrameCapturing IsFrameCapturing;
  446. pRENDERDOC_EndFrameCapture EndFrameCapture;
  447. pRENDERDOC_TriggerMultiFrameCapture TriggerMultiFrameCapture;
  448. } RENDERDOC_API_1_1_0;
  449. typedef RENDERDOC_API_1_1_0 RENDERDOC_API_1_0_0;
  450. typedef RENDERDOC_API_1_1_0 RENDERDOC_API_1_0_1;
  451. typedef RENDERDOC_API_1_1_0 RENDERDOC_API_1_0_2;
  452. //////////////////////////////////////////////////////////////////////////////////////////////////
  453. // RenderDoc API entry point
  454. //
  455. // This entry point can be obtained via GetProcAddress/dlsym if RenderDoc is available.
  456. //
  457. // The name is the same as the typedef - "RENDERDOC_GetAPI"
  458. //
  459. // This function is not thread safe, and should not be called on multiple threads at once.
  460. // Ideally, call this once as early as possible in your application's startup, before doing
  461. // any API work, since some configuration functionality etc has to be done also before
  462. // initialising any APIs.
  463. //
  464. // Parameters:
  465. // version is a single value from the RENDERDOC_Version above.
  466. //
  467. // outAPIPointers will be filled out with a pointer to the corresponding struct of function
  468. // pointers.
  469. //
  470. // Returns:
  471. // 1 - if the outAPIPointers has been filled with a pointer to the API struct requested
  472. // 0 - if the requested version is not supported or the arguments are invalid.
  473. //
  474. typedef int(RENDERDOC_CC *pRENDERDOC_GetAPI)(RENDERDOC_Version version, void **outAPIPointers);
  475. #ifdef __cplusplus
  476. } // extern "C"
  477. #endif