diff --git a/GPU/GLES/FramebufferManagerGLES.cpp b/GPU/GLES/FramebufferManagerGLES.cpp index b34c4b5572..b2d814bb05 100644 --- a/GPU/GLES/FramebufferManagerGLES.cpp +++ b/GPU/GLES/FramebufferManagerGLES.cpp @@ -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) { diff --git a/ext/native/thin3d/GLRenderManager.h b/ext/native/thin3d/GLRenderManager.h index 7b38c024e8..7fa35e8231 100644 --- a/ext/native/thin3d/GLRenderManager.h +++ b/ext/native/thin3d/GLRenderManager.h @@ -232,6 +232,10 @@ public: void Map(); void Unmap(); + bool IsReady() const { + return writePtr_ != nullptr; + } + // When using the returned memory, make sure to bind the returned vkbuf. // This will later allow for handling overflow correctly. size_t Allocate(size_t numBytes, GLRBuffer **vkbuf) {