softgpu: Flush on offset changes.

This commit is contained in:
Unknown W. Brackets 2022-01-16 08:13:42 -08:00
parent d6fa301ab1
commit 9466dc6397
2 changed files with 13 additions and 1 deletions

View file

@ -160,9 +160,17 @@ void BinManager::UpdateState() {
int newMaxTasks = selfRender ? 1 : g_threadManager.GetNumLooperThreads();
if (newMaxTasks > MAX_POSSIBLE_TASKS)
newMaxTasks = MAX_POSSIBLE_TASKS;
// We don't want to overlap wrong, so flush any pending.
if (maxTasks_ != newMaxTasks) {
maxTasks_ = newMaxTasks;
tasksSplit_ = false;
Flush();
}
// Our bin sizes are based on offset, so if that changes we have to flush.
if (queueOffsetX_ != gstate.getOffsetX16() || queueOffsetY_ != gstate.getOffsetY16()) {
Flush();
queueOffsetX_ = gstate.getOffsetX16();
queueOffsetY_ = gstate.getOffsetY16();
}
}
@ -325,6 +333,8 @@ void BinManager::Flush() {
queueRange_.y1 = 0x7FFFFFFF;
queueRange_.x2 = 0;
queueRange_.y2 = 0;
queueOffsetX_ = -1;
queueOffsetY_ = -1;
}
inline BinCoords BinCoords::Intersect(const BinCoords &range) const {

View file

@ -178,6 +178,8 @@ private:
BinCoords scissor_;
BinQueue<BinItem, 1024> queue_;
BinCoords queueRange_;
int queueOffsetX_ = -1;
int queueOffsetY_ = -1;
int maxTasks_ = 1;
bool tasksSplit_ = false;