mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 05:35:48 +00:00
Add a dummy pass-through conversion for already converted python objects
This commit is contained in:
@@ -57,6 +57,9 @@ public:
|
||||
|
||||
static void ProcessExtensionWork(std::function<void()> callback);
|
||||
static bool LoadExtension(ICaptureContext &ctx, const rdcstr &extension);
|
||||
static void ConvertPyArgs(const ExtensionCallbackData &data,
|
||||
rdcarray<rdcpair<rdcstr, PyObject *>> &args);
|
||||
static void FreePyArgs(rdcarray<rdcpair<rdcstr, PyObject *>> &args);
|
||||
|
||||
bool CheckInterfaces();
|
||||
|
||||
|
||||
@@ -71,6 +71,27 @@ struct TypeConversion
|
||||
}
|
||||
};
|
||||
|
||||
// specialisations for Python object that just increments the refcount. Only useful if we're doing
|
||||
// something quite special and manually converting outside from some type we don't want to expose to
|
||||
// python (this is used for QVariant conversion in python callback arguments).
|
||||
template <>
|
||||
struct TypeConversion<PyObject *, false>
|
||||
{
|
||||
static int ConvertFromPy(PyObject *in, PyObject *&out)
|
||||
{
|
||||
out = in;
|
||||
Py_XINCREF(out);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyObject *ConvertToPy(PyObject *in)
|
||||
{
|
||||
Py_XINCREF(in);
|
||||
return in;
|
||||
}
|
||||
};
|
||||
|
||||
// specialisations for pointer types (opaque handles to be moved not copied)
|
||||
template <typename Opaque>
|
||||
struct TypeConversion<Opaque *, false>
|
||||
|
||||
Reference in New Issue
Block a user