From 10272fa35bef2f7c88e8466e7d271ce054ff1d62 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 12 May 2026 11:09:34 +0100 Subject: [PATCH] Make most extension json fields optional * We require `extension_api` and `version` fields in case needed for future compatibility --- docs/how/how_python_extension.rst | 2 +- qrenderdoc/Code/CaptureContext.cpp | 31 +++++++++++++----------------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/docs/how/how_python_extension.rst b/docs/how/how_python_extension.rst index d245e9948..b32a99863 100644 --- a/docs/how/how_python_extension.rst +++ b/docs/how/how_python_extension.rst @@ -25,7 +25,7 @@ Next to each python module's ``__init__.py`` you should create a file ``extensio "url": "url/to/repository" } -In this JSON the ``extension_api`` field is currently fixed to 1. +In this JSON the ``extension_api`` field is currently fixed to 1. This is the only required field as the others will be filled with defaults if omitted, but it is highly recommended you fill them out. The ``minimum_renderdoc`` field controls whether the extension can be enabled on a given RenderDoc version, and allows you to block incompatible versions of RenderDoc. diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index a6ba0d063..a04a1a088 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -351,16 +351,6 @@ rdcarray CaptureContext::GetInstalledExtensions() ext.hasChanges = m_DirtyExtensions.contains(rdcstr(package)); - if(json.contains(lit("name"))) - { - ext.name = json[lit("name")].toString(); - } - else - { - qCritical() << "Extension" << package << "is corrupt, no name entry"; - continue; - } - ext.extensionAPI = 1; if(json.contains(lit("extension_api"))) { @@ -378,8 +368,16 @@ rdcarray CaptureContext::GetInstalledExtensions() } else { - qCritical() << "Extension" << QString(ext.name) << "is corrupt, no version entry"; - continue; + ext.version = lit("1.0"); + } + + if(json.contains(lit("name"))) + { + ext.name = json[lit("name")].toString(); + } + else + { + ext.name = package; } if(json.contains(lit("description"))) @@ -388,8 +386,7 @@ rdcarray CaptureContext::GetInstalledExtensions() } else { - qCritical() << "Extension" << QString(ext.name) << "is corrupt, no description entry"; - continue; + ext.description = tr("No description provided"); } if(json.contains(lit("author"))) @@ -398,8 +395,7 @@ rdcarray CaptureContext::GetInstalledExtensions() } else { - qCritical() << "Extension" << QString(ext.name) << "is corrupt, no author entry"; - continue; + ext.author = tr("Unknown Author"); } if(json.contains(lit("url"))) @@ -408,8 +404,7 @@ rdcarray CaptureContext::GetInstalledExtensions() } else { - qCritical() << "Extension" << QString(ext.name) << "is corrupt, no URL entry"; - continue; + ext.extensionURL = rdcstr(); } if(json.contains(lit("minimum_renderdoc")))