Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge consecutive lines when stippling #419

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions framework/common/tcuRasterizationVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,9 @@ bool verifyMultisampleLineGroupRasterization (const tcu::Surface& surface,
{
float lineLength = tcu::distance(lineScreenSpace[0], lineScreenSpace[1]);
float lineOffset = 0.0f;
float lineSegmentStart = -1.0f;
float lineSegmentEnd = -1.0f;
bool prevStipplePass = false;

while (lineOffset < lineLength)
{
Expand Down Expand Up @@ -1012,11 +1015,29 @@ bool verifyMultisampleLineGroupRasterization (const tcu::Surface& surface,
if (leftoverPhase == 0)
stippleCounter++;

if (!stipplePass)
if (stipplePass)
{
// start new segment
if (!prevStipplePass)
lineSegmentStart = d0;

// extend current segment
lineSegmentEnd = d1;
}

// update state
prevStipplePass = stipplePass;

// keep accumulating lines
if ((stipplePass && lineOffset < lineLength) ||
lineSegmentStart == lineSegmentEnd)
{
continue;
}

d0 /= lineLength;
d1 /= lineLength;
d0 = lineSegmentStart / lineLength;
d1 = lineSegmentEnd / lineLength;
lineSegmentStart = lineSegmentEnd = -1.0;

tcu::Vec2 l0 = mix(lineScreenSpace[0], lineScreenSpace[1], d0);
tcu::Vec2 l1 = mix(lineScreenSpace[0], lineScreenSpace[1], d1);
Expand Down Expand Up @@ -1050,6 +1071,8 @@ bool verifyMultisampleLineGroupRasterization (const tcu::Surface& surface,

triangleScene.triangles.push_back(tri);
}
DE_ASSERT(lineSegmentStart < 0);
DE_ASSERT(lineSegmentEnd < 0);
}
else
{
Expand Down