forked from organicmaps/organicmaps
suppressing OpenGL calls for testing purpose.
This commit is contained in:
parent
365b5f448d
commit
fa1710c108
3 changed files with 28 additions and 23 deletions
|
@ -129,29 +129,32 @@ namespace yg
|
|||
|
||||
void FrameBuffer::checkStatus()
|
||||
{
|
||||
if (!yg::gl::g_doFakeOpenGLCalls)
|
||||
{
|
||||
#ifdef OMIM_GL_ES
|
||||
GLenum res = glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
|
||||
if (res == GL_FRAMEBUFFER_UNSUPPORTED_OES)
|
||||
LOG(LINFO, ("unsupported combination of attached target formats. could be possibly skipped"));
|
||||
else if (res == GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES)
|
||||
LOG(LINFO, ("incomplete attachement"));
|
||||
else if (res == GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES)
|
||||
LOG(LINFO, ("incomplete missing attachement"));
|
||||
else if (res == GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES)
|
||||
{
|
||||
LOG(LINFO, ("incomplete dimensions"));
|
||||
}
|
||||
GLenum res = glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
|
||||
if (res == GL_FRAMEBUFFER_UNSUPPORTED_OES)
|
||||
LOG(LINFO, ("unsupported combination of attached target formats. could be possibly skipped"));
|
||||
else if (res == GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES)
|
||||
LOG(LINFO, ("incomplete attachement"));
|
||||
else if (res == GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES)
|
||||
LOG(LINFO, ("incomplete missing attachement"));
|
||||
else if (res == GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES)
|
||||
{
|
||||
LOG(LINFO, ("incomplete dimensions"));
|
||||
}
|
||||
#else
|
||||
GLenum res = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
|
||||
if (res == GL_FRAMEBUFFER_UNSUPPORTED)
|
||||
{
|
||||
LOG(LINFO, ("unsupported combination of attached target formats. could be possibly skipped"));
|
||||
}
|
||||
else if (res != GL_FRAMEBUFFER_COMPLETE_EXT)
|
||||
{
|
||||
LOG(LERROR, ("incomplete framebuffer"));
|
||||
}
|
||||
GLenum res = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
|
||||
if (res == GL_FRAMEBUFFER_UNSUPPORTED)
|
||||
{
|
||||
LOG(LINFO, ("unsupported combination of attached target formats. could be possibly skipped"));
|
||||
}
|
||||
else if (res != GL_FRAMEBUFFER_COMPLETE_EXT)
|
||||
{
|
||||
LOG(LERROR, ("incomplete framebuffer"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace yg
|
|||
{
|
||||
namespace gl
|
||||
{
|
||||
bool g_doFakeOpenGLCalls = false;
|
||||
bool g_isBufferObjectsSupported = true;
|
||||
bool g_isFramebufferSupported = true;
|
||||
bool g_isRenderbufferSupported = true;
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace yg
|
|||
{
|
||||
namespace gl
|
||||
{
|
||||
extern bool g_doFakeOpenGLCalls; //< for testing support
|
||||
extern bool g_isBufferObjectsSupported;
|
||||
extern bool g_isFramebufferSupported;
|
||||
extern bool g_isRenderbufferSupported;
|
||||
|
@ -53,11 +54,11 @@ namespace yg
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#define OGLCHECK(f) do {f; yg::gl::CheckError(SRC());} while(false)
|
||||
#define OGLCHECKAFTER yg::gl::CheckError(SRC())
|
||||
#define OGLCHECK(f) do {if (!g_doFakeOpenGLCalls) { f; yg::gl::CheckError(SRC()); } } while(false)
|
||||
#define OGLCHECKAFTER if (!g_doFakeOpenGLCalls) yg::gl::CheckError(SRC())
|
||||
#define EGLCHECK do {yg::gl::CheckEGLError(SRC());} while(false)
|
||||
#else
|
||||
#define OGLCHECK(f) f
|
||||
#define OGLCHECK(f) if (!g_doFakeOpenGLCalls) f
|
||||
#define OGLCHECKAFTER
|
||||
#define EGLCHECK
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue