llvm / llvm/offload-test-suite

[EPIC]: Improve rasterization tests coverage

Open
#1,146 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
18
Forks
39
Avg merge
2d 18h
Merged PRs (30d)
40

Description

## Legend

### πŸ—οΈ - Requires backend/yaml work
### πŸ‘ - Testable

## Vertex Shader

#### Semantics
- [x] SV_VertexID
- https://github.com/llvm/offload-test-suite/pull/1142
- [x] SV_Position
- Already covered by all graphics tests
- [ ] SV_ClipDistance[n]
- https://github.com/llvm/offload-test-suite/pull/1168
- [ ] SV_CullDistance[n]
- https://github.com/llvm/offload-test-suite/pull/1168
- [ ] SV_InstanceID - πŸ—οΈ
- [ ] SV_StartVertexLocation - πŸ—οΈ
- [ ] SV_StartInstanceLocation - πŸ—οΈ
- [ ] SV_RenderTargetArrayIndex - πŸ—οΈ
- [ ] SV_ViewportArrayIndex - πŸ—οΈ
- [ ] SV_ViewID - πŸ—οΈ

#### Functional
- [ ] Non-`Float32` vertex attribute formats (`Int32`, `UInt32`, `Float16`, `Int16`, `UInt16`) - πŸ‘
- [ ] Normalized integer attribute formats (`UNorm8`, `SNorm8`, `UNorm16`, `SNorm16`) - πŸ‘
- [x] Multiple varyings to PS β€” many simultaneous user semantics, mixed integer/float types
- https://github.com/llvm/offload-test-suite/pull/1255
- [ ] Struct-typed varyings between VS and PS - πŸ‘
- [x] CBuffer read in VS (real `mul(MVP, position)` instead of pass-through)
- https://github.com/llvm/offload-test-suite/pull/1255
- [ ] Push constants in VS - πŸ‘
- [x] `StructuredBuffer` read from VS
- https://github.com/llvm/offload-test-suite/pull/1255
- [x] `ByteAddressBuffer` read from VS
- https://github.com/llvm/offload-test-suite/pull/1255
- [ ] `RWStructuredBuffer` write from VS (different UAV path than PS-side write) - πŸ‘
- [ ] `Texture2D.SampleLevel(...)` from VS (no derivatives in VS) - πŸ‘
- [ ] `Texture2D.Load(...)` from VS - πŸ‘
- [x] `SV_Position` with W β‰  1 (verify perspective divide downstream)
- https://github.com/llvm/offload-test-suite/pull/1255
- [ ] Multiple vertex buffer slots (stream 0 + stream 1) - πŸ—οΈ
- [ ] Per-instance attributes (input rate `INSTANCE`) - πŸ—οΈ
- [ ] Indexed draws + `BaseVertex` - πŸ—οΈ
- [ ] Strip topologies + primitive restart - πŸ—οΈ

#### Niche / vendor behavior
- [ ] Provoking-vertex consistency (FIRST is the default on D3D12 / VK / MTL) with a `nointerpolation` integer varying - πŸ‘
- [ ] Vertex at clip-plane boundary (x = Β±w, y = Β±w, z = 0 / w) - πŸ‘
- [ ] Vertex with W close to 0 (numerical stability) - πŸ‘
- [ ] `NaN` / `Inf` in `SV_Position` (must be clipped, no rasterized output) - πŸ‘
- [ ] Subnormal positions (FTZ vs preserve at the rasterizer) - πŸ‘
- [ ] Negative-area / degenerate triangles - πŸ‘

## Pixel Shader

#### Semantics
- [x] `SV_Position` (input)
- Implicitly used by every graphics test; explicitly asserted at pixel center in `GraphicsSystemValues.test`
- [x] `SV_PrimitiveID`
- https://github.com/llvm/offload-test-suite/pull/1142
- [x] `SV_IsFrontFace`
- https://github.com/llvm/offload-test-suite/pull/1142
- [ ] `SV_ClipDistance[n]` (input) - πŸ‘
- [ ] `SV_CullDistance[n]` (input) - πŸ‘
- [ ] `SV_Depth` (output) - πŸ‘
- [ ] `SV_DepthGreaterEqual` (output) - πŸ‘
- [ ] `SV_DepthLessEqual` (output) - πŸ‘
- [ ] `SV_Target1`..`SV_Target7` (MRT) - πŸ—οΈ
- [ ] `SV_StencilRef` (output) - πŸ—οΈ
- [ ] `SV_SampleIndex` (input) - πŸ—οΈ
- [ ] `SV_Coverage` (input) - πŸ—οΈ
- [ ] `SV_Coverage` (output) - πŸ—οΈ
- [ ] `SV_InnerCoverage` (input) - πŸ—οΈ
- [ ] `SV_Barycentrics` (input) - πŸ—οΈ
- [ ] `SV_RenderTargetArrayIndex` (input from VS/GS) - πŸ—οΈ
- [ ] `SV_ViewportArrayIndex` (input from VS/GS) - πŸ—οΈ

