mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Simplify ProcessDLQueue() slightly.
This commit is contained in:
parent
b17b23f1f2
commit
3aa2db9a8e
2 changed files with 20 additions and 18 deletions
|
@ -517,34 +517,35 @@ inline void GPUCommon::UpdateState(GPUState state)
|
|||
downcount = 0;
|
||||
}
|
||||
|
||||
bool GPUCommon::ProcessDLQueue()
|
||||
{
|
||||
int GPUCommon::GetNextListIndex() {
|
||||
auto iter = dlQueue.begin();
|
||||
if (iter != dlQueue.end()) {
|
||||
return *iter;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
bool GPUCommon::ProcessDLQueue() {
|
||||
startingTicks = CoreTiming::GetTicks();
|
||||
cyclesExecuted = 0;
|
||||
|
||||
if (startingTicks < busyTicks)
|
||||
{
|
||||
if (startingTicks < busyTicks) {
|
||||
DEBUG_LOG(HLE, "Can't execute a list yet, still busy for %lld ticks", busyTicks - startingTicks);
|
||||
return false;
|
||||
}
|
||||
|
||||
DisplayListQueue::iterator iter = dlQueue.begin();
|
||||
while (iter != dlQueue.end())
|
||||
{
|
||||
DisplayList &l = dls[*iter];
|
||||
DEBUG_LOG(G3D,"Okay, starting DL execution at %08x - stall = %08x", l.pc, l.stall);
|
||||
if (!InterpretList(l))
|
||||
{
|
||||
for (int listIndex = GetNextListIndex(); listIndex != -1; listIndex = GetNextListIndex()) {
|
||||
DisplayList &l = dls[listIndex];
|
||||
DEBUG_LOG(G3D, "Okay, starting DL execution at %08x - stall = %08x", l.pc, l.stall);
|
||||
if (!InterpretList(l)) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//At the end, we can remove it from the queue and continue
|
||||
dlQueue.erase(iter);
|
||||
//this invalidated the iterator, let's fix it
|
||||
iter = dlQueue.begin();
|
||||
} else {
|
||||
// At the end, we can remove it from the queue and continue.
|
||||
dlQueue.erase(std::remove(dlQueue.begin(), dlQueue.end(), listIndex), dlQueue.end());
|
||||
}
|
||||
}
|
||||
|
||||
currentList = NULL;
|
||||
|
||||
drawCompleteTicks = startingTicks + cyclesExecuted;
|
||||
|
|
|
@ -38,6 +38,7 @@ protected:
|
|||
void UpdateState(GPUState state);
|
||||
void PopDLQueue();
|
||||
void CheckDrawSync();
|
||||
int GetNextListIndex();
|
||||
|
||||
typedef std::list<int> DisplayListQueue;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue