From 7b437b2ea3aba6d52c44209a4c6dda62dc9a070b Mon Sep 17 00:00:00 2001 From: Silverlan Date: Sun, 8 Dec 2024 19:19:23 +0100 Subject: [PATCH] feat: add launch option -enable_gfx_diagnostics --- .../client/include/pragma/rendering/c_render_context.hpp | 9 ++++++++- core/client/src/c_launchparameters.cpp | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/client/include/pragma/rendering/c_render_context.hpp b/core/client/include/pragma/rendering/c_render_context.hpp index c87d8b60d..78d652345 100644 --- a/core/client/include/pragma/rendering/c_render_context.hpp +++ b/core/client/include/pragma/rendering/c_render_context.hpp @@ -29,7 +29,11 @@ namespace prosper { namespace pragma { class DLLCLIENT RenderContext { public: - enum class StateFlags : uint8_t { None = 0u, GfxAPIValidationEnabled = 1u }; + enum class StateFlags : uint8_t { + None = 0u, + GfxAPIValidationEnabled = 1u, + GfxDiagnosticsModeEnabled = GfxAPIValidationEnabled << 1u, + }; RenderContext(); virtual ~RenderContext(); @@ -53,6 +57,9 @@ namespace pragma { void InitializeRenderAPI(); void SetGfxAPIValidationEnabled(bool b); + void SetGfxDiagnosticsModeEnabled(bool b); + bool IsGfxAPIValidationEnabled() const; + bool IsGfxDiagnosticsModeEnabled() const; void SetRenderAPI(const std::string &renderAPI); const std::string &GetRenderAPI() const; diff --git a/core/client/src/c_launchparameters.cpp b/core/client/src/c_launchparameters.cpp index 672f045f7..26ffbdc64 100644 --- a/core/client/src/c_launchparameters.cpp +++ b/core/client/src/c_launchparameters.cpp @@ -50,6 +50,8 @@ static void LPARAM_fullbright(const std::vector &argv) { c_engine-> static void LPARAM_vk_enable_validation(const std::vector &argv) { c_engine->SetGfxAPIValidationEnabled(true); } +static void LPARAM_vk_enable_gfx_diagnostics(const std::vector &argv) { c_engine->SetGfxDiagnosticsModeEnabled(true); } + static void LPARAM_render_api(const std::vector &argv) { if(argv.empty()) @@ -138,6 +140,7 @@ REGISTER_LAUNCH_PARAMETER_HELP(-h, LPARAM_h, "", "set the screen height" REGISTER_LAUNCH_PARAMETER_HELP(-fullbright, LPARAM_fullbright, "", "start in fullbright mode"); REGISTER_LAUNCH_PARAMETER_HELP(-enable_gfx_validation, LPARAM_vk_enable_validation, "<1/0>", "Enables or disables graphics API validation."); +REGISTER_LAUNCH_PARAMETER_HELP(-enable_gfx_diagnostics, LPARAM_vk_enable_gfx_diagnostics, "<1/0>", "Enables or disables GPU diagnostics mode."); REGISTER_LAUNCH_PARAMETER_HELP(-graphics_api, LPARAM_render_api, "", "Changes the graphics API to use for rendering."); REGISTER_LAUNCH_PARAMETER_HELP(-audio_api, LPARAM_audio_api, "", "Changes the audio API to use for audio playback."); REGISTER_LAUNCH_PARAMETER_HELP(-auto_exec, LPARAM_auto_exec, "