Example #1
0
void GPUCommon::ProcessDLQueueInternal() {
	startingTicks = CoreTiming::GetTicks();
	cyclesExecuted = 0;
	UpdateTickEstimate(std::max(busyTicks, startingTicks + cyclesExecuted));

	// Seems to be correct behaviour to process the list anyway?
	if (startingTicks < busyTicks) {
		DEBUG_LOG(G3D, "Can't execute a list yet, still busy for %lld ticks", busyTicks - startingTicks);
		//return;
	}

	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;
		} else {
			easy_guard guard(listLock);
			// At the end, we can remove it from the queue and continue.
			dlQueue.erase(std::remove(dlQueue.begin(), dlQueue.end(), listIndex), dlQueue.end());
			UpdateTickEstimate(std::max(busyTicks, startingTicks + cyclesExecuted));
		}
	}

	easy_guard guard(listLock);
	currentList = NULL;

	drawCompleteTicks = startingTicks + cyclesExecuted;
	busyTicks = std::max(busyTicks, drawCompleteTicks);
	__GeTriggerSync(WAITTYPE_GEDRAWSYNC, 1, drawCompleteTicks);
	// Since the event is in CoreTiming, we're in sync.  Just set 0 now.
	UpdateTickEstimate(0);
}
Example #2
0
bool GPUCommon::ProcessDLQueue() {
	startingTicks = CoreTiming::GetTicks();
	cyclesExecuted = 0;

	if (startingTicks < busyTicks) {
		DEBUG_LOG(HLE, "Can't execute a list yet, still busy for %lld ticks", busyTicks - startingTicks);
		return false;
	}

	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(std::remove(dlQueue.begin(), dlQueue.end(), listIndex), dlQueue.end());
		}
	}

	currentList = NULL;

	drawCompleteTicks = startingTicks + cyclesExecuted;
	busyTicks = std::max(busyTicks, drawCompleteTicks);
	__GeTriggerSync(WAITTYPE_GEDRAWSYNC, 1, drawCompleteTicks);

	return true; //no more lists!
}