Skip to content

tests/test_canvas: a picture's sampling and over, held pixel by pixel - #1106

Merged
paul-hammant merged 1 commit into
mainfrom
test/canvas-sampling-blending-pr
Nov 27, 2026
Merged

paul-hammant merged 1 commit into
mainfrom
test/canvas-sampling-blending-pr

Conversation

@paul-hammant

Copy link
Copy Markdown
Collaborator

The suite #1105 said was missing: what engine_texture_new and over promise, asserted on OpenGL and on Vulkan, offscreen through the renderer-level canvas calls, the canvas over the whole 128 x 128 frame and every expected pixel worked out in the test, not by a renderer.

  • A picture's sampling: a 4 x 4 picture on a card whose uv runs 0 to 2. All 16,384 pixels must be exactly their texel: nearest, repeating, the bytes through no colour curve, top row first.
  • over: six cards in order, seven bands checked to 2/255. A draw without over is written as it is; one with it is srca + dst(1-a), in the order queued. A card behind everything doesn't show, and a see-through card behind one drawn before it doesn't either, since the earlier one wrote depth.

Its pairs are tests/lib/canvascard; their SPIR-V (tests/lib/canvascard_spirv, made with glslang 16.6.0) is generated by tools/canvas_test_spirv.ae. Added to ci.sh's GPU_SUITES after test_batching; a paragraph under "Checked by" in docs/canvas.md; a change fragment.

Proven to catch what it is for: nine broken renderers each fail it (GL linear, GL clamp, GL sRGB, GL over off; VK linear, VK clamp, VK sRGB, VK over off, VK over writing no depth).

Run:

  • macOS (M-series), ae 0.946.0: 28/28 at 0/255, and the Vulkan validation layer with sync validation reports nothing.
  • x86_64 Linux lane, ae 0.946.0, llvmpipe: 28/28, no build warnings. The lane's older glslang (11.8) makes different SPIR-V; the test passes with the checked-in copy and with the lane's own.

Not run: Windows, and the full ci.sh.

🤖 Generated with Claude Code

On OpenGL and Vulkan offscreen, the canvas over the whole 128 x 128 frame,
every expected pixel worked out in the test:

- engine_texture_new: a 4 x 4 picture on a card whose uv runs 0 to 2;
  all 16,384 pixels are their texel exactly (nearest, repeating, bytes
  through no colour curve, top row first).
- `over`: six cards, seven bands within 2/255: a draw without `over` is
  written as it is, one with it is src*a + dst*(1-a), in the order queued,
  depth-tested and writing depth.

Linear filtering, clamping, an sRGB picture, `over` off, or an `over` draw
writing no depth each fail it. Pairs in tests/lib/canvascard, SPIR-V by
tools/canvas_test_spirv.ae. Added to ci.sh's GPU_SUITES.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paul-hammant
paul-hammant merged commit 38de802 into main Nov 27, 2026
10 checks passed
@paul-hammant
paul-hammant deleted the test/canvas-sampling-blending-pr branch November 27, 2026 20:30
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