Skip to content

Metal: Preserve reversed depth ranges after viewport updates - #110

Open
andyfangdz wants to merge 1 commit into
google:mainfrom
andyfangdz:codex/metal-reversed-depth-viewport
Open

andyfangdz wants to merge 1 commit into
google:mainfrom
andyfangdz:codex/metal-reversed-depth-viewport

Conversation

@andyfangdz

@andyfangdz andyfangdz commented Oct 27, 2026 •

Copy link
Copy Markdown

Upstream review: Gerrit 8663444 · Issue 578080497

Viewport and framebuffer updates can reverse depth ordering when the GL depth range is unchanged. Reuse updateDepthRange when rebuilding the Metal viewport.

Regression tests cover viewport-only state changes, framebuffer switches/resizing, and GLES 1 fixed-point ranges.

Validated on Apple M4 with Metal API Validation enabled: 28 Metal tests pass. All 9 regression cases fail without the fix, including the isolated viewport-change tests in GLES 1/2/3.

Before/after framebuffer screenshots:

before-after

@andyfangdz
andyfangdz force-pushed the codex/metal-reversed-depth-viewport branch 4 times, most recently from 4433679 to e168416 Compare October 27, 2026 16:06
Reapply depth-range normalization after rebuilding the Metal viewport.
Otherwise viewport or framebuffer changes restore reversed endpoints
while shader depth inversion remains active.

Add GLES 1/2/3 regression coverage for viewport changes, framebuffer
switches, attachment resizing, and fixed-point depth ranges. Isolate
viewport-only changes between draws and probe near a known depth value.

Test: angle_end2end_tests (28 Metal cases pass)
Test: All 9 regression cases fail without the renderer fix
Bug: angleproject:578080497
Change-Id: I3f63a8615191ee9bb7d4ca92eb2f9afef1ebe5dc
@andyfangdz
andyfangdz force-pushed the codex/metal-reversed-depth-viewport branch from e168416 to 317b0d8 Compare October 27, 2026 16:07
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