render: drop the static sun forced-failure debug hook

This commit is contained in:
mchughalex 2026-07-21 03:33:42 +01:00
parent 77283fe3fb
commit b8a8180475
2 changed files with 2 additions and 21 deletions

View file

@ -710,17 +710,6 @@ REXCVAR_DEFINE_INT32(skate3_native_render_scene_shadow_static_size, 4096,
"~9 cm. Applies live: the map recreates on change.")
.range(1024, 8192)
.lifecycle(rex::cvar::Lifecycle::kHotReload);
REXCVAR_DEFINE_INT32(skate3_native_render_scene_debug_fail_static_sun, 0,
"Skate 3",
"DEBUG: make static sun-shadow map creation fail as if "
"the allocation had been rejected, driving the "
"renderer's unrecoverable-failure path (sticky fallback "
"to emulated output). 0 = off, 1 = fail every creation, "
"2 = fail only hot recreates (size changes after a "
"successful first build). Exercises the failure "
"indicator and the shutdown path from the failed state.")
.range(0, 2)
.lifecycle(rex::cvar::Lifecycle::kHotReload);
REXCVAR_DEFINE_BOOL(skate3_native_render_scene_shadow_pcss, true, "Skate 3",
"Contact-hardening soft shadows (PCSS): a blocker search "
"estimates the caster distance per pixel and the filter "

View file

@ -106,7 +106,6 @@ REXCVAR_DECLARE(double, skate3_native_render_scene_shadow_pcss_sun_deg);
REXCVAR_DECLARE(double, skate3_native_render_scene_shadow_static_bias);
REXCVAR_DECLARE(double, skate3_native_render_scene_shadow_static_radius);
REXCVAR_DECLARE(int32_t, skate3_native_render_scene_shadow_static_size);
REXCVAR_DECLARE(int32_t, skate3_native_render_scene_debug_fail_static_sun);
REXCVAR_DECLARE(double, skate3_native_render_scene_shadow_static_strength);
REXCVAR_DECLARE(bool, skate3_native_render_scene_shadows);
REXCVAR_DECLARE(bool, skate3_native_render_scene_shafts);
@ -3313,13 +3312,6 @@ bool EnsureShadowResources(const NativeGuestOutputRenderContext& context) {
// tiles side by side: inner (r/6, centimeter contact detail with
// useful reach), mid (r/2) and far (full radius, large-caster
// coverage); size is per tile.
// Forced-failure debug hook (see the cvar's help text): mode 1 fails
// every creation, mode 2 only hot recreates; retries are skipped so the
// sticky-failed path below engages like a hard driver rejection.
const int32_t debug_fail =
REXCVAR_GET(skate3_native_render_scene_debug_fail_static_sun);
const bool force_fail =
debug_fail == 1 || (debug_fail == 2 && g_r.static_sun_requested != 0);
g_r.static_sun_requested = want_static_size;
g_r.static_sun_size = want_static_size;
nrhi::TextureDesc desc;
@ -3330,11 +3322,11 @@ bool EnsureShadowResources(const NativeGuestOutputRenderContext& context) {
desc.initial_state = nrhi::ResourceState::kRenderTarget;
desc.clear_color[0] = 1.0f; // depth: far = lit
desc.clear_color[1] = 1.0f;
g_r.static_sun = force_fail ? nullptr : device->CreateTexture(desc);
g_r.static_sun = device->CreateTexture(desc);
// Allocation-failure fallback (VRAM pressure, driver limits): a
// coarser static sun map beats marking the whole renderer failed and
// dropping the session to emulated output.
while (!force_fail && g_r.static_sun == nullptr && g_r.static_sun_size > 1024) {
while (g_r.static_sun == nullptr && g_r.static_sun_size > 1024) {
g_r.static_sun_size /= 2;
desc.width = g_r.static_sun_size * 3;
desc.height = g_r.static_sun_size;