Remove RENDERDOC_GetDefaultCaptureOptions, initialise in constructor

This commit is contained in:
baldurk
2026-08-13 17:46:46 +01:00
parent e3b0fa0a24
commit 3f653cfbf2
12 changed files with 27 additions and 53 deletions
-2
View File
@@ -17,8 +17,6 @@ Execution & Injection
.. autoclass:: renderdoc.CaptureOptions
:members:
.. autofunction:: renderdoc.GetDefaultCaptureOptions
.. autoclass:: renderdoc.EnvironmentModification
:members:
+1 -1
View File
@@ -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
@@ -75,7 +75,6 @@ CaptureSettings::CaptureSettings()
autoStart = false;
queuedFrameCap = 0;
numQueuedFrames = 0;
RENDERDOC_GetDefaultCaptureOptions(&options);
}
CaptureSettings::operator QVariant() const
@@ -40,7 +40,6 @@ CaptureSettings::CaptureSettings()
autoStart = false;
queuedFrameCap = 0;
numQueuedFrames = 0;
RENDERDOC_GetDefaultCaptureOptions(&options);
}
rdcstr ConfigFilePath(const rdcstr &filename)
+1 -7
View File
@@ -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<rdcstr> *supportedProtocols { $1 = new rdcarray<rdcstr>; }
%typemap(argout) rdcarray<rdcstr> *supportedProtocols {
$result = ConvertToPy(*$1);
+18 -5
View File
@@ -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.
-9
View File
@@ -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.
-1
View File
@@ -21,7 +21,6 @@
RENDERDOC_GetAPI;
RDOCSELF_AllocArrayMem;
RDOCSELF_FreeArrayMem;
RDOCSELF_GetDefaultCaptureOptions;
RDOCSELF_NeedVulkanLayerRegistration;
RDOCSELF_UpdateVulkanLayerRegistration;
RDOCSELF_ExecuteAndInject;
-18
View File
@@ -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
-5
View File
@@ -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)
{
-1
View File
@@ -1657,7 +1657,6 @@ int renderdoccmd(GlobalEnvironment &env, std::vector<std::string> &argv)
cmd.parse_check(argv, true);
CaptureOptions opts;
RENDERDOC_GetDefaultCaptureOptions(&opts);
if(it->second->IsCaptureCommand())
{
+7 -2
View File
@@ -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