Fix sp shader debug handling

This commit is contained in:
Benau 2018-04-20 16:25:12 +08:00
parent 91e1bd3fd1
commit 611def3c04

View File

@ -227,21 +227,26 @@ void SPShader::addAllUniforms(RenderPass rp)
GLenum type; GLenum type;
char name[100] = {}; char name[100] = {};
glGetActiveUniform(m_program[rp], i, 99, NULL, &size, &type, name); glGetActiveUniform(m_program[rp], i, 99, NULL, &size, &type, name);
if (size != 1 && m_sp_shader_debug) if (size != 1)
{
if (m_sp_shader_debug)
{ {
Log::debug("SPShader", "Array of uniforms is not supported in" Log::debug("SPShader", "Array of uniforms is not supported in"
" shader %s for %s.", m_name.c_str(), name); " shader %s for %s.", m_name.c_str(), name);
}
continue; continue;
} }
auto ret = supported_types.find(type); auto ret = supported_types.find(type);
if (ret == supported_types.end() && m_sp_shader_debug) if (ret == supported_types.end())
{ {
if (m_sp_shader_debug)
Log::debug("SPShader", "%d type not supported", (unsigned)type); Log::debug("SPShader", "%d type not supported", (unsigned)type);
continue; continue;
} }
GLuint location = glGetUniformLocation(m_program[rp], name); GLuint location = glGetUniformLocation(m_program[rp], name);
if (location == GL_INVALID_INDEX && m_sp_shader_debug) if (location == GL_INVALID_INDEX)
{ {
if (m_sp_shader_debug)
Log::debug("SPShader", "%s uniform not found", name); Log::debug("SPShader", "%s uniform not found", name);
continue; continue;
} }