#### Functional
- [x] `discard`
- `test/Graphics/discard.test` (#1119)
- [x] `ddx_fine`, `ddy_fine`, `fwidth`
- `test/Graphics/..`
- [ ] `clip()` intrinsic (companion to `discard`) - πŸ‘
- [ ] `ddx` / `ddy` (default precision) - πŸ‘
- [x] `ddx_coarse` / `ddy_coarse`
- https://github.com/llvm/offload-test-suite/pull/489
- [ ] `fwidth_coarse` / `fwidth_fine` - πŸ‘
- [x] Interpolation modifier: `nointerpolation` (flat) - https://github.com/llvm/offload-test-suite/pull/1151
- [x] Interpolation modifier: `noperspective` - https://github.com/llvm/offload-test-suite/pull/1151
- [x] Interpolation modifier: `centroid` - https://github.com/llvm/offload-test-suite/pull/1151
- [x] Interpolation modifier: `linear` - https://github.com/llvm/offload-test-suite/pull/1151
- [ ] `EvaluateAttributeAtCentroid` - πŸ‘
- [ ] `EvaluateAttributeSnapped` - πŸ‘
- [ ] `EvaluateAttributeAtSample` - πŸ—οΈ
- [ ] Interpolation modifier: `sample` - πŸ—οΈ
- [ ] PS UAV write to `RWBuffer` - πŸ‘
- [ ] PS UAV write to `RWByteAddressBuffer` - πŸ‘
- [ ] PS UAV write to `RWTexture2D` - πŸ‘
- [ ] PS reads `Texture2D` with all sample overloads (`Sample`, `SampleBias`, `SampleGrad`, `SampleLevel`, `SampleCmp`, `Gather`) - πŸ‘

#### Niche / vendor behavior
- [ ] Helper-invocation suppression β€” discarded lane's writes blocked, but its derivatives still drive the quad's other lanes - πŸ‘
- [ ] Quad message-passing (`QuadReadAcrossX/Y/Diagonal`) under partial coverage - πŸ‘
- [x] `SV_Position.xy` exactly at pixel center `(x + 0.5, y + 0.5)`
- https://github.com/llvm/offload-test-suite/pull/1142
- [ ] Depth clamping outside `[MinDepth, MaxDepth]` (clipped vs clamped vs undefined) - πŸ‘
- [ ] `SV_IsFrontFace` for zero-area / degenerate triangles - πŸ‘
- [ ] `discard` + `SV_Depth` write interaction (depth must not be written) - πŸ‘
- [ ] `clip()` with `NaN` / `Inf` operand - πŸ‘
- [ ] Pixel coverage at exact triangle edge (top-left rule) - πŸ‘
- [ ] Sample-frequency shading (PS runs per-sample, not per-pixel) - πŸ—οΈ

## Hull Shader

#### Semantics
- [x] `SV_TessFactor` (3 / 4 / 2 floats by domain)
- 2: https://github.com/llvm/offload-test-suite/pull/1285
- 3: https://github.com/llvm/offload-test-suite/pull/1224
- 4: https://github.com/llvm/offload-test-suite/pull/1254
- [x] `SV_InsideTessFactor` (1 / 2 / 0 floats by domain)
- 0: https://github.com/llvm/offload-test-suite/pull/1285
- 1: https://github.com/llvm/offload-test-suite/pull/1224
- 2: https://github.com/llvm/offload-test-suite/pull/1254
- [x] `SV_OutputControlPointID`
- https://github.com/llvm/offload-test-suite/pull/1224
- [ ] `SV_PrimitiveID` (HS input)
- https://github.com/llvm/offload-test-suite/pull/1304
- [ ] `HullSystemValues.test` β€” bundled test
- https://github.com/llvm/offload-test-suite/pull/1304

#### Functional
- [x] Pass-through HS (factor 1, identity control points)
- https://github.com/llvm/offload-test-suite/pull/1254
- [x] `InputPatch` reading from VS output
- https://github.com/llvm/offload-test-suite/pull/1224
- [x] `OutputPatch` to DS
- https://github.com/llvm/offload-test-suite/pull/1224
- [ ] Patch-constant function reading CBuffer - πŸ‘
- [ ] Per-edge varying tess factors - πŸ‘
- [ ] Patch culling via `SV_TessFactor = 0` (entire patch discarded) - πŸ‘
- [ ] Negative tess factor (must be treated as 0) - πŸ‘
- [ ] `SV_TessFactor` clamping at `[maxtessfactor]` - πŸ‘
- [ ] HS reads UAV / SRV - πŸ‘

#### Niche / vendor behavior
- [ ] Tess factor `Inf` / `NaN` handling (spec says clamped to max) - πŸ‘
- [ ] Patch with all coincident control points (degenerate) - πŸ‘
- [ ] Tess factor `> 64` (spec says clamp; observe driver behavior) - πŸ‘
- [ ] HS invocations seeing partial control-point arrays - πŸ‘

## Domain Shader

#### Semantics
- [x] `SV_DomainLocation`
- float3 for bary: https://github.com/llvm/offload-test-suite/pull/1224
- float2 for uv: https://github.com/llvm/offload-test-suite/pull/1254
- [ ] `SV_PrimitiveID` (DS input)
- https://github.com/llvm/offload-test-suite/pull/1304
- [x] `SV_Position` (DS output to rasterizer)
- https://github.com/llvm/offload-test-suite/pull/1224
- [ ] `SV_ClipDistance` / `SV_CullDistance` (DS output) - πŸ‘
- [ ] `DomainSystemValues.test` β€” bundled test
- https://github.com/llvm/offload-test-suite/pull/1304

#### Functional
- [x] Domain: `tri` (barycentric `SV_DomainLocation`)
- https://github.com/llvm/offload-test-suite/pull/1224
- [x] Domain: `quad` (UV `SV_DomainLocation`)
- https://github.com/llvm/offload-test-suite/pull/1284
- https://github.com/llvm/offload-test-suite/pull/1254
- [x] Domain: `isoline`
- https://github.com/llvm/offload-test-suite/pull/1285
- [x] Partitioning: `integer`
- https://github.com/llvm/offload-test-suite/pull/1224
- [ ] Partitioning: `fractional_even` - πŸ‘
- [ ] Partitioning: `fractional_odd` - πŸ‘
- [ ] Partitioning: `pow2` - πŸ‘
- [x] Output topology: `triangle_cw`
- https://github.com/llvm/offload-test-suite/pull/1224
- [x] Output topology: `triangle_ccw`
- https://github.com/llvm/offload-test-suite/pull/1284
- [ ] Output topology: `line` - πŸ‘
- [x] Output topology: `point`
- https://github.com/llvm/offload-test-suite/pull/1254
- [ ] Adaptive tessellation: varying per-edge factors, no T-junctions between adjacent patches - πŸ‘
- [ ] DS displacement (sample heightmap, write modified `SV_Position`) - πŸ‘
- [ ] DS reads CBuffer / SRV - πŸ‘

#### Niche / vendor behavior
- [ ] `fractional_*` partitioning vertex-count is implementation-defined within bounds β€” assert with tolerance, not exact - πŸ‘
- [ ] `SV_DomainLocation` precision near 0 / 1 boundaries - πŸ‘
- [x] Isoline `outside.x` (density) vs `outside.y` (detail) β€” easy to invert
- https://github.com/llvm/offload-test-suite/pull/1285
- [ ] CW / CCW output topology must match the rasterizer's front-face convention (vendors sometimes invert one path) - πŸ‘
- [ ] Sub-pixel tessellation precision (zoom in on a quad and verify smoothness) - πŸ‘

## Geometry Shader

#### Semantics
- [ ] `SV_PrimitiveID` (GS input β€” auto-generated per input primitive)
- Also exercised by https://github.com/llvm/offload-test-suite/pull/1222
- [ ] `SV_GSInstanceID` (when `[instance(N)]` is used) - πŸ‘
- [ ] `SV_RenderTargetArrayIndex` (GS output) - πŸ—οΈ
- [ ] `SV_ViewportArrayIndex` (GS output) - πŸ—οΈ
- [ ] `GeometrySystemValues.test` β€” bundled test - πŸ‘

#### Functional
- [x] Pass-through GS (1 in, 1 out, same topology β€” verifies pipeline plumbing)
- https://github.com/llvm/offload-test-suite/pull/1221
- [x] Point-to-quad expansion (point sprite β€” input point, 4 vertices out as triangle strip)
- https://github.com/llvm/offload-test-suite/pull/1203
- [ ] Line-to-triangle ribbons (line in, two triangles out) - πŸ‘
- [x] Triangle subdivision (1 input β†’ 4 output triangles)
- https://github.com/llvm/offload-test-suite/pull/1223
- [ ] Topology change: triangle in β†’ line out (wireframe) - πŸ‘
- [x] Selective output: `if (cond) stream.Append(v);` β€” some primitives produce 0 outputs
- https://github.com/llvm/offload-test-suite/pull/1222
- [ ] `[instance(N)]` GS instancing β€” N invocations per input primitive - πŸ‘
- [ ] Adjacency input `triangleadj` (6 vertices: 3 triangle + 3 neighbors), use neighbor data for silhouette detection - πŸ‘
- [ ] `[maxvertexcount(1024)]` β€” spec minimum upper bound; verify large outputs - πŸ‘
- [ ] GS UAV write (each invocation writes a unique slot) - πŸ‘
- [ ] GS reads CBuffer / SRV - πŸ‘
- [x] `RestartStrip()` mid-output
- https://github.com/llvm/offload-test-suite/pull/1223

#### Niche / vendor behavior
- [x] Empty stream β€” `[maxvertexcount(N)]` declared, 0 emitted, primitive vanishes
- https://github.com/llvm/offload-test-suite/pull/1222
- [ ] Provoking vertex of GS-emitted primitives (implementation-defined, assert consistency) - πŸ‘
- [ ] Exceeding `[maxvertexcount]` (undefined per spec, observe behavior) - πŸ‘
- [ ] GS-emitted primitive interaction with `SV_RenderTargetArrayIndex` β€” different primitives to different RT slices - πŸ—οΈ

## Cross-cutting / Pipeline

#### Topologies
- [x] Triangle list
- All current graphics tests
- [ ] Triangle strip - πŸ—οΈ
- [ ] Line list - πŸ‘
- [ ] Line strip - πŸ—οΈ
- [x] Point list
- https://github.com/llvm/offload-test-suite/pull/1203
- [ ] Triangle list with adjacency - πŸ—οΈ
- [ ] Line list with adjacency - πŸ—οΈ
- [ ] Patch lists (3, 4, 16, 32 control points) - πŸ‘
- [ ] Primitive restart with strip topologies - πŸ—οΈ

#### Pipeline state
- [ ] Multiple render targets (`NumRenderTargets > 1`) - πŸ—οΈ
- [ ] Depth-only rendering (no color attachment) - πŸ—οΈ
- [ ] Stencil read / write - πŸ—οΈ
- [ ] Configurable blend state - πŸ—οΈ
- [ ] Conservative rasterization - πŸ—οΈ
- [ ] Variable-rate shading - πŸ—οΈ
- [ ] MSAA pipeline state (`SampleCount > 1`) - πŸ—οΈ

#### Multi-stage pipelines
- [x] VS β†’ HS β†’ DS β†’ PS (no GS)
- https://github.com/llvm/offload-test-suite/pull/1224
- [x] VS β†’ GS β†’ PS (no tessellation)
- https://github.com/llvm/offload-test-suite/pull/1203
- [x] VS β†’ HS β†’ DS β†’ GS β†’ PS (full pipeline)
- https://github.com/llvm/offload-test-suite/pull/1254
- [ ] Resource visibility flags per stage (`D3D12_SHADER_VISIBILITY_*`) - πŸ‘
- [ ] CBuffer accessed from multiple stages (deduplication, single binding) - πŸ‘
- [ ] Push constants accessed from multiple stages - πŸ‘
- [ ] Stage-interface signature compatibility (mismatched semantics between adjacent stages must error) - πŸ‘

#### Cross-backend determinism
- [ ] Same shader produces byte-exact PNG across DX / VK / MTL on simple geometry - πŸ‘
- [ ] Document `DiffRMS` / `Intervals` tolerance per goldenimage test - πŸ‘
- [ ] WARP vs hardware GPU drift profile per test (existing tests already absorb it; document explicitly) - πŸ‘

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up β€” it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing graphics tests, including test/Graphics/discard.test and GraphicsSystemValues.test, then choose one unchecked item marked πŸ‘ in this epic. Compare the selected coverage with nearby tests and add the corresponding rasterization test; done means the test passes and the checklist item can be linked to the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.