Add renderdoc API support (#585)

* Add renderdoc API support

* FIx renderdoc include directory

* Fix RenderDoc linking

* Fix Renderdoc linking (again)

* Maybe fix renderdoc
This commit is contained in:
wheremyfoodat 2024-08-23 02:30:25 +00:00 committed by GitHub
parent 471bdd6ab9
commit 2754df9b94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 942 additions and 4 deletions

View file

@ -39,7 +39,8 @@ struct EmulatorConfig {
bool audioEnabled = false;
bool vsyncEnabled = true;
bool enableRenderdoc = false;
bool printAppVersion = true;
bool appVersionOnWindow = false;

View file

@ -135,4 +135,7 @@ class Emulator {
std::filesystem::path getAppDataRoot();
std::span<u8> getSMDH();
private:
void loadRenderdoc();
};

38
include/renderdoc.hpp Normal file
View file

@ -0,0 +1,38 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <string>
#include "helpers.hpp"
#ifdef PANDA3DS_ENABLE_RENDERDOC
namespace Renderdoc {
// Loads renderdoc dynamic library module.
void loadRenderdoc();
// Begins a capture if a renderdoc instance is attached.
void startCapture();
// Ends current renderdoc capture.
void endCapture();
// Triggers capturing process.
void triggerCapture();
// Sets output directory for captures
void setOutputDir(const std::string& path, const std::string& prefix);
// Returns whether we've compiled with Renderdoc support
static constexpr bool isSupported() { return true; }
} // namespace Renderdoc
#else
namespace Renderdoc {
static void loadRenderdoc() {}
static void startCapture() { Helpers::panic("Tried to start a Renderdoc capture while support for renderdoc is disabled") }
static void endCapture() { Helpers::panic("Tried to end a Renderdoc capture while support for renderdoc is disabled") }
static void triggerCapture() { Helpers::panic("Tried to trigger a Renderdoc capture while support for renderdoc is disabled") }
static void setOutputDir(const std::string& path, const std::string& prefix) {}
static constexpr bool isSupported() { return false; }
} // namespace Renderdoc
#endif