mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Use rdc types instead of Qt containers in public QRenderDoc interface
* This is to support python bindings - the pyside implementation of QVector, QString, etc is not available to SWIG, so SWIG treates these all as opaque types. * Rather than trying to set up bindings that work for rdcarray and QList/QVector, or implementing separate bindings, we instead just say that the public interface must use the rdc types. In most cases they seamlessly convert to/from Qt types anyway. * In a couple of places we use an array of pairs instead of a map. In future we probably want an rdcdict or rdcmap with proper dict bindings in python.
This commit is contained in:
@@ -46,7 +46,7 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
// pass-through functions that don't need the UI thread
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
virtual QString TempCaptureFilename(QString appname) override
|
||||
virtual rdcstr TempCaptureFilename(const rdcstr &appname) override
|
||||
{
|
||||
return m_Ctx.TempCaptureFilename(appname);
|
||||
}
|
||||
@@ -55,7 +55,7 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
virtual bool IsCaptureLocal() override { return m_Ctx.IsCaptureLocal(); }
|
||||
virtual bool IsCaptureTemporary() override { return m_Ctx.IsCaptureTemporary(); }
|
||||
virtual bool IsCaptureLoading() override { return m_Ctx.IsCaptureLoading(); }
|
||||
virtual QString GetCaptureFilename() override { return m_Ctx.GetCaptureFilename(); }
|
||||
virtual rdcstr GetCaptureFilename() override { return m_Ctx.GetCaptureFilename(); }
|
||||
virtual CaptureModifications GetCaptureModifications() override
|
||||
{
|
||||
return m_Ctx.GetCaptureModifications();
|
||||
@@ -83,7 +83,7 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
{
|
||||
return m_Ctx.GetResources();
|
||||
}
|
||||
virtual QString GetResourceName(ResourceId id) override { return m_Ctx.GetResourceName(id); }
|
||||
virtual rdcstr GetResourceName(ResourceId id) override { return m_Ctx.GetResourceName(id); }
|
||||
virtual bool IsAutogeneratedName(ResourceId id) override { return m_Ctx.IsAutogeneratedName(id); }
|
||||
virtual bool HasResourceCustomName(ResourceId id) override
|
||||
{
|
||||
@@ -104,11 +104,11 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
{
|
||||
return m_Ctx.FillWindowingData(winId);
|
||||
}
|
||||
virtual const QVector<DebugMessage> &DebugMessages() override { return m_Ctx.DebugMessages(); }
|
||||
virtual const rdcarray<DebugMessage> &DebugMessages() override { return m_Ctx.DebugMessages(); }
|
||||
virtual int UnreadMessageCount() override { return m_Ctx.UnreadMessageCount(); }
|
||||
virtual void MarkMessagesRead() override { return m_Ctx.MarkMessagesRead(); }
|
||||
virtual QString GetNotes(const QString &key) override { return m_Ctx.GetNotes(key); }
|
||||
virtual QList<EventBookmark> GetBookmarks() override { return m_Ctx.GetBookmarks(); }
|
||||
virtual rdcstr GetNotes(const rdcstr &key) override { return m_Ctx.GetNotes(key); }
|
||||
virtual rdcarray<EventBookmark> GetBookmarks() override { return m_Ctx.GetBookmarks(); }
|
||||
virtual const D3D11Pipe::State &CurD3D11PipelineState() override
|
||||
{
|
||||
return m_Ctx.CurD3D11PipelineState();
|
||||
@@ -156,12 +156,12 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
return (m_Ctx.*ptr)(params...);
|
||||
}
|
||||
|
||||
virtual void LoadCapture(const QString &capture, const QString &origFilename, bool temporary,
|
||||
virtual void LoadCapture(const rdcstr &capture, const rdcstr &origFilename, bool temporary,
|
||||
bool local) override
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::LoadCapture, capture, origFilename, temporary, local);
|
||||
}
|
||||
virtual bool SaveCaptureTo(const QString &capture) override
|
||||
virtual bool SaveCaptureTo(const rdcstr &capture) override
|
||||
{
|
||||
return InvokeRetFunction<bool>(&ICaptureContext::SaveCaptureTo, capture);
|
||||
}
|
||||
@@ -170,7 +170,7 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
InvokeVoidFunction(&ICaptureContext::RecompressCapture);
|
||||
}
|
||||
virtual void CloseCapture() override { InvokeVoidFunction(&ICaptureContext::CloseCapture); }
|
||||
virtual void SetEventID(const QVector<ICaptureViewer *> &exclude, uint32_t selectedEventID,
|
||||
virtual void SetEventID(const rdcarray<ICaptureViewer *> &exclude, uint32_t selectedEventID,
|
||||
uint32_t eventID, bool force = false) override
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::SetEventID, exclude, selectedEventID, eventID, force);
|
||||
@@ -188,11 +188,11 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::AddMessages, msgs);
|
||||
}
|
||||
virtual void SetResourceCustomName(ResourceId id, const QString &name) override
|
||||
virtual void SetResourceCustomName(ResourceId id, const rdcstr &name) override
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::SetResourceCustomName, id, name);
|
||||
}
|
||||
virtual void SetNotes(const QString &key, const QString &contents) override
|
||||
virtual void SetNotes(const rdcstr &key, const rdcstr &contents) override
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::SetNotes, key, contents);
|
||||
}
|
||||
@@ -355,8 +355,9 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::ShowResourceInspector);
|
||||
}
|
||||
virtual IShaderViewer *EditShader(bool customShader, const QString &entryPoint,
|
||||
const QStringMap &files, IShaderViewer::SaveCallback saveCallback,
|
||||
virtual IShaderViewer *EditShader(bool customShader, const rdcstr &entryPoint,
|
||||
const rdcstrpairs &files,
|
||||
IShaderViewer::SaveCallback saveCallback,
|
||||
IShaderViewer::CloseCallback closeCallback) override
|
||||
{
|
||||
return InvokeRetFunction<IShaderViewer *>(&ICaptureContext::EditShader, customShader,
|
||||
@@ -365,7 +366,7 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
|
||||
virtual IShaderViewer *DebugShader(const ShaderBindpointMapping *bind,
|
||||
const ShaderReflection *shader, ResourceId pipeline,
|
||||
ShaderDebugTrace *trace, const QString &debugContext) override
|
||||
ShaderDebugTrace *trace, const rdcstr &debugContext) override
|
||||
{
|
||||
return InvokeRetFunction<IShaderViewer *>(&ICaptureContext::DebugShader, bind, shader, pipeline,
|
||||
trace, debugContext);
|
||||
@@ -377,14 +378,14 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
}
|
||||
|
||||
virtual IBufferViewer *ViewBuffer(uint64_t byteOffset, uint64_t byteSize, ResourceId id,
|
||||
const QString &format = QString()) override
|
||||
const rdcstr &format = "") override
|
||||
{
|
||||
return InvokeRetFunction<IBufferViewer *>(&ICaptureContext::ViewBuffer, byteOffset, byteSize,
|
||||
id, format);
|
||||
}
|
||||
|
||||
virtual IBufferViewer *ViewTextureAsBuffer(uint32_t arrayIdx, uint32_t mip, ResourceId id,
|
||||
const QString &format = QString()) override
|
||||
const rdcstr &format = "") override
|
||||
{
|
||||
return InvokeRetFunction<IBufferViewer *>(&ICaptureContext::ViewTextureAsBuffer, arrayIdx, mip,
|
||||
id, format);
|
||||
@@ -404,7 +405,7 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
display);
|
||||
}
|
||||
|
||||
virtual QWidget *CreateBuiltinWindow(const QString &objectName) override
|
||||
virtual QWidget *CreateBuiltinWindow(const rdcstr &objectName) override
|
||||
{
|
||||
return InvokeRetFunction<QWidget *>(&ICaptureContext::CreateBuiltinWindow, objectName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user