mirror of https://github.com/mgba-emu/mgba.git
Qt: Refactor and fix dequeueAll so keep mode keeps last draw tex too
This commit is contained in:
parent
0ac446beda
commit
83578d915b
|
@ -861,17 +861,23 @@ void PainterGL::dequeueAll(bool keep) {
|
|||
m_free.append(buffer);
|
||||
}
|
||||
}
|
||||
m_queueTex.clear();
|
||||
m_freeTex.clear();
|
||||
for (auto tex : m_bridgeTexes) {
|
||||
m_freeTex.enqueue(tex);
|
||||
}
|
||||
m_bridgeTexIn = m_freeTex.dequeue();
|
||||
m_bridgeTexOut = std::numeric_limits<GLuint>::max();
|
||||
if (m_buffer && !keep) {
|
||||
m_free.append(m_buffer);
|
||||
m_buffer = nullptr;
|
||||
}
|
||||
|
||||
m_queueTex.clear();
|
||||
m_freeTex.clear();
|
||||
for (auto tex : m_bridgeTexes) {
|
||||
if (keep && tex == m_bridgeTexIn) {
|
||||
continue;
|
||||
}
|
||||
m_freeTex.enqueue(tex);
|
||||
}
|
||||
if (!keep) {
|
||||
m_bridgeTexIn = m_freeTex.dequeue();
|
||||
m_bridgeTexOut = std::numeric_limits<GLuint>::max();
|
||||
}
|
||||
}
|
||||
|
||||
void PainterGL::setVideoProxy(std::shared_ptr<VideoProxy> proxy) {
|
||||
|
|
Loading…
Reference in New Issue