Permalink
Browse files

[spline/bezier]minor fix

  • Loading branch information...
xebra committed Jan 30, 2018
1 parent a4860b6 commit 28a50053bde368ebf19880dabf845e9e850777bd
Showing with 9 additions and 12 deletions.
  1. +9 −12 GPU/Common/SplineCommon.cpp
@@ -873,6 +873,10 @@ void DrawEngineCommon::SubmitSpline(const void *control_points, const void *indi
PROFILE_THIS_SCOPE("spline");
DispatchFlush();
// Real hardware seems to draw nothing when given < 4 either U or V.
if (count_u < 4 || count_v < 4)
return;
SimpleBufferManager managedBuf(decoded, DECODED_VERTEX_BUFFER_SIZE);
u16 index_lower_bound = 0;
@@ -884,11 +888,6 @@ void DrawEngineCommon::SubmitSpline(const void *control_points, const void *indi
VertexDecoder *origVDecoder = GetVertexDecoder((vertType & 0xFFFFFF) | (gstate.getUVGenMode() << 24));
*bytesRead = count_u * count_v * origVDecoder->VertexSize();
// Real hardware seems to draw nothing when given < 4 either U or V.
if (count_u < 4 || count_v < 4) {
return;
}
// Simplify away bones and morph before proceeding
SimpleVertex *simplified_control_points = (SimpleVertex *)managedBuf.Allocate(sizeof(SimpleVertex) * index_upper_bound + 1);
u8 *temp_buffer = managedBuf.Allocate(sizeof(SimpleVertex) * count_u * count_v);
@@ -987,9 +986,13 @@ void DrawEngineCommon::SubmitSpline(const void *control_points, const void *indi
void DrawEngineCommon::SubmitBezier(const void *control_points, const void *indices, int tess_u, int tess_v, int count_u, int count_v, GEPatchPrimType prim_type, bool computeNormals, bool patchFacing, u32 vertType, int *bytesRead) {
PROFILE_THIS_SCOPE("bezier");
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;
SimpleBufferManager managedBuf(decoded, DECODED_VERTEX_BUFFER_SIZE);
u16 index_lower_bound = 0;
@@ -1001,12 +1004,6 @@ void DrawEngineCommon::SubmitBezier(const void *control_points, const void *indi
VertexDecoder *origVDecoder = GetVertexDecoder((vertType & 0xFFFFFF) | (gstate.getUVGenMode() << 24));
*bytesRead = count_u * count_v * origVDecoder->VertexSize();
// 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;
}
// Simplify away bones and morph before proceeding
// There are normally not a lot of control points so just splitting decoded should be reasonably safe, although not great.
SimpleVertex *simplified_control_points = (SimpleVertex *)managedBuf.Allocate(sizeof(SimpleVertex) * index_upper_bound + 1);

0 comments on commit 28a5005

Please sign in to comment.