mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Reduce some debug GL calls in production
Also only check extension support at init()
This commit is contained in:
parent
cb90bb95ed
commit
d467327349
|
@ -29,6 +29,7 @@ static const GLsizei nShaderLogSize = 1024;
|
|||
|
||||
bool Utils::checkShaderCompileStatus(GLuint obj)
|
||||
{
|
||||
#ifdef GL_DEBUG
|
||||
GLint status;
|
||||
glGetShaderiv(obj, GL_COMPILE_STATUS, &status);
|
||||
if (status == GL_FALSE) {
|
||||
|
@ -39,11 +40,13 @@ bool Utils::checkShaderCompileStatus(GLuint obj)
|
|||
LOG(LOG_ERROR, "shader_compile error: %s\n", shader_log);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Utils::checkProgramLinkStatus(GLuint obj)
|
||||
{
|
||||
#ifdef GL_DEBUG
|
||||
GLint status;
|
||||
glGetProgramiv(obj, GL_LINK_STATUS, &status);
|
||||
if (status == GL_FALSE) {
|
||||
|
@ -53,6 +56,7 @@ bool Utils::checkProgramLinkStatus(GLuint obj)
|
|||
LOG(LOG_ERROR, "shader_link error: %s\n", shader_log);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -431,10 +431,7 @@ bool ContextImpl::isSupported(graphics::SpecialFeatures _feature) const
|
|||
case graphics::SpecialFeatures::ShaderProgramBinary:
|
||||
return m_glInfo.shaderStorage;
|
||||
case graphics::SpecialFeatures::DepthFramebufferTextures:
|
||||
if (!m_glInfo.isGLES2 || Utils::isExtensionSupported(m_glInfo, "GL_OES_depth_texture"))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return m_glInfo.depthTexture;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -92,4 +92,6 @@ void GLInfo::init() {
|
|||
LOG(LOG_WARNING, "LOD emulation not possible on this device\n");
|
||||
}
|
||||
}
|
||||
|
||||
depthTexture = !isGLES2 || Utils::isExtensionSupported(*this, "GL_OES_depth_texture");
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ struct GLInfo {
|
|||
bool texStorage = false;
|
||||
bool shaderStorage = false;
|
||||
bool msaa = false;
|
||||
bool depthTexture = false;
|
||||
Renderer renderer = Renderer::Other;
|
||||
|
||||
void init();
|
||||
|
|
|
@ -82,6 +82,7 @@ const char* GLErrorString(GLenum errorCode)
|
|||
|
||||
bool Utils::isGLError()
|
||||
{
|
||||
#ifdef GL_DEBUG
|
||||
GLenum errCode;
|
||||
const char* errString;
|
||||
|
||||
|
@ -95,11 +96,13 @@ bool Utils::isGLError()
|
|||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Utils::isFramebufferError()
|
||||
{
|
||||
#ifdef GL_DEBUG
|
||||
GLenum e = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||
switch (e) {
|
||||
// case GL_FRAMEBUFFER_UNDEFINED:
|
||||
|
@ -131,4 +134,7 @@ bool Utils::isFramebufferError()
|
|||
}
|
||||
|
||||
return e != GL_FRAMEBUFFER_COMPLETE;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user