diff --git a/docs/python_api/renderdoc/capturing.rst b/docs/python_api/renderdoc/capturing.rst index 0d5d5ce0e..944eb1c50 100644 --- a/docs/python_api/renderdoc/capturing.rst +++ b/docs/python_api/renderdoc/capturing.rst @@ -17,8 +17,6 @@ Execution & Injection .. autoclass:: renderdoc.CaptureOptions :members: -.. autofunction:: renderdoc.GetDefaultCaptureOptions - .. autoclass:: renderdoc.EnvironmentModification :members: diff --git a/docs/verify-docstrings.py b/docs/verify-docstrings.py index 25f0b45c1..34efe9973 100644 --- a/docs/verify-docstrings.py +++ b/docs/verify-docstrings.py @@ -264,7 +264,7 @@ for mod_name in check_mods: continue # skip some functions that have special bindings and won't be easily found - if objname in ['CreateRemoteServerConnection', 'DumpObject', 'GetDefaultCaptureOptions', 'GetSupportedDeviceProtocols']: + if objname in ['CreateRemoteServerConnection', 'DumpObject', 'GetSupportedDeviceProtocols']: if args.verbose: print("Skipping {}".format(objname)) continue diff --git a/qrenderdoc/Code/Interface/QRDInterface.cpp b/qrenderdoc/Code/Interface/QRDInterface.cpp index 557a7056f..31dffa897 100644 --- a/qrenderdoc/Code/Interface/QRDInterface.cpp +++ b/qrenderdoc/Code/Interface/QRDInterface.cpp @@ -75,7 +75,6 @@ CaptureSettings::CaptureSettings() autoStart = false; queuedFrameCap = 0; numQueuedFrames = 0; - RENDERDOC_GetDefaultCaptureOptions(&options); } CaptureSettings::operator QVariant() const diff --git a/qrenderdoc/Code/pyrenderdoc/qrenderdoc_stub.cpp b/qrenderdoc/Code/pyrenderdoc/qrenderdoc_stub.cpp index 88b9e6c21..4bb384e29 100644 --- a/qrenderdoc/Code/pyrenderdoc/qrenderdoc_stub.cpp +++ b/qrenderdoc/Code/pyrenderdoc/qrenderdoc_stub.cpp @@ -40,7 +40,6 @@ CaptureSettings::CaptureSettings() autoStart = false; queuedFrameCap = 0; numQueuedFrames = 0; - RENDERDOC_GetDefaultCaptureOptions(&options); } rdcstr ConfigFilePath(const rdcstr &filename) diff --git a/qrenderdoc/Code/pyrenderdoc/renderdoc.i b/qrenderdoc/Code/pyrenderdoc/renderdoc.i index ed5f67b18..00ae2854c 100644 --- a/qrenderdoc/Code/pyrenderdoc/renderdoc.i +++ b/qrenderdoc/Code/pyrenderdoc/renderdoc.i @@ -132,13 +132,7 @@ VA_IGNORE_REST_OF_FILE %ignore rdhalf; %ignore bytebuf; -// special handling for RENDERDOC_GetDefaultCaptureOptions to transform output parameter to a return value -%typemap(in, numinputs=0) CaptureOptions *defaultOpts { $1 = new CaptureOptions; } -%typemap(argout) CaptureOptions *defaultOpts { - $result = SWIG_NewPointerObj($1, $descriptor(struct CaptureOptions*), SWIG_POINTER_OWN); -} - -// same for RENDERDOC_GetSupportedDeviceProtocols +// special handling for RENDERDOC_GetSupportedDeviceProtocols to transform output parameter to a return value %typemap(in, numinputs=0) rdcarray *supportedProtocols { $1 = new rdcarray; } %typemap(argout) rdcarray *supportedProtocols { $result = ConvertToPy(*$1); diff --git a/renderdoc/api/replay/capture_options.h b/renderdoc/api/replay/capture_options.h index 05303d080..7d39b6024 100644 --- a/renderdoc/api/replay/capture_options.h +++ b/renderdoc/api/replay/capture_options.h @@ -38,11 +38,24 @@ initialisation time that the user can enable or disable at will. )"); struct CaptureOptions { -// for convenience, don't export the constructor but allow it within the module -// for constructing defaults -#ifdef RENDERDOC_EXPORTS - CaptureOptions(); -#endif + DOCUMENT(""); + CaptureOptions() + { + // since we're reading from all bytes even padding etc in EncodeAsString, memset to 0 + memset(this, 0, sizeof(CaptureOptions)); + allowVSync = true; + allowFullscreen = true; + apiValidation = false; + captureCallstacks = false; + captureCallstacksOnlyActions = false; + delayForDebugger = 0; + verifyBufferAccess = false; + hookIntoChildren = false; + refAllResources = false; + captureAllCmdLists = false; + debugOutputMute = true; + softMemoryLimit = 0; + } DOCUMENT(R"(Encode the current options to a string suitable for passing around between processes. diff --git a/renderdoc/api/replay/renderdoc_replay.h b/renderdoc/api/replay/renderdoc_replay.h index 10214031a..747a6260c 100644 --- a/renderdoc/api/replay/renderdoc_replay.h +++ b/renderdoc/api/replay/renderdoc_replay.h @@ -34,7 +34,6 @@ #define RENDERDOC_AllocArrayMem RDOCSELF_AllocArrayMem #define RENDERDOC_FreeArrayMem RDOCSELF_FreeArrayMem -#define RENDERDOC_GetDefaultCaptureOptions RDOCSELF_GetDefaultCaptureOptions #define RENDERDOC_NeedVulkanLayerRegistration RDOCSELF_NeedVulkanLayerRegistration #define RENDERDOC_UpdateVulkanLayerRegistration RDOCSELF_UpdateVulkanLayerRegistration #define RENDERDOC_ExecuteAndInject RDOCSELF_ExecuteAndInject @@ -2034,14 +2033,6 @@ extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_BecomeRemoteServer( // Injection/execution capture functions. ////////////////////////////////////////////////////////////////////////// -DOCUMENT(R"(Retrieve the default and recommended set of capture options. - -:return: The default capture options. -:rtype: CaptureOptions -)"); -extern "C" RENDERDOC_API void RENDERDOC_CC -RENDERDOC_GetDefaultCaptureOptions(CaptureOptions *defaultOpts); - DOCUMENT(R"(Begin injecting speculatively into all new processes started on the system. Where supported by platform, configuration, and setup begin injecting speculatively into all new processes started on the system. diff --git a/renderdoc/rdocself.version b/renderdoc/rdocself.version index dce1cd79e..a391433e4 100644 --- a/renderdoc/rdocself.version +++ b/renderdoc/rdocself.version @@ -21,7 +21,6 @@ RENDERDOC_GetAPI; RDOCSELF_AllocArrayMem; RDOCSELF_FreeArrayMem; - RDOCSELF_GetDefaultCaptureOptions; RDOCSELF_NeedVulkanLayerRegistration; RDOCSELF_UpdateVulkanLayerRegistration; RDOCSELF_ExecuteAndInject; diff --git a/renderdoc/replay/capture_options.cpp b/renderdoc/replay/capture_options.cpp index 67aeaec26..2411be162 100644 --- a/renderdoc/replay/capture_options.cpp +++ b/renderdoc/replay/capture_options.cpp @@ -175,24 +175,6 @@ float RENDERDOC_CC GetCaptureOptionF32(RENDERDOC_CaptureOption opt) return -FLT_MAX; } -CaptureOptions::CaptureOptions() -{ - // since we're reading from all bytes even padding etc, memset to 0 - RDCEraseEl(*this); - allowVSync = true; - allowFullscreen = true; - apiValidation = false; - captureCallstacks = false; - captureCallstacksOnlyActions = false; - delayForDebugger = 0; - verifyBufferAccess = false; - hookIntoChildren = false; - refAllResources = false; - captureAllCmdLists = false; - debugOutputMute = true; - softMemoryLimit = 0; -} - #if ENABLED(ENABLE_UNIT_TESTS) #undef None diff --git a/renderdoc/replay/entry_points.cpp b/renderdoc/replay/entry_points.cpp index 5ca99ee89..0520d3b27 100644 --- a/renderdoc/replay/entry_points.cpp +++ b/renderdoc/replay/entry_points.cpp @@ -377,11 +377,6 @@ RENDERDOC_ExecuteAndInject(const rdcstr &app, const rdcstr &workingDir, const rd return ret; } -extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_GetDefaultCaptureOptions(CaptureOptions *opts) -{ - *opts = CaptureOptions(); -} - extern "C" RENDERDOC_API ResultDetails RENDERDOC_CC RENDERDOC_StartGlobalHook( const rdcstr &pathmatch, const rdcstr &capturefile, const CaptureOptions &opts) { diff --git a/renderdoccmd/renderdoccmd.cpp b/renderdoccmd/renderdoccmd.cpp index a65cbb0aa..5d68737fd 100644 --- a/renderdoccmd/renderdoccmd.cpp +++ b/renderdoccmd/renderdoccmd.cpp @@ -1657,7 +1657,6 @@ int renderdoccmd(GlobalEnvironment &env, std::vector &argv) cmd.parse_check(argv, true); CaptureOptions opts; - RENDERDOC_GetDefaultCaptureOptions(&opts); if(it->second->IsCaptureCommand()) { diff --git a/util/test/rdtest/capture.py b/util/test/rdtest/capture.py index b33897fb9..0e68897c4 100644 --- a/util/test/rdtest/capture.py +++ b/util/test/rdtest/capture.py @@ -114,7 +114,7 @@ class TargetControl(): def run_executable(exe: str, cmdline: str, workdir="", envmods=None, cappath=None, - opts=rd.GetDefaultCaptureOptions()): + opts=None): """ Runs an executable with RenderDoc injected, and returns the control ident. @@ -130,6 +130,8 @@ def run_executable(exe: str, cmdline: str, """ if envmods is None: envmods = [] + if opts is None: + opts = rd.CaptureOptions() if cappath is None: cappath = util.get_tmp_path('capture') @@ -150,7 +152,7 @@ def run_executable(exe: str, cmdline: str, return res.ident -def run_and_capture(exe: str, cmdline: str, frame: int, *, frame_count=1, captures_expected=None, capture_name=None, opts=rd.GetDefaultCaptureOptions(), +def run_and_capture(exe: str, cmdline: str, frame: int, *, frame_count=1, captures_expected=None, capture_name=None, opts=None, timeout=None, logfile=None): """ Helper function to run an executable with a command line, capture a particular frame, and exit. @@ -173,6 +175,9 @@ def run_and_capture(exe: str, cmdline: str, frame: int, *, frame_count=1, captur if capture_name is None: capture_name = 'capture' + if opts is None: + opts = rd.CaptureOptions() + if captures_expected is None: captures_expected = frame_count