mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +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)
|
bool Utils::checkShaderCompileStatus(GLuint obj)
|
||||||
{
|
{
|
||||||
|
#ifdef GL_DEBUG
|
||||||
GLint status;
|
GLint status;
|
||||||
glGetShaderiv(obj, GL_COMPILE_STATUS, &status);
|
glGetShaderiv(obj, GL_COMPILE_STATUS, &status);
|
||||||
if (status == GL_FALSE) {
|
if (status == GL_FALSE) {
|
||||||
|
@ -39,11 +40,13 @@ bool Utils::checkShaderCompileStatus(GLuint obj)
|
||||||
LOG(LOG_ERROR, "shader_compile error: %s\n", shader_log);
|
LOG(LOG_ERROR, "shader_compile error: %s\n", shader_log);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::checkProgramLinkStatus(GLuint obj)
|
bool Utils::checkProgramLinkStatus(GLuint obj)
|
||||||
{
|
{
|
||||||
|
#ifdef GL_DEBUG
|
||||||
GLint status;
|
GLint status;
|
||||||
glGetProgramiv(obj, GL_LINK_STATUS, &status);
|
glGetProgramiv(obj, GL_LINK_STATUS, &status);
|
||||||
if (status == GL_FALSE) {
|
if (status == GL_FALSE) {
|
||||||
|
@ -53,6 +56,7 @@ bool Utils::checkProgramLinkStatus(GLuint obj)
|
||||||
LOG(LOG_ERROR, "shader_link error: %s\n", shader_log);
|
LOG(LOG_ERROR, "shader_link error: %s\n", shader_log);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -431,10 +431,7 @@ bool ContextImpl::isSupported(graphics::SpecialFeatures _feature) const
|
||||||
case graphics::SpecialFeatures::ShaderProgramBinary:
|
case graphics::SpecialFeatures::ShaderProgramBinary:
|
||||||
return m_glInfo.shaderStorage;
|
return m_glInfo.shaderStorage;
|
||||||
case graphics::SpecialFeatures::DepthFramebufferTextures:
|
case graphics::SpecialFeatures::DepthFramebufferTextures:
|
||||||
if (!m_glInfo.isGLES2 || Utils::isExtensionSupported(m_glInfo, "GL_OES_depth_texture"))
|
return m_glInfo.depthTexture;
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,4 +92,6 @@ void GLInfo::init() {
|
||||||
LOG(LOG_WARNING, "LOD emulation not possible on this device\n");
|
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 texStorage = false;
|
||||||
bool shaderStorage = false;
|
bool shaderStorage = false;
|
||||||
bool msaa = false;
|
bool msaa = false;
|
||||||
|
bool depthTexture = false;
|
||||||
Renderer renderer = Renderer::Other;
|
Renderer renderer = Renderer::Other;
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
|
|
@ -82,6 +82,7 @@ const char* GLErrorString(GLenum errorCode)
|
||||||
|
|
||||||
bool Utils::isGLError()
|
bool Utils::isGLError()
|
||||||
{
|
{
|
||||||
|
#ifdef GL_DEBUG
|
||||||
GLenum errCode;
|
GLenum errCode;
|
||||||
const char* errString;
|
const char* errString;
|
||||||
|
|
||||||
|
@ -95,11 +96,13 @@ bool Utils::isGLError()
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::isFramebufferError()
|
bool Utils::isFramebufferError()
|
||||||
{
|
{
|
||||||
|
#ifdef GL_DEBUG
|
||||||
GLenum e = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
GLenum e = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||||
switch (e) {
|
switch (e) {
|
||||||
// case GL_FRAMEBUFFER_UNDEFINED:
|
// case GL_FRAMEBUFFER_UNDEFINED:
|
||||||
|
@ -131,4 +134,7 @@ bool Utils::isFramebufferError()
|
||||||
}
|
}
|
||||||
|
|
||||||
return e != GL_FRAMEBUFFER_COMPLETE;
|
return e != GL_FRAMEBUFFER_COMPLETE;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user