Skip to content

Add frag_depth qualifier tests with position input - #4741

Merged
beaufortfrancois merged 2 commits into
gpuweb:mainfrom
beaufortfrancois:fragment-depth-position
Dec 2, 2026
Merged

beaufortfrancois merged 2 commits into
gpuweb:mainfrom
beaufortfrancois:fragment-depth-position

Conversation

@beaufortfrancois

@beaufortfrancois beaufortfrancois commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Adds operation tests in src/webgpu/api/operation/rendering/depth.spec.ts covering @builtin(frag_depth, less) and @builtin(frag_depth, greater) combined with @builtin(position) input (companion tests for https://dawn-review.googlesource.com/c/dawn/+/366975):

  • fragment_depth_qualifiers_with_position: Tests less and greater depth modes with @builtin(position) input across sampleCount (1, 4) and extraInput (none, sample_index, unused_sample_index, sample_interpolation, unused_sample_interpolation, centroid_interpolation) using a depth-only render pipeline, verifying the written depth (0.25 / 0.75) via a depthCompare: 'equal' pass.
  • fragment_depth_qualifiers_position_multisample: Renders a partially covering triangle under 4x MSAA (excluding pixel center (0.5, 0.5)) across the same mode and extraInput combinations and verifies @builtin(position).xy remains evaluated at pixel center (0.5, 0.5) while writing the expected depth to the 2 covered samples.

Issue: gpuweb/gpuweb#5342


Requirements for PR author:

  • All missing test coverage is tracked with "TODO" or .unimplemented().
  • New helpers are /** documented */ and new helper files are found in helper_index.txt.
  • Test behaves as expected in a WebGPU implementation. (Verified in Chrome Canary on macOS/Metal: 24/24 pass for fragment_depth_qualifiers_with_position, 12/12 pass for fragment_depth_qualifiers_position_multisample.)
  • Test have be tested with compatibility mode validation enabled and behave as expected. (Verified in Chrome Canary with compatibility=1: none and centroid_interpolation pass; used and unused sample_index and sample_interpolation skip.)

Requirements for reviewer sign-off:

  • Tests are properly located.
  • Test descriptions are accurate and complete.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Tests avoid over-parameterization (see case count report).

When landing this PR, be sure to make any necessary issue status updates.

Adds operation tests in webgpu:api,operation,rendering,depth covering @Builtin(frag_depth, less) and @Builtin(frag_depth, greater) combined with @Builtin(position) input, including pixel-frequency vs sample-frequency inputs and verifying pixel-center @Builtin(position) evaluation under 4x MSAA on partially covered pixels.
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Results for build job (at 8082ae2):

+webgpu:api,operation,rendering,depth:fragment_depth_qualifiers_with_position:* - 24 cases, 24 subcases (~1/case)
+webgpu:api,operation,rendering,depth:fragment_depth_qualifiers_position_multisample:* - 12 cases, 12 subcases (~1/case)
-TOTAL: 290287 cases, 2383042 subcases
+TOTAL: 290323 cases, 2383078 subcases

@beaufortfrancois
beaufortfrancois merged commit b618571 into gpuweb:main Dec 2, 2026
1 check passed
@beaufortfrancois
beaufortfrancois deleted the fragment-depth-position branch December 2, 2026 14:35
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.

2 participants