GraphicsTests on both backends, debug names and markers #36

Open
UnflavoredMeson/Primal_Plus_Plus
opened 2026-11-24 20:15:59 +00:00 by UnflavoredMeson · 0 comments
Owner

Why

Renderer bugs show up as validation errors long before they show on screen. Tests that render and fail on any validation message keep both backends honest.

Decided

  • GraphicsTests, one executable (doctest), on the backend PRIMAL_GRAPHICS names; content made in memory (GraphicsTests/TestContent.h), never assets.
  • A test starts with graphics_test::Session and ends with shutdown_and_check(): in Debug, any validation error or warning fails it, also at device destruction.
  • Sizes are compared with each other, never with the numbers asked for (a window manager may change them).
  • CI: Xvfb + lavapipe; ci.sh coverage (clang source-based coverage).
  • vkx::set_name()/d3dx::set_name() and scoped debug markers per pass.

Read first

  • UnflavoredMeson/Primal#28.

Steps

  • 1. Write the session helper and a test that opens a window and clears it.
  • 2. Add tests for a hand-made scene through the whole renderer.
  • 3. Add the CI job and the coverage job.
  • 4. Add debug names and markers; check them in RenderDoc.

Done when

  • GraphicsTests pass on Vulkan and D3D12 (WARP in the VM), in CI on lavapipe; 0 warnings; tidy 0.

Claude can help with

  • Writing test content in memory (meshes in the three vertex formats, cube maps).

Learn

  • What RenderDoc shows you that validation can't.
## Why Renderer bugs show up as validation errors long before they show on screen. Tests that render and fail on any validation message keep both backends honest. ## Decided - `GraphicsTests`, one executable (doctest), on the backend `PRIMAL_GRAPHICS` names; content made in memory (`GraphicsTests/TestContent.h`), never assets. - A test starts with `graphics_test::Session` and ends with `shutdown_and_check()`: in Debug, any validation error or warning fails it, also at device destruction. - Sizes are compared with each other, never with the numbers asked for (a window manager may change them). - CI: Xvfb + lavapipe; `ci.sh coverage` (clang source-based coverage). - `vkx::set_name()`/`d3dx::set_name()` and scoped debug markers per pass. ## Read first - `UnflavoredMeson/Primal#28`. ## Steps - [ ] 1. Write the session helper and a test that opens a window and clears it. - [ ] 2. Add tests for a hand-made scene through the whole renderer. - [ ] 3. Add the CI job and the coverage job. - [ ] 4. Add debug names and markers; check them in RenderDoc. ## Done when - [ ] GraphicsTests pass on Vulkan and D3D12 (WARP in the VM), in CI on lavapipe; 0 warnings; tidy 0. ## Claude can help with - Writing test content in memory (meshes in the three vertex formats, cube maps). ## Learn - What RenderDoc shows you that validation can't.
Sign in to join this conversation.
No assignees
No project
No milestone
Blocks
#65 Thin RHI
UnflavoredMeson/Primal_Plus_Plus
#72 The real asset scene in CI
UnflavoredMeson/Primal_Plus_Plus
#73 Graphics tests on Wayland in CI
UnflavoredMeson/Primal_Plus_Plus
#74 Graphics tests with GPU-assisted validation
UnflavoredMeson/Primal_Plus_Plus
Depends on
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
UnflavoredMeson/Primal_Plus_Plus#36
No description provided.