Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

refactor(shadows): remove the sun shadow test switches

Richard Louie Orillafe9a056aa6d6
diff --git a/GeneralsMD/Code/BuildFingerprint.manifest b/GeneralsMD/Code/BuildFingerprint.manifest
index f57e8d1af..8ef0769e5 100644
--- a/GeneralsMD/Code/BuildFingerprint.manifest
+++ b/GeneralsMD/Code/BuildFingerprint.manifest
@@ -1983,7 +1983,6 @@ Libraries/Include/Platform/RendererName.h
Libraries/Include/Platform/SleepMilliseconds.h
Libraries/Include/Platform/StrdupAsWindows.h
Libraries/Include/Platform/SunShadow.h
-Libraries/Include/Platform/SunShadowMode.h
Libraries/Include/Platform/SunSmoke.h
Libraries/Include/rts/debug.h
Libraries/Include/rts/profile.h
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameEngine.h b/GeneralsMD/Code/GameEngine/Include/Common/GameEngine.h
index 8e7925610..08c13cea0 100644
--- a/GeneralsMD/Code/GameEngine/Include/Common/GameEngine.h
+++ b/GeneralsMD/Code/GameEngine/Include/Common/GameEngine.h
@@ -86,8 +86,6 @@ Int GameEngine_videoFramesPerSecond( void );
Int GameEngine_videoPicture( void );
Real GameEngine_pictureFrame( void );
UnsignedInt GameEngine_pictureMilliseconds( void );
-// Opt-in screenshot validation: one rendered picture per logic frame, fixed scenery time.
-Bool GameEngine_isShadowCaptureClock( void );
/** How long the catch-up loop may keep starting new logic ticks before it gives up for this pass.
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
index 1a2e9e71c..b20581e92 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
@@ -1728,24 +1728,8 @@ UnsignedInt GameEngine_pictureMilliseconds( void )
return shown <= 0 ? 0 : (UnsignedInt)(shown * 1000 / (LOGICFRAMES_PER_SECOND * pictures));
}
-Bool GameEngine_isShadowCaptureClock( void )
-{
-#if defined(__linux__)
- // Cache the request before the screenshot clears its pending frame. Never admit a replay
- // or network session, and never enable this clock through ordinary graphics settings.
- static const bool asked = TheGlobalData && TheGlobalData->m_screenShotFrame > 0
- && getenv("ZH_SUN_SHADOW_CAPTURE_CLOCK")
- && strcmp(getenv("ZH_SUN_SHADOW_CAPTURE_CLOCK"), "logic") == 0;
- return asked && TheGlobalData->m_turbo && TheNetwork == NULL && TheGameLogic
- && !TheGameLogic->isInMultiplayerGame() && !TheGameLogic->isInReplayGame();
-#else
- return FALSE;
-#endif
-}
-
Real GameEngine_logicTickFraction( void )
{
- if (GameEngine_isShadowCaptureClock()) return 1.0f;
const Int pictures = GameEngine_videoPictures();
if (pictures > 1)
return (Real)(GameEngine_videoPicture() + 1) / (Real)pictures;
@@ -2926,9 +2910,6 @@ void GameEngine::planLogicPass( LogicPassPlan &plan )
&& turboFrame + TURBO_SETTLE_FRAMES >= TheGlobalData->m_screenShotFrame
&& turboFrame <= TheGlobalData->m_screenShotFrame;
fastMode = fastMode || ( TheGlobalData->m_turbo && !turboSettling && TheNetwork == NULL );
- // A fixed scenery clock also needs one client update per logic frame. Wall-clock
- // catch-up during screenshot settling otherwise skips tree/particle updates on a slower pass.
- fastMode = fastMode || GameEngine_isShadowCaptureClock();
/* -video: one logic frame a pass across the range being recorded, so the draw in front of each
logic frame is the one picture of it. Paced by the wall clock, a pass that fell behind would
@@ -3008,7 +2989,7 @@ void GameEngine::planLogicPass( LogicPassPlan &plan )
Bool GameEngine::planOverlappedTick( void )
{
if (TheNetwork != NULL || !TheGameLogic->isInGame() || TheGameLogic->isInShellGame()
- || TheGameLogic->isLoadingMap() || isVideoPass() || GameEngine_isShadowCaptureClock())
+ || TheGameLogic->isLoadingMap() || isVideoPass())
return FALSE;
TheMessageStream->propagateMessages();
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9SunShadow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9SunShadow.cpp
index 572241828..61da94f3f 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9SunShadow.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9SunShadow.cpp
@@ -5,7 +5,6 @@
#include "SdlPipelineCache.h"
#include "SdlRenderMatrix.h"
#include "engineshader.h"
-#include "Platform/SunShadowMode.h"
#include "Platform/SunShadow.h"
#include "Platform/SunSmoke.h"
#include "ffshader.h"
@@ -13,7 +12,6 @@
#include <cmath>
#include <cstring>
#include <cstdio>
-#include <cstdlib>
// One list for declaration, capture and restoration, including shader register banks.
#define SUN_VALUES(X) \
@@ -78,7 +76,7 @@ bool PosixDevice9::Begin_Sun_Shadow(unsigned size)
// Refusing re-entry must leave the outer capture intact.
if (SunActive || SunSceneExclusions) return false;
SunReady = false;
- if (!Gpu || (!SunReceiverFailure.empty() && SunShadow::RequestedMode() == SunShadow::Mode::Mapped)) return false;
+ if (!Gpu || !SunReceiverFailure.empty()) return false;
SdlTarget target;
std::string error;
if (!Gpu->Sun_Shadow_Target(size, target, error)) {
@@ -145,8 +143,7 @@ bool PosixDevice9::Fill_Sun_Smoke(const float *casters, unsigned count, float st
if (!Gpu || SunActive || SunSceneExclusions) return false;
if (Sun) Sun->SmokeFilled = false;
if (!casters || !count) return Gpu->Fill_Sun_Smoke(nullptr,nullptr,0);
- if (!Sun || !SunReady || SunShadow::RequestedMode()!=SunShadow::Mode::Mapped
- || !std::isfinite(strength) || strength<0 || strength>1) return false;
+ if (!Sun || !SunReady || !std::isfinite(strength) || strength<0 || strength>1) return false;
if (!Gpu->Fill_Sun_Smoke(Sun->ViewProjection,casters,count)) return false;
Sun->SmokeFilled = Gpu->Sun_Smoke_Texture()!=nullptr;
Sun->SmokeStrength = strength;
@@ -184,25 +181,6 @@ std::string PosixDevice9::Sun_Shadow_Report()
for (float d : depth) if (d < 1.0f) {
++covered; nearest=std::min(nearest,d); farthest=std::max(farthest,d);
}
- // Optional inspection of the latest report's map. Never read back or write files
- // in ordinary rendering; this path is reached only by the explicit report.
- if (const char *path = std::getenv("ZH_SUN_SHADOW_DEPTH_DUMP")) {
- if (FILE *file = std::fopen(path,"wb")) {
- std::fprintf(file,"P5\n# Row-vector world-to-shadow-clip matrix:");
- for (float value : Sun->ViewProjection) std::fprintf(file," %.9g",value);
- std::fprintf(file,"\n%u %u\n65535\n",Sun->Target.Width,Sun->Target.Height);
- std::vector<unsigned char> pixels(depth.size()*2);
- for (size_t i=0; i<depth.size(); ++i) {
- const float d = std::isfinite(depth[i]) ? std::max(0.0f,std::min(1.0f,depth[i])) : 1.0f;
- const unsigned value = unsigned(d*65535.0f+0.5f);
- pixels[2*i] = static_cast<unsigned char>(value>>8);
- pixels[2*i+1] = static_cast<unsigned char>(value&255);
- }
- const bool written = std::fwrite(pixels.data(),1,pixels.size(),file) == pixels.size();
- const int closed = std::fclose(file);
- if (!written || closed) std::fprintf(stderr,"SunShadow: depth dump write failed\n");
- } else std::fprintf(stderr,"SunShadow: depth dump open failed\n");
- }
char line[360];
std::snprintf(line,sizeof(line),"SDL sun %ux%u, %u draws, %u/%zu texels occupied, depth %.6f..%.6f, receiving=%u, cumulative receivers solid=%llu ground=%llu",
Sun->Target.Width,Sun->Target.Height,Sun->Draws,covered,depth.size(),nearest,farthest,
@@ -217,7 +195,7 @@ bool PosixDevice9::Set_Sun_Shadow_Parameters(float bias, float strength, float w
{
if (!Sun || SunSceneExclusions || !SunReceiverFailure.empty()) return false;
Sun->Receiving = false;
- if (!SunReady || SunActive || SunShadow::RequestedMode() != SunShadow::Mode::Mapped) return false;
+ if (!SunReady || SunActive) return false;
const float numbers[] = {bias,strength,widest,narrowest,texelsPerGap,unitsPerDepth,skyFill};
for (float value : numbers) if (!std::isfinite(value)) return false;
if (bias<0 || strength<0 || strength>1 || narrowest<0 || widest<narrowest || texelsPerGap<0
@@ -278,7 +256,6 @@ bool PosixDevice9::Sun_Camera_Space() const
bool PosixDevice9::Sun_Receives_Target(const SdlTarget &target) const
{
return Sun && SunReady && Sun->Receiving && !SunActive && !SunSceneExclusions
- && SunShadow::RequestedMode() == SunShadow::Mode::Mapped
&& target.Colour == Sun->Scene.Colour && target.Depth == Sun->Scene.Depth
&& target.Width == Sun->Scene.Width && target.Height == Sun->Scene.Height
&& std::memcmp(&Viewport,&Sun->SceneViewport,sizeof(Viewport)) == 0
@@ -322,7 +299,6 @@ bool PosixDevice9::Sun_Owns_Scene_Shadows()
return Gpu && Sun && SunReady && Resolve_Target(target,error) && Sun_Receives_Target(target);
return Sun && SunReady && Sun->Receiving && !SunActive && !SunSceneExclusions
&& Sun->SceneGeneration == SunSceneGeneration
- && SunShadow::RequestedMode() == SunShadow::Mode::Mapped
&& Resolve_Target(target,error)
&& target.Colour == Sun->Scene.Colour && target.Depth == Sun->Scene.Depth
&& target.Width == Sun->Scene.Width && target.Height == Sun->Scene.Height
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlSunShadowDebug.h b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlSunShadowDebug.h
index 228ddf713..1fd1f78cb 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlSunShadowDebug.h
+++ b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlSunShadowDebug.h
@@ -1,11 +1,16 @@
#pragma once
-#include <cstdlib>
#include <cstring>
// Fault validation only, at resource/program/pipeline creation, never the cached
-// draw path. The harness clears inherited requests unless --fault is explicit.
+// draw path. Only tests name a point; the game never does.
+inline const char *&Sdl_Sun_Shadow_Fault_Point()
+{
+ static const char *point = nullptr;
+ return point;
+}
+
inline bool Sdl_Sun_Shadow_Fault(const char *point)
{
- const char *requested = std::getenv("ZH_TEST_SUN_SHADOW_FAILURE");
+ const char *requested = Sdl_Sun_Shadow_Fault_Point();
return requested && std::strcmp(requested, point) == 0;
}
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
index af5e282a2..4b695c345 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
@@ -75,7 +75,6 @@
#include "WW3D2/sortingrenderer.h"
#include "GameClient/View.h"
#include "Platform/RenderTypes.h"
-#include "Platform/SunShadowMode.h"
#include "Platform/SunShadow.h"
#include "Lib/Clock.h" // Clock_Ticks: QueryPerformanceCounter on Windows, a monotonic clock elsewhere
#include "GameClient/ParticleSys.h"
@@ -4180,7 +4179,6 @@ void W3DVolumetricShadowManager::renderShadowMap( CameraClass &sceneCamera )
// A failed, disabled or empty pass must not expose the previous view's shadow.
SunShadow::Clear(DX8Wrapper::_Get_D3D_Device());
DX8Wrapper::Flush_Deferred_D3D9_State();
- const SunShadow::Mode mode = SunShadow::RequestedMode();
// Trees historically cast under either shadow option. Smoke has its own option;
// it may keep an otherwise empty depth capture alive without enabling geometry.
#if defined(__linux__)
@@ -4204,7 +4202,7 @@ void W3DVolumetricShadowManager::renderShadowMap( CameraClass &sceneCamera )
const UnsignedInt chosenTexels = (SHADOW_MAP_TEXELS / 2) << TheGlobalData->m_shadowQuality;
UnsignedInt texels = chosenTexels;
Bool begun = FALSE;
- if (mode != SunShadow::Mode::Legacy && TheGlobalData->m_shadowMap && captureShadows && TheTacticalView != NULL)
+ if (TheGlobalData->m_shadowMap && captureShadows && TheTacticalView != NULL)
{
if (wholeMap && !wholeMapRefused && SunShadow::Begin( DX8Wrapper::_Get_D3D_Device(), SHADOW_MAP_WHOLE_MAP_TEXELS ))
{
@@ -4459,17 +4457,16 @@ void W3DVolumetricShadowManager::renderShadowMap( CameraClass &sceneCamera )
// past the map's limit the smoke nearest the camera wins: the freecam's box is centred on the
// map's middle, which is not where it is looking from
#if defined(__linux__)
- const Bool fillSmoke = mode == SunShadow::Mode::Mapped && captured;
-#else
- // Direct3D 11 fills the smoke map whether or not the depth capture bound, as it always has.
- const Bool fillSmoke = TRUE;
-#endif
- if (fillSmoke)
+ if (captured)
fillSmokeMap( transform, wholeMap ? sceneCamera.Get_Position() : focus, halfWidth, farClip );
else {
SunShadow::FillSmoke(DX8Wrapper::_Get_D3D_Device(), NULL, 0, 0.0f );
forgetSmokeInSunMap();
}
+#else
+ // Direct3D 11 fills the smoke map whether or not the depth capture bound, as it always has.
+ fillSmokeMap( transform, wholeMap ? sceneCamera.Get_Position() : focus, halfWidth, farClip );
+#endif
// The frame's own camera, put back: the view, the projection and the viewport all went with the
// sun. Without this everything drawn after the pass is drawn from the sun's seat, which is the
@@ -4517,24 +4514,23 @@ void W3DVolumetricShadowManager::renderShadowMap( CameraClass &sceneCamera )
if (TheGlobalData->m_lightingStyle == LIGHTING_STYLE_REFORGED && TheGlobalData->m_shadowMapStrength <= 0.0f)
strength = SHADOW_MAP_REFORGED_STRENGTH;
+ /* Said last, and only on the way out: everything above can bail, and the volumes have to know
+ whether this frame's shadows are in the map or still theirs to draw. The count of casters is
+ not part of that answer. It was, and a frame that happened to hold none - a camera over open
+ ground - handed the frame back to the volumes for that one frame, so the whole scene's
+ shadows changed style and back again as the camera moved. Backend scene ownership is
+ installed only after successful parameters. */
DX8Wrapper::Flush_Deferred_D3D9_State();
#if defined(__linux__)
- const bool receiving = captured && mode == SunShadow::Mode::Mapped
- && SunShadow::Parameters(DX8Wrapper::_Get_D3D_Device(), depthBias, strength, widest,
+ if (captured)
+ SunShadow::Parameters(DX8Wrapper::_Get_D3D_Device(), depthBias, strength, widest,
narrowest, penumbra / worldPerTexel, unitsPerUnitOfDepth, skyFill);
#else
// Direct3D 11 takes the parameters whether or not the depth capture bound, as it always has.
- const bool receiving = SunShadow::Parameters(DX8Wrapper::_Get_D3D_Device(), depthBias, strength, widest,
+ SunShadow::Parameters(DX8Wrapper::_Get_D3D_Device(), depthBias, strength, widest,
narrowest, penumbra / worldPerTexel, unitsPerUnitOfDepth, skyFill);
#endif
- /* Said last, and only on the way out: everything above can bail, and the volumes have to know
- whether this frame's shadows are in the map or still theirs to draw. The count of casters is
- not part of that answer. It was, and a frame that happened to hold none - a camera over open
- ground - handed the frame back to the volumes for that one frame, so the whole scene's
- shadows changed style and back again as the camera moved. */
- (void)receiving; // backend scene ownership is installed only after successful parameters
-
#ifdef DEBUG_LOGGING
{
Int64 tShadowEnd, freq;
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp
index 608f14650..441284435 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp
@@ -2502,15 +2502,7 @@ AGAIN:
}
}
- // Diagnostic pictures need the same animation/cloud phase even when one renderer does
- // more work. Establish zero during loading so texture mappers inherit the same origin.
- // This is opt-in for screenshot runs; ordinary play, multiplayer and replay keep their clock.
- const bool shadowCaptureClock = GameEngine_isShadowCaptureClock();
- if (shadowCaptureClock) {
- if (!TheGameLogic->isInGame() || TheGameLogic->isInShellGame()) syncTime = 0;
- else if (!freezeTime) syncTime = GameEngine_pictureMilliseconds();
- }
- if (!freezeTime && !shadowCaptureClock)
+ if (!freezeTime)
{
//
// This is W3D's clock: every skeletal animation, texture flipbook and W3D-driven effect
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
index 328535726..388c64937 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
@@ -147,8 +147,7 @@ Bool W3DView::drawsDrawables( void )
logic, and W3DDisplay::draw loops until the pan is done. */
static Bool onPictureClock( View *view )
{
- return (GameEngine_isVideoFrame() || GameEngine_isShadowCaptureClock())
- && !( view->isTimeFrozen() && !view->isCameraMovementFinished() );
+ return GameEngine_isVideoFrame() && !( view->isTimeFrozen() && !view->isCameraMovementFinished() );
}
static UnsignedInt cameraClockMilliseconds( View *view )
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp
index 98cf4bb54..5079216aa 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp
@@ -54,7 +54,6 @@
#include "GameClient/Water.h"
#include "GameLogic/TerrainLogic.h"
#include "Common/GlobalData.h"
-#include "Common/GameEngine.h"
#include "Common/UnicodeString.h"
#include "Common/file.h"
#include "Common/FileSystem.h"
@@ -911,15 +910,6 @@ void WaterTracksRenderSystem::update()
carryMs += elapsedMs;
Int timeDiff = (Int)carryMs;
carryMs -= (Real)timeDiff;
- if (GameEngine_isShadowCaptureClock()) {
- // Screenshot comparisons must hold authored shoreline waves at the same
- // phase too. Repeated renders of the same logic frame advance nothing.
- static UnsignedInt lastPictureMs = 0;
- const UnsignedInt pictureMs = GameEngine_pictureMilliseconds();
- timeDiff = pictureMs >= lastPictureMs ? (Int)(pictureMs-lastPictureMs) : 0;
- lastPictureMs = pictureMs;
- carryMs = 0;
- }
//first update all the tracks
while( mod )
diff --git a/GeneralsMD/Code/Libraries/Include/Platform/SunShadowMode.h b/GeneralsMD/Code/Libraries/Include/Platform/SunShadowMode.h
deleted file mode 100644
index 818fa7ffa..000000000
--- a/GeneralsMD/Code/Libraries/Include/Platform/SunShadowMode.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Sun-depth selection. Normal launches use maps; diagnostic overrides retain legacy/capture modes.
-// This never selects dynamic lighting.
-#pragma once
-
-#include <cstdlib>
-#include <cstring>
-
-namespace SunShadow {
-enum class Mode { Legacy, CaptureOnly, Mapped };
-
-inline Mode ParseMode(const char *text, Mode defaultMode)
-{
- if (!text || !*text) return defaultMode;
- if (std::strcmp(text, "capture-only") == 0) return Mode::CaptureOnly;
- if (std::strcmp(text, "mapped") == 0) return Mode::Mapped;
- // Unknown values retain the conservative legacy fallback.
- return Mode::Legacy;
-}
-
-inline Mode RequestedMode()
-{
- const Mode defaultMode = Mode::Mapped;
-#if defined(__linux__)
- return ParseMode(std::getenv("ZH_SUN_SHADOW_MODE"), defaultMode);
-#else
- return defaultMode;
-#endif
-}
-
-inline const char *ModeName(Mode mode)
-{
- switch (mode) {
- case Mode::CaptureOnly: return "capture-only";
- case Mode::Mapped: return "mapped";
- default: return "legacy";
- }
-}
-}
diff --git a/GeneralsMD/Code/Tests/test_posix_draw_resolve.cpp b/GeneralsMD/Code/Tests/test_posix_draw_resolve.cpp
index a9ef03b27..5eba9eb6c 100644
--- a/GeneralsMD/Code/Tests/test_posix_draw_resolve.cpp
+++ b/GeneralsMD/Code/Tests/test_posix_draw_resolve.cpp
@@ -39,7 +39,6 @@
#include "SdlConstants.h"
#include "ffshader.h"
#include "ffvertex.h"
-#include "Platform/SunShadowMode.h"
#include <math.h>
#include <stdio.h>
@@ -291,34 +290,6 @@ static void check_constants(PosixDevice9 *device)
int main()
{
- using SunShadow::Mode;
- CHECK(SunShadow::ParseMode(NULL, Mode::Legacy) == Mode::Legacy);
- CHECK(SunShadow::ParseMode("", Mode::Mapped) == Mode::Mapped);
- CHECK(SunShadow::ParseMode("legacy", Mode::Mapped) == Mode::Legacy);
- CHECK(SunShadow::ParseMode("capture-only", Mode::Legacy) == Mode::CaptureOnly);
- CHECK(SunShadow::ParseMode("mapped", Mode::Legacy) == Mode::Mapped);
- CHECK(SunShadow::ParseMode("mappde", Mode::Mapped) == Mode::Legacy);
- const char *savedMode = getenv("ZH_SUN_SHADOW_MODE");
- const bool hadMode = savedMode != NULL;
- const std::string savedModeText = savedMode ? savedMode : "";
- unsetenv("ZH_SUN_SHADOW_MODE");
- CHECK(SunShadow::RequestedMode() == Mode::Mapped);
- setenv("ZH_SUN_SHADOW_MODE", "mapped", 1);
- CHECK(SunShadow::RequestedMode() == Mode::Mapped);
- setenv("ZH_SUN_SHADOW_MODE", "capture-only", 1);
-#if defined(__linux__)
- CHECK(SunShadow::RequestedMode() == Mode::CaptureOnly);
-#else
- CHECK(SunShadow::RequestedMode() == Mode::Mapped);
-#endif
- setenv("ZH_SUN_SHADOW_MODE", "legacy", 1);
-#if defined(__linux__)
- CHECK(SunShadow::RequestedMode() == Mode::Legacy);
-#else
- CHECK(SunShadow::RequestedMode() == Mode::Mapped);
-#endif
- if (hadMode) setenv("ZH_SUN_SHADOW_MODE", savedModeText.c_str(), 1);
- else unsetenv("ZH_SUN_SHADOW_MODE");
IDirect3D9 *d3d = NULL;
PosixDevice9 *device = make_device(d3d);
CHECK(device != NULL);
diff --git a/GeneralsMD/Code/Tests/test_posix_gpu_draw.cpp b/GeneralsMD/Code/Tests/test_posix_gpu_draw.cpp
index 3e9ac3b0f..1f9dcd1c0 100644
--- a/GeneralsMD/Code/Tests/test_posix_gpu_draw.cpp
+++ b/GeneralsMD/Code/Tests/test_posix_gpu_draw.cpp
@@ -39,6 +39,7 @@
#include "PosixDevice9.h"
#include "SdlGpuFrame.h"
#include "SdlResourceMirror.h"
+#include "SdlSunShadowDebug.h"
#include "Platform/SunShadow.h"
#include "Platform/SunSmoke.h"
#include "../Libraries/Source/WWVegas/WW3D2/ffshader.h"
@@ -625,10 +626,6 @@ static void check_sun_capture(PosixDevice9 *device)
// at z=.75, and a translated/scaled scene camera with a nonzero viewport origin.
static void check_sun_receivers(PosixDevice9 *device)
{
- const char *oldMode = getenv("ZH_SUN_SHADOW_MODE");
- const std::string savedMode = oldMode ? oldMode : "";
- const bool hadMode = oldMode != NULL;
- setenv("ZH_SUN_SHADOW_MODE","mapped",1);
{
SunShadow::SceneScope mainScene(device,true);
D3DMATRIX identity = {}; identity._11=identity._22=identity._33=identity._44=1;
@@ -792,10 +789,7 @@ static void check_sun_receivers(PosixDevice9 *device)
device->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_ONE);
draw(); CHECK_PIXEL(10,15,WHITE);
device->SetRenderState(D3DRS_ALPHABLENDENABLE,0);
- // Live selection cannot keep receiving an earlier map after switching modes.
- setenv("ZH_SUN_SHADOW_MODE","capture-only",1);
- CHECK(!SunShadow::ReceivesView(device)); CHECK(!parameters()); draw(); CHECK_PIXEL(10,15,WHITE);
- setenv("ZH_SUN_SHADOW_MODE","mapped",1); CHECK(parameters()); draw(); CHECK(pixels==shadowed);
+ CHECK(parameters()); draw(); CHECK(pixels==shadowed);
// Leave a receiver queued against the old allocation, then replace it. End
// submits both in order; the queued draw must still sample the old blocker.
device->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,BLUE,1,0);
@@ -819,16 +813,13 @@ static void check_sun_receivers(PosixDevice9 *device)
SunShadow::SceneScope nextScene(device,true);
CHECK(!SunShadow::OwnsSceneShadows(device));
}
- if(hadMode) setenv("ZH_SUN_SHADOW_MODE",savedMode.c_str(),1); else unsetenv("ZH_SUN_SHADOW_MODE");
- printf("sun receivers: shared filter, offset/depth-range matrix, exclusions, nested scenes, targets, modes and empty replacement checked\n");
+ printf("sun receivers: shared filter, offset/depth-range matrix, exclusions, nested scenes, targets and empty replacement checked\n");
}
// Analytic two-sphere moments, then the production sampler/constant/camera paths.
static void check_sun_smoke(PosixDevice9 *device)
{
- const char *mode=getenv("ZH_SUN_SHADOW_MODE"); const std::string saved=mode?mode:""; const bool had=mode;
- setenv("ZH_SUN_SHADOW_MODE","mapped",1);
D3DMATRIX identity={}; identity._11=identity._22=identity._33=identity._44=1;
const float casters[]={0,0,.25f,.5f,1, 0,0,.75f,.5f,2};
auto *gpu=device->Get_Gpu();
@@ -958,7 +949,6 @@ static void check_sun_smoke(PosixDevice9 *device)
device->DrawPrimitiveUP(D3DPT_TRIANGLELIST,2,v,sizeof(ScreenVertex));CHECK(SunShadow::End(device));
std::vector<float> depth;CHECK(device->Read_Sun_Shadow(depth));for(float z:depth) CHECK(z<1);
}
- if(had)setenv("ZH_SUN_SHADOW_MODE",saved.c_str(),1);else unsetenv("ZH_SUN_SHADOW_MODE");
printf("smoke: moments/front, offset/depth-range reconstruction, queued refill, alpha particles, fire glow, exclusions, empty map and cloak coverage checked\n");
}
@@ -966,9 +956,6 @@ static void check_sun_smoke(PosixDevice9 *device)
// actual displaced alpha silhouette, then receive sunlight through that same program.
static void check_sun_trees(PosixDevice9 *device)
{
- const char *mode=getenv("ZH_SUN_SHADOW_MODE");
- const bool hadMode=mode!=nullptr;const std::string savedMode=mode?mode:"";
- setenv("ZH_SUN_SHADOW_MODE","mapped",1);
{
SunShadow::SceneScope scene(device,true);
D3DMATRIX identity={};identity._11=identity._22=identity._33=identity._44=1;
@@ -1026,16 +1013,11 @@ static void check_sun_trees(PosixDevice9 *device)
device->SetRenderState(D3DRS_ALPHATESTENABLE,0);
device->SetRenderState(D3DRS_CULLMODE,D3DCULL_CCW);
}
- if(hadMode) setenv("ZH_SUN_SHADOW_MODE",savedMode.c_str(),1);else unsetenv("ZH_SUN_SHADOW_MODE");
printf("sun trees: displaced alpha silhouette, transparent gaps and receiving checked\n");
}
static void check_sun_reset(PosixDevice9 *device)
{
- const char *oldMode=getenv("ZH_SUN_SHADOW_MODE");
- const std::string savedMode=oldMode ? oldMode : "";
- const bool hadMode=oldMode!=NULL;
- setenv("ZH_SUN_SHADOW_MODE","mapped",1);
begin(device,BLUE);
CHECK(SunShadow::Begin(device,32)); CHECK(SunShadow::End(device));
CHECK(SunShadow::Parameters(device,0,.5f,0,0,0,1,0));
@@ -1063,7 +1045,6 @@ static void check_sun_reset(PosixDevice9 *device)
CHECK(resizedPixels[i]==0 && resizedPixels[i+1]==255 && resizedPixels[i+2]==0 && resizedPixels[i+3]==255);
CHECK(device->Reset(&original)==D3D_OK);
CHECK(!SunShadow::OwnsSceneShadows(device));
- if(hadMode) setenv("ZH_SUN_SHADOW_MODE",savedMode.c_str(),1); else unsetenv("ZH_SUN_SHADOW_MODE");
printf("sun reset: pending work drained, stale capture invalidated, resized capture and scene verified\n");
}
@@ -1093,10 +1074,7 @@ static PosixDevice9 *sun_fault_device(IDirect3D9 *adapter)
static void check_sun_failures(IDirect3D9 *adapter)
{
- const char *oldMode=getenv("ZH_SUN_SHADOW_MODE"),*oldFault=getenv("ZH_TEST_SUN_SHADOW_FAILURE");
- const std::string savedMode=oldMode ? oldMode : "",savedFault=oldFault ? oldFault : "";
- const bool hadMode=oldMode!=NULL,hadFault=oldFault!=NULL;
- setenv("ZH_SUN_SHADOW_MODE","mapped",1);unsetenv("ZH_TEST_SUN_SHADOW_FAILURE");
+ Sdl_Sun_Shadow_Fault_Point() = nullptr;
struct V {float x,y,z;uint32_t color;};
const V caster[]={{-1,1,.25f,WHITE},{1,1,.25f,WHITE},{-1,-1,.25f,WHITE},
{1,1,.25f,WHITE},{1,-1,.25f,WHITE},{-1,-1,.25f,WHITE}};
@@ -1112,13 +1090,13 @@ static void check_sun_failures(IDirect3D9 *adapter)
CHECK(smokeDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST,2,caster,sizeof(V))==D3D_OK);
CHECK(SunShadow::End(smokeDevice));
const float cloud[]={0,0,.5f,.5f,2};
- setenv("ZH_TEST_SUN_SHADOW_FAILURE",fault,1);
+ Sdl_Sun_Shadow_Fault_Point() = fault;
CHECK(!SunShadow::FillSmoke(smokeDevice,cloud,1,.6f));
CHECK(!smokeDevice->Get_Gpu()->Sun_Smoke_Texture());
CHECK(parameters(smokeDevice));CHECK(SunShadow::OwnsSceneShadows(smokeDevice));
smokeDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST,2,left,sizeof(V));
read_back(smokeDevice);CHECK_PIXEL(8,16,0xFF808080); // core depth map still works
- unsetenv("ZH_TEST_SUN_SHADOW_FAILURE");
+ Sdl_Sun_Shadow_Fault_Point() = nullptr;
CHECK(!SunShadow::FillSmoke(smokeDevice,cloud,1,.6f)); // bounded refusal, no per-frame retry spam
CHECK(!SunShadow::FillSmoke(smokeDevice,nullptr,0,0));
}
@@ -1142,7 +1120,7 @@ static void check_sun_failures(IDirect3D9 *adapter)
device->SetRenderState(D3DRS_ALPHAREF,8);
CHECK(parameters(device)); // changing parameters cannot forget earlier draws
}
- setenv("ZH_TEST_SUN_SHADOW_FAILURE",fault,1);
+ Sdl_Sun_Shadow_Fault_Point() = fault;
const unsigned recorded=device->Draws_Recorded();
CHECK(device->DrawPrimitiveUP(D3DPT_TRIANGLELIST,2,right,sizeof(V))==D3D_OK);
CHECK(device->Draws_Recorded()==recorded+1);CHECK(device->Draw_Refusals().empty());
@@ -1150,8 +1128,8 @@ static void check_sun_failures(IDirect3D9 *adapter)
CHECK_PIXEL(8,16,late ? 0xFF808080 : BLUE);
CHECK(!SunShadow::ReceivesView(device));CHECK(SunShadow::OwnsSceneShadows(device)==late);
CHECK(!parameters(device));CHECK(SunShadow::OwnsSceneShadows(device)==late);
- unsetenv("ZH_TEST_SUN_SHADOW_FAILURE");
- // The failure latch, not the injection environment, now selects ordinary draws.
+ Sdl_Sun_Shadow_Fault_Point() = nullptr;
+ // The failure latch now selects ordinary draws after clearing the fault point.
CHECK(device->DrawPrimitiveUP(D3DPT_TRIANGLELIST,2,left,sizeof(V))==D3D_OK);
read_back(device);CHECK_PIXEL(8,16,WHITE);CHECK_PIXEL(24,16,WHITE);
}
@@ -1166,9 +1144,6 @@ static void check_sun_failures(IDirect3D9 *adapter)
}
D3DPRESENT_PARAMETERS reset=device->Get_Present_Parameters();CHECK(device->Reset(&reset)==D3D_OK);
CHECK(!SunShadow::Begin(device,32)); // Reset retains the refused program/pipeline cache
- setenv("ZH_SUN_SHADOW_MODE","capture-only",1);
- CHECK(SunShadow::Begin(device,32));CHECK(SunShadow::End(device));CHECK(!parameters(device));
- setenv("ZH_SUN_SHADOW_MODE","mapped",1);
CHECK(!SunShadow::Begin(device,32));
device->Release(); // the next case recreates the device and can receive again
printf("sun fault %s %s: geometry retained, submitted pixels preserved, ownership and next-scene latch checked\n",
@@ -1178,21 +1153,21 @@ static void check_sun_failures(IDirect3D9 *adapter)
if(device) {
{
SunShadow::SceneScope scene(device,true);
- setenv("ZH_TEST_SUN_SHADOW_FAILURE","target",1);
+ Sdl_Sun_Shadow_Fault_Point() = "target";
CHECK(!SunShadow::Begin(device,32));CHECK(!parameters(device));
CHECK(!SunShadow::OwnsSceneShadows(device));
CHECK(device->DrawPrimitiveUP(D3DPT_TRIANGLELIST,2,right,sizeof(V))==D3D_OK);
read_back(device);CHECK_PIXEL(24,16,WHITE);
- unsetenv("ZH_TEST_SUN_SHADOW_FAILURE");
+ Sdl_Sun_Shadow_Fault_Point() = nullptr;
CHECK(SunShadow::Begin(device,32));
CHECK(device->DrawPrimitiveUP(D3DPT_TRIANGLELIST,2,caster,sizeof(V))==D3D_OK);
CHECK(SunShadow::End(device));CHECK(parameters(device));
CHECK(device->DrawPrimitiveUP(D3DPT_TRIANGLELIST,2,left,sizeof(V))==D3D_OK);
- setenv("ZH_TEST_SUN_SHADOW_FAILURE","target",1);
+ Sdl_Sun_Shadow_Fault_Point() = "target";
CHECK(!SunShadow::Begin(device,64));CHECK(!parameters(device));
CHECK(!SunShadow::OwnsSceneShadows(device));
read_back(device);CHECK_PIXEL(8,16,0xFF808080);CHECK_PIXEL(24,16,WHITE);
- unsetenv("ZH_TEST_SUN_SHADOW_FAILURE");
+ Sdl_Sun_Shadow_Fault_Point() = nullptr;
CHECK(SunShadow::Begin(device,64));CHECK(SunShadow::End(device));CHECK(parameters(device));
std::vector<float> depth;CHECK(device->Read_Sun_Shadow(depth));CHECK(depth.size()==64*64);
for(float value:depth) CHECK(value==1.0f);
@@ -1202,8 +1177,7 @@ static void check_sun_failures(IDirect3D9 *adapter)
device->Release();
printf("sun allocation fault: first allocation and replacement refused, queued old reader retained, recovery and empty clear checked\n");
}
- if(hadMode) setenv("ZH_SUN_SHADOW_MODE",savedMode.c_str(),1);else unsetenv("ZH_SUN_SHADOW_MODE");
- if(hadFault) setenv("ZH_TEST_SUN_SHADOW_FAILURE",savedFault.c_str(),1);else unsetenv("ZH_TEST_SUN_SHADOW_FAILURE");
+ Sdl_Sun_Shadow_Fault_Point() = nullptr;
}
#endif
diff --git a/GeneralsMD/Code/Tests/test_sun_shadow_sorting.cpp b/GeneralsMD/Code/Tests/test_sun_shadow_sorting.cpp
index 22b431933..2e75762fd 100644
--- a/GeneralsMD/Code/Tests/test_sun_shadow_sorting.cpp
+++ b/GeneralsMD/Code/Tests/test_sun_shadow_sorting.cpp
@@ -16,7 +16,6 @@
#include "wwmath.h"
#include <SDL3/SDL.h>
#include <cstdio>
-#include <cstdlib>
#include <vector>
const Char *g_strFile = "data\\Generals.str";
@@ -110,7 +109,6 @@ static void check_sorted_coverage(PosixDevice9 *device, bool reverse)
int main()
{
- setenv("ZH_SUN_SHADOW_MODE", "mapped", 1);
if (!SDL_Init(SDL_INIT_VIDEO)) return 77;
SDL_SetHint("ZH_OFFSCREEN_FRAMES", "1");
SDL_SetHint("ZH_OFFSCREEN_HZ", "0");
diff --git a/GeneralsMD/Code/Tools/sun-shadow-check.py b/GeneralsMD/Code/Tools/sun-shadow-check.py
index 6f52eedda..2a3372a02 100644
--- a/GeneralsMD/Code/Tools/sun-shadow-check.py
+++ b/GeneralsMD/Code/Tools/sun-shadow-check.py
@@ -63,7 +63,6 @@ def main():
for name in ("generals", "root", "overlay", "out"):
p.add_argument("--" + name, type=Path, required=True)
p.add_argument("--case", choices=CASES, default="solid")
- p.add_argument("--mode", choices=("default", "legacy", "capture-only", "mapped"), default="default")
p.add_argument("--quality", type=int, choices=(0, 1, 2), default=1, help="existing shadow quality: 1024/2048/4096")
p.add_argument("--trees", choices=("yes", "no"), default="yes", help="ShowTrees preference; multiplayer can still load trees")
p.add_argument("--geometry-shadows", choices=("yes", "no"), default="yes", help="set both ordinary shadow options")
@@ -74,18 +73,13 @@ def main():
p.add_argument("--frame", type=int, help="override the case's screenshot frame (also the measurement length minus 60)")
p.add_argument("--replay", type=Path, help="play an existing recording in isolated user data instead of starting a match")
p.add_argument("--measure", action="store_true", help="omit the screenshot and its settling/pacing window")
- p.add_argument("--logic-clock", action="store_true", help="use a fixed W3D animation/cloud clock for screenshot comparisons")
p.add_argument("--report", action="store_true", help="read back sun depth occupancy (excluded from performance runs)")
- p.add_argument("--depth-dump", action="store_true", help="save the latest reported map as a 16-bit PGM; requires --report")
- p.add_argument("--fault", choices=("target", "receiver-program", "receiver-pipeline", "smoke-target", "smoke-pipeline"), help="inject a sun-specific creation failure")
args = p.parse_args()
- if args.depth_dump and not args.report:
- p.error("--depth-dump requires --report")
- if (args.report or args.logic_clock or args.gpu_debug or args.fault) and args.measure:
- p.error("diagnostic readback/clocks/validation cannot be used with --measure")
+ if (args.report or args.gpu_debug) and args.measure:
+ p.error("diagnostic readback/validation cannot be used with --measure")
replay = args.replay.resolve() if args.replay else None
- if replay and (not replay.is_file() or args.logic_clock or CASES[args.case][4]):
- p.error("--replay requires an existing file, an ordinary clock and a case without scenario actions")
+ if replay and (not replay.is_file() or CASES[args.case][4]):
+ p.error("--replay requires an existing file and a case without scenario actions")
exe, root, overlay, out = (getattr(args, n).resolve() for n in ("generals", "root", "overlay", "out"))
if not exe.is_file() or not root.is_dir() or not overlay.is_dir():
p.error("executable, prepared root and overlay must already exist")
@@ -148,23 +142,14 @@ def main():
command += ["-takeover", "-scenario", scenario]
overrides = {"ZH_USER_DATA_DIR": str(user), "ZH_UNATTENDED": "1",
"ZH_AUDIO_BACKEND": "null", "SDL_GPU_DRIVER": "vulkan",
- "ZH_OFFSCREEN_HZ": "0",
- "ZH_SUN_SHADOW_MODE": args.mode, "ZH_GPU_TIMING": "0,1000000"}
- if args.mode == "default":
- overrides.pop("ZH_SUN_SHADOW_MODE")
+ "ZH_OFFSCREEN_HZ": "0", "ZH_GPU_TIMING": "0,1000000"}
if args.gpu_debug:
overrides["ZH_GPU_DEBUG"] = "1"
- if args.logic_clock:
- overrides["ZH_SUN_SHADOW_CAPTURE_CLOCK"] = "logic"
- if args.fault:
- overrides["ZH_TEST_SUN_SHADOW_FAILURE"] = args.fault
- if args.depth_dump:
- overrides["ZH_SUN_SHADOW_DEPTH_DUMP"] = str(out / "sun-depth.pgm")
if args.icd:
overrides["VK_DRIVER_FILES"] = str(args.icd.resolve())
repository = Path(__file__).resolve().parents[3]
manifest = {"command": command, "environment": overrides, "case": args.case,
- "mode": args.mode, "quality": args.quality, "exe_sha256": digest(exe),
+ "quality": args.quality, "exe_sha256": digest(exe),
"trees": args.trees, "geometry_shadows": args.geometry_shadows, "smoke_shadows": args.smoke_shadows,
"options_sha256": digest(user / "Options.ini"),
"git_head": subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=repository, text=True).strip(),
@@ -183,11 +168,7 @@ def main():
manifest_path.write_text(json.dumps(manifest, indent=2) + "\n")
environment = dict(os.environ)
# This switch is presence-based in the backend: "0" would still enable it.
- environment.pop("ZH_SUN_SHADOW_MODE", None)
environment.pop("ZH_GPU_DEBUG", None)
- environment.pop("ZH_TEST_SUN_SHADOW_FAILURE", None)
- environment.pop("ZH_SUN_SHADOW_DEPTH_DUMP", None)
- environment.pop("ZH_SUN_SHADOW_CAPTURE_CLOCK", None)
environment.update(overrides)
start = time.monotonic()
with (out / "run.log").open("w") as log:
@@ -220,10 +201,6 @@ def main():
if "PosixDevice9 timing:" in line and "LONG FRAME" not in line]
manifest["shadow_diagnostics"] = [line for line in (out / "run.log").read_text(errors="replace").splitlines()
if line.startswith("SunShadow:")]
- depth_dump = out / "sun-depth.pgm"
- if depth_dump.is_file():
- manifest["depth_dump"] = {"path": str(depth_dump), "sha256": digest(depth_dump),
- "time": "latest report, not necessarily the screenshot frame"}
manifest_path.write_text(json.dumps(manifest, indent=2) + "\n")
print(json.dumps({"manifest": str(manifest_path), "returncode": process.returncode,
"screenshots": len(shots), "elapsed_seconds": manifest["elapsed_seconds"]}))
diff --git a/docs/sdl-sun-shadows.md b/docs/sdl-sun-shadows.md
index 3a9349696..4f7600656 100644
--- a/docs/sdl-sun-shadows.md
+++ b/docs/sdl-sun-shadows.md
@@ -2,7 +2,7 @@
This feature starts directly from `reference/3.1.0` and has no dependency on the
Modern water or volumetric hazard-cloud features. Linux uses mapped sun shadows
-by default through SDL GPU. Windows retains its existing Direct3D 11 shadows;
+through SDL GPU. Windows retains its existing Direct3D 11 shadows;
macOS retains its existing scene shadows. Shadow capability is independent of
per-pixel lighting.
@@ -23,16 +23,8 @@ can cast when the `ShowTrees` preference is off. `VolumetricSmokeShadows`
independently controls smoke projection, including an otherwise empty capture
when ordinary geometry shadows are disabled.
-`ZH_SUN_SHADOW_MODE` is a Linux diagnostic override:
-
-| Value | Result |
-| --- | --- |
-| unset or `mapped` | Capture and receive supported mapped shadows. |
-| `capture-only` | Capture depth while retaining legacy scene shadows. |
-| `legacy` or an unknown value | Skip capture and retain legacy shadows. |
-
-A request does not prove capture succeeded. `-shadowmapreport`, or the harness's
-`--report`, reads back depth occupancy and reports accepted receiver counts.
+`-shadowmapreport`, or the harness's `--report`, reads back depth occupancy and
+reports accepted receiver counts.
Diagnostic readback affects timing.
## State and fallback
@@ -72,13 +64,11 @@ python3 GeneralsMD/Code/Tools/sun-shadow-check.py \
--root /absolute/path/to/prepared-game-root \
--overlay "$PWD/build-linux/overlay" \
--out "$PWD/build-linux/shadow-solid-mapped" \
- --case solid --mode mapped --logic-clock --gpu-debug --report
+ --case solid --gpu-debug --report
```
-For a matched legacy image, retain the executable, case and settings, select
-`--mode legacy` and choose a new output directory. `--logic-clock` fixes
-animation and authored shoreline phases for single-player screenshots. It does
-not admit multiplayer or replay sessions and leaves ordinary launches unchanged.
+Legacy comparisons use Classic graphics. Retain the executable, scene and
+settings when comparing images.
Available cases are `solid`, `smoke`, `cloak`, `trees`, `forest`, `bridge`,
`helicopter`, `water` and `river`. Water cases inspect unchanged legacy water and
@@ -86,10 +76,8 @@ reflection behavior. The harness also accepts `--quality 0|1|2`, `--trees yes|no
`--geometry-shadows yes|no` and `--smoke-shadows yes|no`. Scenario fixtures are
copied into a private overlay only for cases that need them.
-`--fault target|receiver-program|receiver-pipeline|smoke-target|smoke-pipeline`
-requests a specific creation failure. `--depth-dump --report` saves the latest
-reported depth map, which need not be the screenshot frame. `--replay` accepts an
-existing recording for a case without scenario actions or a fixed capture clock.
+`--replay` accepts an existing recording for a case without scenario actions.
+`--frame` sets the case's screenshot frame; the run ends 60 frames later.
`manifest.json` records the command, explicit environment, executable hash,
source SHA/diff, settings and scenario/replay hashes, exit status, limit-frame
@@ -98,8 +86,8 @@ provenance is bound to the harness's source checkout. Inspect images and logs
and compare CRCs; process exit alone does not establish correct visuals.
Use `--measure` for matched timing runs, with the same scene, settings,
-executable and driver. This excludes screenshots, reports, fixed clocks, fault
-injection and GPU validation. The device probe includes loading;
+executable and driver. This excludes screenshots, reports and GPU validation.
+The device probe includes loading;
`HEADLESS FRAMETIME` starts after logic frame 60. These diagnostics are not a
universal steady-state FPS result.
@@ -114,12 +102,11 @@ ctest --test-dir build-linux --output-on-failure \
-R '^(posix_draw_resolve_selfcheck|posix_gpu_draw_selfcheck|sdl_gpu_frame_selfcheck|test_sun_shadow_sorting|test_ffshadercompile)$'
```
-Focused fixtures cover mode parsing, analytic translated-camera receivers,
+Focused fixtures cover analytic translated-camera receivers,
smoke moments, tree silhouettes, sorted cloak coverage, state restoration,
queued resource replacement, empty clears, reset and injected creation failures.
The sun-target frame test retains the baseline gamma and clear checks. Runtime
-sun fixtures are Linux-only; portable parser expectations remain checked on
-other platforms. GPU tests skip when no usable device is available.
+sun fixtures are Linux-only. GPU tests skip when no usable device is available.
Real-game scenes and replay comparisons complement these fixtures. No old
stacked-branch result establishes this independent branch's validation. Record