1
0
Fork 0

(jroweboy)gl_rasterizer_cache.cpp: Check Framebuffer Status

This commit is contained in:
SachinVin 2021-07-24 22:37:56 +05:30
parent 9f4501aceb
commit 4439423313
1 changed files with 14 additions and 0 deletions

View File

@ -967,6 +967,20 @@ void CachedSurface::DownloadGLTexture(const Common::Rectangle<u32>& rect, GLuint
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D,
texture.handle, 0); texture.handle, 0);
} }
switch (glCheckFramebufferStatus(GL_FRAMEBUFFER)) {
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
LOG_WARNING(Render_OpenGL, "Framebuffer incomplete attachment");
break;
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
LOG_WARNING(Render_OpenGL, "Framebuffer incomplete dimensions");
break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
LOG_WARNING(Render_OpenGL, "Framebuffer incomplete missing attachment");
break;
case GL_FRAMEBUFFER_UNSUPPORTED:
LOG_WARNING(Render_OpenGL, "Framebuffer unsupported");
break;
}
glReadPixels(static_cast<GLint>(rect.left), static_cast<GLint>(rect.bottom), glReadPixels(static_cast<GLint>(rect.left), static_cast<GLint>(rect.bottom),
static_cast<GLsizei>(rect.GetWidth()), static_cast<GLsizei>(rect.GetHeight()), static_cast<GLsizei>(rect.GetWidth()), static_cast<GLsizei>(rect.GetHeight()),
tuple.format, tuple.type, &gl_buffer[buffer_offset]); tuple.format, tuple.type, &gl_buffer[buffer_offset]);