Files
Henrik RydgårdandClaude Opus 5.5 62860a189a OpenGL: Use 0..W clip-space depth without clip control too
Without clip control, OpenGL maps clip z -w..w to window depth 0..1, and the
PSP's Z 0 at z/w = -1 isn't reproduced exactly by the rasterizer (see the
previous commit). Now clip z is 0..w everywhere, which without clip control
lands in window depth 0.5..1. Z 0 is z/w = 0, exact.

Everything that writes or reads window depth directly uses 0.5 + 0.5 * depth
(ShaderLanguageDesc::depthHalfRange, DepthToWindow / DepthFromWindow): depth
clears, fragment depth writes, depth uploads, depth readbacks (including the
debugger's) and depal from depth.

Hardware clipping now only happens below -w, so a clip plane at Z 0 takes
over unless depth clamp is on, which ShaderManagerGLES passes as a min Z of
-1. The hardware clamp works in window depth and can't clamp at 0.5, so
clamping moves to the fragment shader. That shader wrote Z / 65535 against
Z / 65536 for every other draw, which broke depth ties with them; it now
writes Z / 65536.

Fixes the Burnout Dominator lens flare on macOS OpenGL. 0.5..1 costs a bit
of depth precision, which shows on a float depth buffer (ATV Offroad Fury Pro
is 6% worse here), less so on D24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:00:07 +02:00
..
2026-09-21 12:21:19 -06:00
…
2025-08-31 13:37:43 +02:00
…
2026-01-30 14:10:32 +01:00
2026-09-28 17:05:44 -06:00
2026-09-28 17:05:44 -06:00
2026-03-30 11:34:19 -06:00
2026-08-24 09:30:44 +02:00
…
2026-05-16 10:40:08 +02:00
…
2026-07-27 18:37:28 +02:00