mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-02 20:11:15 +00:00
Add extra logging for shader compilation errors
This commit is contained in:
parent
03da1f0d9b
commit
1e117abd68
@ -15,8 +15,17 @@ static GLuint CompileShader(GLenum type, const char* source)
|
||||
GLint success;
|
||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
|
||||
if (!success) {
|
||||
GLint logLength = 0;
|
||||
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength);
|
||||
if (logLength > 0) {
|
||||
std::vector<char> log(logLength);
|
||||
glGetShaderInfoLog(shader, logLength, nullptr, log.data());
|
||||
SDL_Log("Shader compile error: %s", log.data());
|
||||
}
|
||||
else {
|
||||
SDL_Log("CompileShader (%s)", SDL_GetError());
|
||||
}
|
||||
glDeleteShader(shader);
|
||||
SDL_Log("CompileShader (%s)", SDL_GetError());
|
||||
return 0;
|
||||
}
|
||||
return shader;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user