Remove use of automodule in docs

* One automodule in a file for our modules is way too much, so we split it into
  files. Unfortunately this means that only one file can have those classes and
  functions be linkable from elsewhere.
* Instead we bite the bullet and manually curate the items into pages, and at
  the same time subdivide the 'enums and data' page more which is a general
  readability and usability win as well.
* We also add some previously not-included functions, and add a doc-build time
  check to ensure that functions and classes aren't omitted from the
  documentation in future
This commit is contained in:
baldurk committed 2020-12-07 17:44:50 +00:00
1 parent 8a58ba6843
commit df6fec13f9
45 files changed
+1488 -369

No files matched your search

+1 -1
View File
@@ -97,7 +97,7 @@ CaptureContext::CaptureContext(PersistantConfig &cfg) : m_Config(cfg)
m_MainWindow->LoadInitialLayout();
{
QDir dir(configFilePath("extensions"));
QDir dir(ConfigFilePath("extensions"));
if(!dir.exists())
dir.mkpath(dir.absolutePath());
+1 -1
View File
@@ -477,7 +477,7 @@ void Analytics::Load()
Analytics::db = &actualDB;
// find the filename where the analytics will be saved
analyticsSaveLocation = configFilePath(lit("analytics.json"));
analyticsSaveLocation = ConfigFilePath(lit("analytics.json"));
QFile f(analyticsSaveLocation);
@@ -76,6 +76,16 @@ enum class KnownShaderTool : uint32_t
ITERABLE_OPERATORS(KnownShaderTool);
DOCUMENT(R"(Returns the default executable name with no suffix for a given :class:`KnownShaderTool`.
.. note::
The executable name is returned with no suffix, e.g. ``foobar`` which may need a platform specific
suffix like ``.exe`` appended.
:param KnownShaderTool tool: The tool to get the executable name for.
:return: The default executable name for this tool, or an empty string if the tool is unrecognised.
:rtype: str
)");
inline rdcstr ToolExecutable(KnownShaderTool tool)
{
if(tool == KnownShaderTool::SPIRV_Cross)
@@ -94,6 +104,14 @@ inline rdcstr ToolExecutable(KnownShaderTool tool)
return "";
}
DOCUMENT(R"(Returns the expected default input :class:`ShaderEncoding` that a
:class:`KnownShaderTool` expects. This may not be accurate and may be configurable depending on the
tool.
:param KnownShaderTool tool: The tool to get the input encoding for.
:return: The encoding that this tool expects as an input by default.
:rtype: ShaderEncoding
)");
inline ShaderEncoding ToolInput(KnownShaderTool tool)
{
if(tool == KnownShaderTool::SPIRV_Cross || tool == KnownShaderTool::spirv_dis)
@@ -110,6 +128,14 @@ inline ShaderEncoding ToolInput(KnownShaderTool tool)
return ShaderEncoding::Unknown;
}
DOCUMENT(R"(Returns the expected default output :class:`ShaderEncoding` that a
:class:`KnownShaderTool` produces. This may not be accurate and may be configurable depending on the
tool.
:param KnownShaderTool tool: The tool to get the output encoding for.
:return: The encoding that this tool produces as an output by default.
:rtype: ShaderEncoding
)");
inline ShaderEncoding ToolOutput(KnownShaderTool tool)
{
if(tool == KnownShaderTool::SPIRV_Cross)
+1 -14
View File
@@ -160,7 +160,7 @@ CaptureSettings::CaptureSettings(const QVariant &v)
numQueuedFrames = 0;
}
rdcstr configFilePath(const rdcstr &filename)
rdcstr ConfigFilePath(const rdcstr &filename)
{
QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
@@ -170,16 +170,3 @@ rdcstr configFilePath(const rdcstr &filename)
return QDir::cleanPath(dir.absoluteFilePath(filename));
}
ICaptureContext *getCaptureContext(const QWidget *widget)
{
void *ctxptr = NULL;
while(widget && !ctxptr)
{
ctxptr = widget->property("ICaptureContext").value<void *>();
widget = widget->parentWidget();
}
return (ICaptureContext *)ctxptr;
}
+2 -16
View File
@@ -2319,28 +2319,14 @@ protected:
DECLARE_REFLECTION_STRUCT(ICaptureContext);
DOCUMENT(R"(Attempt to retrieve the capture context for a particular widget.
This will search up the widget heirarchy to find if a capture context is associated with this widget
or any of its parents. Mostly useful from within widget code where a capture context can't be
explicitly passed in.
This may return ``None`` if no capture context can be found.
:param QWidget widget: The widget to search from.
:return: The capture context associated with this widget, if one unambiguously exists.
:rtype: CaptureContext
)");
ICaptureContext *getCaptureContext(const QWidget *widget);
DOCUMENT(R"(Retrieve the absolute path where a given file can be stored with other application
data.
:param str filename: The base filename.
:return: The absolute path.
:rtype: ``str``
:rtype: str
)");
rdcstr configFilePath(const rdcstr &filename);
rdcstr ConfigFilePath(const rdcstr &filename);
// simple helper for the common case of 'we just need to run this on the replay thread'
#define INVOKE_MEMFN(function) \
+13
View File
@@ -327,6 +327,19 @@ typedef QSharedPointer<GPUAddress> GPUAddressPtr;
Q_DECLARE_METATYPE(GPUAddressPtr);
ICaptureContext *getCaptureContext(const QWidget *widget)
{
void *ctxptr = NULL;
while(widget && !ctxptr)
{
ctxptr = widget->property("ICaptureContext").value<void *>();
widget = widget->parentWidget();
}
return (ICaptureContext *)ctxptr;
}
QString ResIdTextToString(RichResourceTextPtr ptr)
{
ptr->cacheDocument(NULL);
+2
View File
@@ -172,6 +172,8 @@ struct GPUAddress
void cacheAddress(const QWidget *widget);
};
ICaptureContext *getCaptureContext(const QWidget *widget);
// this will check the variant, and if it contains a ResourceId directly or text with ResourceId
// identifiers then it will be converted into a RichResourceTextPtr or ResourceId in-place. The new
// QVariant will still convert to QString so it doesn't have to be special-cased. However it must be
@@ -43,16 +43,11 @@ CaptureSettings::CaptureSettings()
RENDERDOC_GetDefaultCaptureOptions(&options);
}
rdcstr configFilePath(const rdcstr &filename)
rdcstr ConfigFilePath(const rdcstr &filename)
{
return "";
}
ICaptureContext *getCaptureContext(const QWidget *widget)
{
return NULL;
}
////////////////////////////////////////////////////////////////////////////////
// PythonContext.cpp stubs
////////////////////////////////////////////////////////////////////////////////
+12 -1
View File
@@ -264,12 +264,23 @@ TEMPLATE_ARRAY_DECLARE(rdcarray);
%rename("%s") count;
}
%inline %{
%feature("docstring") R"(Returns a string representation of an object. This is quite similar to
the built-in repr() function but it iterates over struct members and prints them out, where normally
repr() would stop and say something like 'Swig Object of type ...'.
:param Any object: The object to dump
:return: The string representation of the object.
:rtype: str
)";
%inline %{
extern "C" PyObject *RENDERDOC_DumpObject(PyObject *obj);
%}
%feature("docstring") "";
%extend SDObject {
%feature("docstring") R"(Interprets the object as an integer and returns its value.
Invalid if the object is not actually an integer.
+1 -1
View File
@@ -314,7 +314,7 @@ int main(int argc, char *argv[])
dir.mkpath(configPath);
}
QString configFilename = configFilePath(lit("UI.config"));
QString configFilename = ConfigFilePath(lit("UI.config"));
if(!config.Load(configFilename))
{