diff options
| author | TellowKrinkle <tellowkrinkle@gmail.com> | 2022-10-04 22:54:30 -0500 |
|---|---|---|
| committer | TellowKrinkle <tellowkrinkle@gmail.com> | 2022-10-22 20:13:24 -0500 |
| commit | b567f3afcf79ab9333e9f5b17bad9aa17880b74e (patch) | |
| tree | 9f560726e74b76d24bb1151002c5f583fc9749dd /Source/Core/VideoCommon/GeometryShaderGen.cpp | |
| parent | 0a42c534c397b6f99013c25c03799c1c673885b4 (diff) | |
VideoCommon: Move repeated point/line expansion code to ShaderGenCommon
Diffstat (limited to 'Source/Core/VideoCommon/GeometryShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/GeometryShaderGen.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/Source/Core/VideoCommon/GeometryShaderGen.cpp b/Source/Core/VideoCommon/GeometryShaderGen.cpp index 04d0062982..2db201c636 100644 --- a/Source/Core/VideoCommon/GeometryShaderGen.cpp +++ b/Source/Core/VideoCommon/GeometryShaderGen.cpp @@ -169,22 +169,7 @@ ShaderCode GenerateGeometryShaderCode(APIType api_type, const ShaderHostConfig& "\tVS_OUTPUT end = o[1];\n"); } - // GameCube/Wii's line drawing algorithm is a little quirky. It does not - // use the correct line caps. Instead, the line caps are vertical or - // horizontal depending the slope of the line. - out.Write("\tfloat2 offset;\n" - "\tfloat2 to = abs(end.pos.xy / end.pos.w - start.pos.xy / start.pos.w);\n" - // FIXME: What does real hardware do when line is at a 45-degree angle? - // FIXME: Lines aren't drawn at the correct width. See Twilight Princess map. - "\tif (" I_LINEPTPARAMS ".y * to.y > " I_LINEPTPARAMS ".x * to.x) {{\n" - // Line is more tall. Extend geometry left and right. - // Lerp LineWidth/2 from [0..VpWidth] to [-1..1] - "\t\toffset = float2(" I_LINEPTPARAMS ".z / " I_LINEPTPARAMS ".x, 0);\n" - "\t}} else {{\n" - // Line is more wide. Extend geometry up and down. - // Lerp LineWidth/2 from [0..VpHeight] to [1..-1] - "\t\toffset = float2(0, -" I_LINEPTPARAMS ".z / " I_LINEPTPARAMS ".y);\n" - "\t}}\n"); + GenerateLineOffset(out, "\t", "\t\t", "end.pos", "start.pos", ""); } else if (primitive_type == PrimitiveType::Points) { |
