God of War

White specks on characters in dim light: an EQUAL depth test after a prepass, which the translated shaders do not match bit for bit. The fix removes them but draws nearby grass and branches as solid shapes in some scenes; DXMT's d3d11.defuseFma with no fix draws nothing wrong but leaves the specks (2026-10-26).

GPL-3.0-or-laterThis fix in MacGameFix

What you see

White specks all over the characters, Kratos first, in dim light

Why it happens

The G-buffer pass tests depth with EQUAL against a depth prepass, and the translated shaders do not reproduce the prepass depth to the last bit

What the fix changes

That depth test is created as GREATER_EQUAL

The code

Every depth state that tests EQUAL is created with the replacement test read from gow-depth-fix.ini, which removes the white specks.

fixes/gow-depth-fix.c ยท hk_CreateDepthStencilState, lines 158โ€“177
c
static HRESULT STDMETHODCALLTYPE hk_CreateDepthStencilState(ID3D11Device *device,
        const D3D11_DEPTH_STENCIL_DESC *desc, ID3D11DepthStencilState **state)
{
    HRESULT (STDMETHODCALLTYPE *orig)(ID3D11Device *, const D3D11_DEPTH_STENCIL_DESC *, ID3D11DepthStencilState **)
            = orig_fn(device, DEV_IDX(CreateDepthStencilState));
    D3D11_DEPTH_STENCIL_DESC changed;

    if (!desc || !desc->DepthEnable || desc->DepthFunc != D3D11_COMPARISON_EQUAL)
        return orig(device, desc, state);
    if (InterlockedIncrement(&g_equal_seen) <= 16)
        log_msg("EQUAL depth state: depth writes %s, stencil %s%s",
                desc->DepthWriteMask == D3D11_DEPTH_WRITE_MASK_ALL ? "on" : "off",
                desc->StencilEnable ? "on" : "off", g_equal_to ? ", created with the replacement test" : "");
    if (!g_equal_to)
        return orig(device, desc, state);
    changed = *desc;
    changed.DepthFunc = g_equal_to;
    InterlockedIncrement(&g_changed);
    return orig(device, &changed, state);
}

Thanks to

  • The author of "God Of War 2018 White Dot Fix (through Crossover)" on r/macgamingFound the depth test behind the white specks.

Details

Needs
DXMT, D3D11
Installer
install-gow-fix.sh
Executable
GoW.exe
Built from
gow-depth-fix.c
Verified on
Preview 27, through NotProton, under Rosetta and under FEX

The full story, with the measurements and the wrong turns