Workaround for a crash found in #12358 on older devices

This commit is contained in:
Henrik Rydgård committed 2019-09-28 01:11:06 +02:00
1 parent 25634d2df2
commit 9e7625c74b
2 files changed
+13 -4

No files matched your search

+9 -4
View File
@@ -458,10 +458,15 @@ void FramebufferManagerGLES::DrawActiveTexture(float x, float y, float w, float
uint32_t bindOffset;
GLRBuffer *buffer;
void *dest = drawEngineGL_->GetPushVertexBuffer()->Push(sizeof(verts), &bindOffset, &buffer);
memcpy(dest, verts, sizeof(verts));
render_->BindVertexBuffer(simple2DInputLayout_, buffer, bindOffset);
render_->Draw(GL_TRIANGLE_STRIP, 0, 4);
// Workaround: This might accidentally get called from ReportScreen screenshot-taking, and in that case
// the push buffer is not mapped. This only happens if framebuffer blit support is not available.
if (drawEngineGL_->GetPushVertexBuffer()->IsReady()) {
void *dest = drawEngineGL_->GetPushVertexBuffer()->Push(sizeof(verts), &bindOffset, &buffer);
memcpy(dest, verts, sizeof(verts));
render_->BindVertexBuffer(simple2DInputLayout_, buffer, bindOffset);
render_->Draw(GL_TRIANGLE_STRIP, 0, 4);
}
}
void FramebufferManagerGLES::ReformatFramebufferFrom(VirtualFramebuffer *vfb, GEBufferFormat old) {