[spline/bezier]Support drawing primitives lines and points.

This commit is contained in:
xebra 2014-11-25 22:32:50 +09:00
parent f0ef073307
commit ab0eeb18f3
2 changed files with 6 additions and 14 deletions

View file

@ -877,7 +877,7 @@ void GLES_GPU::Execute_Bezier(u32 op, u32 diff) {
indices = Memory::GetPointerUnchecked(gstate_c.indexAddr);
}
if (gstate.getPatchPrimitiveType() != GE_PATCHPRIM_TRIANGLES) {
if (gstate.getPatchPrimitiveType() == GE_PATCHPRIM_UNKNOWN) {
ERROR_LOG_REPORT(G3D, "Unsupported patch primitive %x", gstate.getPatchPrimitiveType());
return;
}
@ -918,7 +918,7 @@ void GLES_GPU::Execute_Spline(u32 op, u32 diff) {
indices = Memory::GetPointerUnchecked(gstate_c.indexAddr);
}
if (gstate.getPatchPrimitiveType() != GE_PATCHPRIM_TRIANGLES) {
if (gstate.getPatchPrimitiveType() == GE_PATCHPRIM_UNKNOWN) {
ERROR_LOG_REPORT(G3D, "Unsupported patch primitive %x", gstate.getPatchPrimitiveType());
return;
}

View file

@ -31,14 +31,11 @@ u32 TransformDrawEngine::NormalizeVertices(u8 *outPtr, u8 *bufPtr, const u8 *inP
return DrawEngineCommon::NormalizeVertices(outPtr, bufPtr, inPtr, dec, lowerBound, upperBound, vertType);
}
const GEPrimitiveType primType[] = { GE_PRIM_TRIANGLES, GE_PRIM_LINES, GE_PRIM_POINTS };
void TransformDrawEngine::SubmitSpline(void* control_points, void* indices, int count_u, int count_v, int type_u, int type_v, GEPatchPrimType prim_type, u32 vertType) {
Flush();
if (prim_type != GE_PATCHPRIM_TRIANGLES) {
// Only triangles supported!
return;
}
u16 index_lower_bound = 0;
u16 index_upper_bound = count_u * count_v - 1;
bool indices_16bit = (vertType & GE_VTYPE_IDX_MASK) == GE_VTYPE_IDX_16BIT;
@ -101,7 +98,7 @@ void TransformDrawEngine::SubmitSpline(void* control_points, void* indices, int
gstate_c.uv.vOff = 0;
}
int bytesRead;
SubmitPrim(decoded2, quadIndices_, GE_PRIM_TRIANGLES, count, vertTypeWithIndex16, &bytesRead);
SubmitPrim(decoded2, quadIndices_, primType[prim_type], count, vertTypeWithIndex16, &bytesRead);
Flush();
@ -113,11 +110,6 @@ void TransformDrawEngine::SubmitSpline(void* control_points, void* indices, int
void TransformDrawEngine::SubmitBezier(void* control_points, void* indices, int count_u, int count_v, GEPatchPrimType prim_type, u32 vertType) {
Flush();
if (prim_type != GE_PATCHPRIM_TRIANGLES) {
// Only triangles supported!
return;
}
u16 index_lower_bound = 0;
u16 index_upper_bound = count_u * count_v - 1;
bool indices_16bit = (vertType & GE_VTYPE_IDX_MASK) == GE_VTYPE_IDX_16BIT;
@ -194,7 +186,7 @@ void TransformDrawEngine::SubmitBezier(void* control_points, void* indices, int
}
int bytesRead;
SubmitPrim(decoded2, quadIndices_, GE_PRIM_TRIANGLES, count, vertTypeWithIndex16, &bytesRead);
SubmitPrim(decoded2, quadIndices_, primType[prim_type], count, vertTypeWithIndex16, &bytesRead);
Flush();
if (g_Config.bPrescaleUV) {