Skip to content

fix(render): Restore windowed fullscreen to prevent device loss - #545

Closed
sailro wants to merge 1 commit into
GeneralsOnlineDevelopmentTeam:mainfrom
sailro:fix/windowed-fullscreen-device-loss
Closed

fix(render): Restore windowed fullscreen to prevent device loss#545
sailro wants to merge 1 commit into
GeneralsOnlineDevelopmentTeam:mainfrom
sailro:fix/windowed-fullscreen-device-loss

Conversation

@sailro

@sailro sailro commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Restore the existing GENERALS_ONLINE_WINDOWED_FULLSCREEN path so the game keeps a fullscreen appearance while using a windowed Direct3D device.

Problem

On Windows 11 with an NVIDIA GPU, true exclusive fullscreen can enter a prolonged D3DERR_DEVICELOST state shortly after startup while the game is foreground and not minimized.

Measured behavior on current GeneralsOnline main:

  • Configured limit: 60 FPS
  • Fault: roughly 4-8 FPS for ~45-50 seconds
  • DX8Wrapper::IsDeviceLost = true
  • DX8Wrapper::FrameCount = 0
  • Automatic recovery afterward

The same source issue reproduces on clean current TheSuperHackers main and is tracked upstream here:

A/B results

Configuration Result
GeneralsOnline latest main, exclusive fullscreen Reproduces
Executable launched directly (without launcher) Reproduces
-nologo Reproduces
-nologo -noshellmap Reproduces
-win Stable, no device loss
GENERALS_ONLINE_WINDOWED_FULLSCREEN Stable 60 FPS, no device loss or resets

The validated borderless build ran through the full historical failure interval with a continuously advancing frame counter and IsDeviceLost = false.

Context

GeneralsOnline originally enabled this path in 09c061a53 ("stop using FSE") and later switched back to exclusive fullscreen in 8c257240c. The implementation already exists in WinMain.cpp and dx8wrapper.cpp; this change only re-enables its feature flag.

Related upstream work:

Validation

  • Release build: z_generals
  • Normal GeneralsOnline launcher
  • 2560x1440 at 239 Hz
  • Windows 11 build 26200
  • NVIDIA RTX 4090, drivers 610.74 and 610.88

AI disclosure

Investigated and implemented with GitHub Copilot CLI. The device state, frame counter, configured frame limit, focus state, and FPS were measured directly from the running process without debugger attachment during the final A/B tests.

Exclusive fullscreen can remain in D3DERR_DEVICELOST for roughly 45
seconds after startup on Windows 11 with NVIDIA GPUs. During that time,
DX8Wrapper::End_Scene sleeps for 200 ms per frame and rendering drops to
about 5 FPS.

Restore the existing GeneralsOnline windowed-fullscreen path. It keeps the
fullscreen appearance while creating a windowed D3D device, which avoids
the lost-device state and remains stable at the configured frame rate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6fc47f85-1023-4457-9df0-8e97163e72f0
@sailro sailro closed this Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant