Skip to content

CI dry run: test(compositor): share the D3D11 render-test harness - #1

Closed
quotentiroler wants to merge 1 commit into
mainfrom
test/compositor-shared-render-harness
Closed

quotentiroler wants to merge 1 commit into
mainfrom
test/compositor-shared-render-harness

Conversation

@quotentiroler

Copy link
Copy Markdown
Owner

Fork-internal PR to run upstream CI before proposing the change to getopenscreen/openscreen.

Five Windows render tests each carried their own copy of the same setup:
an identical `gpu()` probe, and a synthetic NV12 source frame (FakeFrame,
MockFrame, GridFrame, Source) whose texture creation, map/unmap and
AVFrame wrapping were the same ~40 lines around a different pixel fill.
Four tests also carried the same `write_ppm`.

tests/common/ now holds them once:

- `gpu()`, unchanged.
- `Nv12Frame::new(gpu, size, luma, chroma)`: `luma(col, row)` fills the
  Y plane, `chroma(bx, by)` returns `[Cb, Cr]` for each 2x2 block. Each
  test keeps its own fill as a small builder next to its existing doc
  comment (`fake_frame`, `mock_frame`, `grid_frame`, `source`).
- `write_ppm`, unchanged, with the doc comment it had in
  output_geometry_golden.

The D3D pieces sit behind `#[cfg(windows)]`, so output_geometry_golden,
which also runs on macOS, only pulls in `write_ppm`.

The textures are byte-for-byte what the old loops wrote. The old
constant-chroma loops wrote every column of the UV plane alternating
U/V, which equals one write per 2x2 block because every source size
these tests use is even (NV12 requires it, and the aspect-ratio cases
already round with `& !1`).

No test logic, assertion or threshold changes.
@quotentiroler

Copy link
Copy Markdown
Owner Author

Dry run done; proposed upstream as getopenscreen#933.

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