From 0cd44e838b85277c8e666ca07d53cc7ae280c702 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 10 Apr 2016 17:33:34 -0700 Subject: [PATCH] Allow spline subdivisions below 2. --- GPU/Common/SplineCommon.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/GPU/Common/SplineCommon.cpp b/GPU/Common/SplineCommon.cpp index 896d531c5f..fda350ae22 100644 --- a/GPU/Common/SplineCommon.cpp +++ b/GPU/Common/SplineCommon.cpp @@ -323,8 +323,13 @@ static void SplinePatchFullQuality(u8 *&dest, u16 *indices, int &count, const Sp int patch_div_s = (spatch.count_u - 3) * spatch.tess_u; int patch_div_t = (spatch.count_v - 3) * spatch.tess_v; if (quality > 1) { - patch_div_s /= quality; - patch_div_t /= quality; + // Don't cut below 2, though. + if (patch_div_s > 2) { + patch_div_s /= quality; + } + if (patch_div_t > 2) { + patch_div_t /= quality; + } } // Downsample until it fits, in case crazy tesselation factors are sent. @@ -333,8 +338,8 @@ static void SplinePatchFullQuality(u8 *&dest, u16 *indices, int &count, const Sp patch_div_t /= 2; } - if (patch_div_s < 2) patch_div_s = 2; - if (patch_div_t < 2) patch_div_t = 2; + if (patch_div_s < 1) patch_div_s = 1; + if (patch_div_t < 1) patch_div_t = 1; // First compute all the vertices and put them in an array SimpleVertex *&vertices = (SimpleVertex*&)dest;