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

GPU: Account for w properly in lines, fixing width #16067

Merged
merged 1 commit into from
Sep 21, 2022
Merged
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
24 changes: 12 additions & 12 deletions GPU/Common/SoftwareTransformCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,13 +790,13 @@ void SoftwareTransform::ExpandLines(int vertexCount, int &maxIndex, u16 *&inds,
float yoff = addWidth.y * dy;

// bottom right
trans[0].CopyFromWithOffset(transVtx2, xoff, yoff);
trans[0].CopyFromWithOffset(transVtx2, xoff * transVtx2.pos_w, yoff * transVtx2.pos_w);
// top right
trans[1].CopyFromWithOffset(transVtx1, xoff, yoff);
trans[1].CopyFromWithOffset(transVtx1, xoff * transVtx1.pos_w, yoff * transVtx1.pos_w);
// top left
trans[2].CopyFromWithOffset(transVtx1, -xoff, -yoff);
trans[2].CopyFromWithOffset(transVtx1, -xoff * transVtx1.pos_w, -yoff * transVtx1.pos_w);
// bottom left
trans[3].CopyFromWithOffset(transVtx2, -xoff, -yoff);
trans[3].CopyFromWithOffset(transVtx2, -xoff * transVtx2.pos_w, -yoff * transVtx2.pos_w);

// Triangle: BR-TR-TL
indsOut[0] = i * 2 + 0;
Expand Down Expand Up @@ -835,17 +835,17 @@ void SoftwareTransform::ExpandLines(int vertexCount, int &maxIndex, u16 *&inds,

// bottom right
trans[0] = transVtxBL;
trans[0].x += addWidth.x * dx;
trans[0].y += addWidth.y * dy;
trans[0].u += addWidth.x * du;
trans[0].v += addWidth.y * dv;
trans[0].x += addWidth.x * dx * trans[0].pos_w;
trans[0].y += addWidth.y * dy * trans[0].pos_w;
trans[0].u += addWidth.x * du * trans[0].uv_w;
trans[0].v += addWidth.y * dv * trans[0].uv_w;

// top right
trans[1] = transVtxTL;
trans[1].x += addWidth.x * dx;
trans[1].y += addWidth.y * dy;
trans[1].u += addWidth.x * du;
trans[1].v += addWidth.y * dv;
trans[1].x += addWidth.x * dx * trans[1].pos_w;
trans[1].y += addWidth.y * dy * trans[1].pos_w;
trans[1].u += addWidth.x * du * trans[1].uv_w;
trans[1].v += addWidth.y * dv * trans[1].uv_w;

// top left
trans[2] = transVtxTL;
Expand Down