mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
GL: Fix bug where we could crash if a readback happened at the same time as a buffer expansion.
This commit is contained in:
parent
7a8310ae5e
commit
ba5208efaa
1 changed files with 8 additions and 4 deletions
|
@ -455,15 +455,18 @@ void GLRenderManager::Run(int frame) {
|
|||
BeginSubmitFrame(frame);
|
||||
|
||||
FrameData &frameData = frameData_[frame];
|
||||
for (auto iter : frameData.activePushBuffers) {
|
||||
iter->Flush();
|
||||
iter->UnmapDevice();
|
||||
}
|
||||
|
||||
auto &stepsOnThread = frameData_[frame].steps;
|
||||
auto &initStepsOnThread = frameData_[frame].initSteps;
|
||||
// queueRunner_.LogSteps(stepsOnThread);
|
||||
queueRunner_.RunInitSteps(initStepsOnThread);
|
||||
|
||||
// Run this after RunInitSteps so any fresh GLRBuffers for the pushbuffers can get created.
|
||||
for (auto iter : frameData.activePushBuffers) {
|
||||
iter->Flush();
|
||||
iter->UnmapDevice();
|
||||
}
|
||||
|
||||
queueRunner_.RunSteps(stepsOnThread);
|
||||
stepsOnThread.clear();
|
||||
initStepsOnThread.clear();
|
||||
|
@ -601,6 +604,7 @@ void GLPushBuffer::Flush() {
|
|||
if (!buffers_[buf_].deviceMemory && writePtr_) {
|
||||
auto &info = buffers_[buf_];
|
||||
if (info.flushOffset != 0) {
|
||||
assert(info.buffer->buffer);
|
||||
glBindBuffer(target_, info.buffer->buffer);
|
||||
glBufferSubData(target_, 0, info.flushOffset, info.localMemory);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue