/** ****************************************************************************** * Xenia : Xbox 360 Emulator Research Project * ****************************************************************************** * Copyright 2020 Ben Vanik. All rights reserved. * * Released under the BSD license - see LICENSE in the root for more details. * ****************************************************************************** * * @modified Tom Clay, 2026 - Adapted for ReXGlue runtime */ #include #include #include REXCVAR_DEFINE_BOOL(gpu_allow_invalid_fetch_constants, false, "GPU", "Allow invalid fetch constants"); REXCVAR_DEFINE_BOOL(native_2x_msaa, true, "GPU", "Enable native 2x MSAA"); REXCVAR_DEFINE_BOOL(depth_float24_round, false, "GPU", "Round float24 depth values"); REXCVAR_DEFINE_BOOL(depth_float24_convert_in_pixel_shader, false, "GPU", "Convert float24 depth in pixel shader"); REXCVAR_DEFINE_BOOL(depth_transfer_not_equal_test, true, "GPU", "Use not-equal test for depth transfer"); REXCVAR_DEFINE_BOOL(gamma_render_target_as_unorm16, true, "GPU", "Use R16G16B16A16_UNORM for gamma render targets (more accurate than sRGB)") .lifecycle(rex::cvar::Lifecycle::kHotReload); REXCVAR_DEFINE_STRING(dump_shaders, "", "GPU", "Path to dump shaders to"); REXCVAR_DEFINE_BOOL(use_fuzzy_alpha_epsilon, true, "GPU", "Use approximate compare for alpha test values to prevent " "flickering on NVIDIA graphics cards"); REXCVAR_DEFINE_BOOL(vfetch_index_rounding_bias, false, "GPU/Shader", "Apply small epsilon bias to vertex fetch indices before " "flooring to fix black triangles caused by RCP precision"); REXCVAR_DEFINE_BOOL(draw_resolution_scaled_texture_offsets, true, "GPU/Shader", "Scale texture offsets with draw resolution"); REXCVAR_DEFINE_BOOL(gpu_debug_markers, false, "GPU", "Insert debug markers into GPU command streams for tools " "like PIX and RenderDoc. Automatically enabled when " "RenderDoc is detected."); REXCVAR_DEFINE_BOOL(ac6_fix_trails, true, "AC6", "Fix invisible missile/jet trails: drop stale cached vertex-buffer " "residency so the GPU copy of AC6's fixed-address trail history ring " "refreshes when the CPU writes it. On by default."); bool IsGpuDebugMarkersEnabled() { static bool cached = false; static bool result = false; if (!cached) { cached = true; if (REXCVAR_GET(gpu_debug_markers)) { result = true; REXLOG_INFO("GPU debug markers enabled via CVar"); } else { auto renderdoc_api = rex::ui::RenderDocAPI::CreateIfConnected(); if (renderdoc_api) { result = true; REXLOG_INFO("GPU debug markers auto-enabled (RenderDoc detected)"); } } } return result; }