Skip to content

Commit

Permalink
Merge pull request #5182 from sum2012/patch-2
Browse files Browse the repository at this point in the history
Fix "Integer divide by zero"  in Spline.cpp
  • Loading branch information
hrydgard committed Jan 22, 2014
2 parents 260b033 + 3c72623 commit f53ef47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions GPU/GLES/Spline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,8 @@ void TransformDrawEngine::SubmitBezier(void* control_points, void* indices, int
// 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;
int tess_u = gstate.getPatchDivisionU() / num_patches_u;
int tess_v = gstate.getPatchDivisionV() / num_patches_v;
if (tess_u < 4) tess_u = 4;
Expand Down

0 comments on commit f53ef47

Please sign in to comment.