diff --git a/GPU/Common/SplineCommon.cpp b/GPU/Common/SplineCommon.cpp index be49802c8ed2..083f938608fe 100644 --- a/GPU/Common/SplineCommon.cpp +++ b/GPU/Common/SplineCommon.cpp @@ -880,6 +880,7 @@ void DrawEngineCommon::SubmitBezier(const void *control_points, const void *indi DispatchFlush(); // Real hardware seems to draw nothing when given < 4 either U or V. + // This would result in num_patches_u / num_patches_v being 0. if (count_u < 4 || count_v < 4) return; @@ -911,7 +912,7 @@ void DrawEngineCommon::SubmitBezier(const void *control_points, const void *indi // Bezier patches share less control points than spline patches. Otherwise they are pretty much the same (except bezier don't support the open/close thing) int num_patches_u = (count_u - 1) / 3; int num_patches_v = (count_v - 1) / 3; - BezierPatch* patches = new BezierPatch[num_patches_u * num_patches_v]; + BezierPatch *patches = new BezierPatch[num_patches_u * num_patches_v]; for (int patch_u = 0; patch_u < num_patches_u; patch_u++) { for (int patch_v = 0; patch_v < num_patches_v; patch_v++) { BezierPatch& patch = patches[patch_u + patch_v * num_patches_u]; @@ -943,18 +944,13 @@ void DrawEngineCommon::SubmitBezier(const void *control_points, const void *indi int count = 0; u8 *dest = splineBuffer; - // Simple approximation of the real tesselation factor. // We shouldn't really split up into separate 4x4 patches, instead we should do something that works // like the splines, so we subdivide across the whole "mega-patch". - if (num_patches_u == 0) num_patches_u = 1; - if (num_patches_v == 0) num_patches_v = 1; - if (tess_u < 4) tess_u = 4; - if (tess_v < 4) tess_v = 4; u16 *inds = quadIndices_; int maxVertices = SPLINE_BUFFER_SIZE / vertexSize; for (int patch_idx = 0; patch_idx < num_patches_u*num_patches_v; ++patch_idx) { - BezierPatch& patch = patches[patch_idx]; + const BezierPatch &patch = patches[patch_idx]; TesselateBezierPatch(dest, inds, count, tess_u, tess_v, patch, origVertType, maxVertices); } delete[] patches;