mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #10441 from unknownbrackets/softgpu-bbox
Software: Execute bounding box tests
This commit is contained in:
commit
1c9e970b37
1 changed files with 26 additions and 3 deletions
|
@ -471,10 +471,33 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff) {
|
|||
break;
|
||||
|
||||
case GE_CMD_BOUNDINGBOX:
|
||||
if (data != 0)
|
||||
if (data == 0) {
|
||||
currentList->bboxResult = false;
|
||||
} else if (((data & 7) == 0) && data <= 64) { // Sanity check
|
||||
DEBUG_LOG(G3D, "Unsupported bounding box: %06x", data);
|
||||
// bounding box test. Let's assume the box was within the drawing region.
|
||||
void *control_points = Memory::GetPointer(gstate_c.vertexAddr);
|
||||
if (!control_points) {
|
||||
ERROR_LOG_REPORT_ONCE(boundingbox, G3D, "Invalid verts in bounding box check");
|
||||
currentList->bboxResult = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (gstate.vertType & GE_VTYPE_IDX_MASK) {
|
||||
ERROR_LOG_REPORT_ONCE(boundingbox, G3D, "Indexed bounding box data not supported.");
|
||||
// Data seems invalid. Let's assume the box test passed.
|
||||
currentList->bboxResult = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Test if the bounding box is within the drawing region.
|
||||
int bytesRead;
|
||||
currentList->bboxResult = drawEngineCommon_->TestBoundingBox(control_points, data, gstate.vertType, &bytesRead);
|
||||
AdvanceVerts(gstate.vertType, data, bytesRead);
|
||||
} else {
|
||||
ERROR_LOG_REPORT_ONCE(boundingbox, G3D, "Bad bounding box data: %06x", data);
|
||||
// Data seems invalid. Let's assume the box test passed.
|
||||
currentList->bboxResult = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case GE_CMD_VERTEXTYPE:
|
||||
|
|
Loading…
Add table
Reference in a new issue