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>
The vertex shader stores depth as z / 65536, so reading it back with 65535
came out one too low whenever z's fraction was below z / 65536. Both the CPU
conversion and the shader path (used on GLES and at higher render
resolutions) had it. The shader also ran at the fragment shader's default
lowp, which mobile GPUs honor; 24 bits of depth need highp, sampler included
on GLES.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Put the anisotropy level in the sampler key, so changing it applies on
Vulkan and D3D11.
- Release CLUT textures at shutdown on GLES and D3D11.
- Fix the depth readback viewport, which squeezed the image whenever the
read rectangle was smaller than the fbo.
- Test the computed depth, not the unset result, in the equal-depth clear
check.
- Don't read back a CLUT from a framebuffer without an fbo.
- Tolerate null entries when releasing post-shader objects and CLUT
textures after a failed creation.
- ImGe: Don't crash on a framebuffer without an fbo, or on GetVFB under the
software renderer.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Rename LogType to Log
* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.
* Mac/ARM64 buildfix
* Do the same with the hle result log macros
* Rename the log names to mixed case while at it.
* iOS buildfix
* Qt buildfix attempt, ARM32 buildfix