Add ClipDistance and CullDistance tests#1168
Open
EmilioLaiso wants to merge 2 commits into
Open
Conversation
manon-traverse
approved these changes
May 11, 2026
bogner
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds baseline tests for two graphics-stage system values from the
rasterization-coverage epic (#1146).
Both attach a
floatto a vertex. The rasterizer reads them and decideswhether to draw — but at different granularities:
SV_ClipDistance: the value is interpolated across theprimitive. Any pixel whose interpolated value is negative is dropped
before the pixel shader runs.
SV_CullDistance: the value is not interpolated. If everyvertex of a primitive has a negative value, the entire primitive is
dropped before rasterization.
ClipDistance.test
A fullscreen quad over a 4×1 render target. The vertex buffer is set up
so that
clipDist == NDC.xat every vertex. After linear interpolationacross the quad, every pixel's
clipDistequals its own NDC x.Pixel centers in NDC land at
-0.75, -0.25, +0.25, +0.75, so:CullDistance.test
Two separate triangles drawn in a single call onto a 4×1 RT, each with
a uniform
cullDistat all three of its vertices:cullDist = +1everywhere → kept,pixel shader writes red.
cullDist = -1everywhere → entireprimitive dropped before rasterization, pixels stay cleared.