mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
softgpu: Advance vertex/index address on prim.
Fixes some broken graphics in a lot of places.
This commit is contained in:
parent
89b48cf95b
commit
d227b13f36
@ -349,8 +349,19 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff)
|
||||
}
|
||||
|
||||
cyclesExecuted += EstimatePerVertexCost() * count;
|
||||
if (!(gstate_c.skipDrawReason & SKIPDRAW_SKIPFRAME)) {
|
||||
TransformUnit::SubmitPrimitive(verts, indices, type, count, gstate.vertType);
|
||||
int bytesRead;
|
||||
TransformUnit::SubmitPrimitive(verts, indices, type, count, gstate.vertType, &bytesRead);
|
||||
|
||||
// After drawing, we advance the vertexAddr (when non indexed) or indexAddr (when indexed).
|
||||
// Some games rely on this, they don't bother reloading VADDR and IADDR.
|
||||
// Q: Are these changed reflected in the real registers? Needs testing.
|
||||
if (indices) {
|
||||
int indexSize = 1;
|
||||
if ((gstate.vertType & GE_VTYPE_IDX_MASK) == GE_VTYPE_IDX_16BIT)
|
||||
indexSize = 2;
|
||||
gstate_c.indexAddr += count * indexSize;
|
||||
} else {
|
||||
gstate_c.vertexAddr += bytesRead;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -262,13 +262,21 @@ void TransformUnit::SubmitSpline(void* control_points, void* indices, int count_
|
||||
host->GPUNotifyDraw();
|
||||
}
|
||||
|
||||
void TransformUnit::SubmitPrimitive(void* vertices, void* indices, u32 prim_type, int vertex_count, u32 vertex_type)
|
||||
void TransformUnit::SubmitPrimitive(void* vertices, void* indices, u32 prim_type, int vertex_count, u32 vertex_type, int *bytesRead)
|
||||
{
|
||||
// TODO: Cache VertexDecoder objects
|
||||
VertexDecoder vdecoder;
|
||||
vdecoder.SetVertexType(vertex_type);
|
||||
const DecVtxFormat& vtxfmt = vdecoder.GetDecVtxFmt();
|
||||
|
||||
if (bytesRead)
|
||||
*bytesRead = vertex_count * vdecoder.VertexSize();
|
||||
|
||||
// Frame skipping.
|
||||
if (gstate_c.skipDrawReason & SKIPDRAW_SKIPFRAME) {
|
||||
return;
|
||||
}
|
||||
|
||||
static u8 buf[65536 * 48]; // yolo
|
||||
u16 index_lower_bound = 0;
|
||||
u16 index_upper_bound = vertex_count - 1;
|
||||
|
@ -116,5 +116,5 @@ public:
|
||||
static ScreenCoords DrawingToScreen(const DrawingCoords& coords);
|
||||
|
||||
static void SubmitSpline(void* control_points, void* indices, int count_u, int count_v, int type_u, int type_v, GEPatchPrimType prim_type, u32 vertex_type);
|
||||
static void SubmitPrimitive(void* vertices, void* indices, u32 prim_type, int vertex_count, u32 vertex_type);
|
||||
static void SubmitPrimitive(void* vertices, void* indices, u32 prim_type, int vertex_count, u32 vertex_type, int *bytesRead);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user