Skip to content

Zero Hour engine — macOS (Apple Silicon) engine-v0.1.6

Choose a tag to compare

@github-actions github-actions released this 06 Jul 14:40

Native macOS arm64 build of the Command & Conquer: Generals — Zero Hour engine.

Fixed — menu/scene flicker (2560×1440 @ 60/120 fps)

Rare single-frame artifacts on the CWC shell-map menu (and any scene that re-uploads dynamic resources):

  • Black rectangular tiles in the terrain (props still drawn on top).
  • Torn "texture lines" where UVs overlaid incorrectly.

Both were CPU-vs-in-flight-GPU data races in the DX8→Metal shim, fixed with D3D-style resource rename (shim-only — no engine changes):

  1. Texture re-uploads no longer replaceRegion in place while the previous frame's command buffer may still sample the texture. Each re-upload swaps in a fresh pooled MTLTexture; the old one serves in-flight frames and is recycled once the GPU finishes them. Free pool capped at 256/bucket.
  2. Plain VB/IB Lock(flags=0) (W3D WriteLockClass/AppendLockClass when re-filling static buffers, e.g. terrain tiles on camera move) no longer writes into the live shared MTLBuffer. It renames to a pooled buffer and copies old contents, preserving read-modify-write without stalling. DISCARD orphaning and NOOVERWRITE behavior unchanged.

No graphics / effects / quality removed — rendering output is identical; only the destination of CPU writes to reused resources changed. Verified frame-by-frame by the user: both artifact types gone.

Env switches: MTL_NO_TEX_RENAME=1 reverts texture rename (A/B); MTL_RENAME_LOG=1 logs rename counts + pool stats.


The GeneralsZH Launcher downloads this engine automatically. You must own a legitimate copy of Zero Hour — EA game data is not included. Apple Silicon (M-series) only. Checksums in SHA256SUMS.