Skip to content

Commit

Permalink
feat: add launch option -enable_gfx_diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
Silverlan committed Dec 8, 2024
1 parent 99068da commit 7b437b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/client/include/pragma/rendering/c_render_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions core/client/src/c_launchparameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ static void LPARAM_fullbright(const std::vector<std::string> &argv) { c_engine->

static void LPARAM_vk_enable_validation(const std::vector<std::string> &argv) { c_engine->SetGfxAPIValidationEnabled(true); }

static void LPARAM_vk_enable_gfx_diagnostics(const std::vector<std::string> &argv) { c_engine->SetGfxDiagnosticsModeEnabled(true); }

static void LPARAM_render_api(const std::vector<std::string> &argv)
{
if(argv.empty())
Expand Down Expand Up @@ -138,6 +140,7 @@ REGISTER_LAUNCH_PARAMETER_HELP(-h, LPARAM_h, "<height>", "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, "<moduleName>", "Changes the graphics API to use for rendering.");
REGISTER_LAUNCH_PARAMETER_HELP(-audio_api, LPARAM_audio_api, "<moduleName>", "Changes the audio API to use for audio playback.");
REGISTER_LAUNCH_PARAMETER_HELP(-auto_exec, LPARAM_auto_exec, "<script>", "Auto-execute this Lua-script on launch.");
Expand Down

0 comments on commit 7b437b2

Please sign in to comment.