diff options
author | Jannik Vogel <email@jannikvogel.de> | 2016-12-04 12:44:29 +0100 |
---|---|---|
committer | Jannik Vogel <email@jannikvogel.de> | 2016-12-05 21:11:24 +0100 |
commit | 0edc98686115ccfafc6b496eae44b5f24a9627a4 (patch) | |
tree | 7dc407bccb681438c899ad3eaec9f0453e96cb3e /src/video_core/renderer_opengl | |
parent | Merge pull request #2200 from j-selby/fix-mingw-crash (diff) | |
download | yuzu-0edc98686115ccfafc6b496eae44b5f24a9627a4.tar yuzu-0edc98686115ccfafc6b496eae44b5f24a9627a4.tar.gz yuzu-0edc98686115ccfafc6b496eae44b5f24a9627a4.tar.bz2 yuzu-0edc98686115ccfafc6b496eae44b5f24a9627a4.tar.lz yuzu-0edc98686115ccfafc6b496eae44b5f24a9627a4.tar.xz yuzu-0edc98686115ccfafc6b496eae44b5f24a9627a4.tar.zst yuzu-0edc98686115ccfafc6b496eae44b5f24a9627a4.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_util.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp index fe07aa6eb..9a7a39b95 100644 --- a/src/video_core/renderer_opengl/gl_shader_util.cpp +++ b/src/video_core/renderer_opengl/gl_shader_util.cpp @@ -31,7 +31,7 @@ GLuint LoadProgram(const char* vertex_shader, const char* fragment_shader) { if (info_log_length > 1) { std::vector<char> vertex_shader_error(info_log_length); glGetShaderInfoLog(vertex_shader_id, info_log_length, nullptr, &vertex_shader_error[0]); - if (result) { + if (result == GL_TRUE) { LOG_DEBUG(Render_OpenGL, "%s", &vertex_shader_error[0]); } else { LOG_ERROR(Render_OpenGL, "Error compiling vertex shader:\n%s", &vertex_shader_error[0]); @@ -51,7 +51,7 @@ GLuint LoadProgram(const char* vertex_shader, const char* fragment_shader) { if (info_log_length > 1) { std::vector<char> fragment_shader_error(info_log_length); glGetShaderInfoLog(fragment_shader_id, info_log_length, nullptr, &fragment_shader_error[0]); - if (result) { + if (result == GL_TRUE) { LOG_DEBUG(Render_OpenGL, "%s", &fragment_shader_error[0]); } else { LOG_ERROR(Render_OpenGL, "Error compiling fragment shader:\n%s", @@ -75,13 +75,19 @@ GLuint LoadProgram(const char* vertex_shader, const char* fragment_shader) { if (info_log_length > 1) { std::vector<char> program_error(info_log_length); glGetProgramInfoLog(program_id, info_log_length, nullptr, &program_error[0]); - if (result) { + if (result == GL_TRUE) { LOG_DEBUG(Render_OpenGL, "%s", &program_error[0]); } else { LOG_ERROR(Render_OpenGL, "Error linking shader:\n%s", &program_error[0]); } } + // If the program linking failed at least one of the shaders was probably bad + if (result == GL_FALSE) { + LOG_ERROR(Render_OpenGL, "Vertex shader:\n%s", vertex_shader); + LOG_ERROR(Render_OpenGL, "Fragment shader:\n%s", fragment_shader); + } + glDeleteShader(vertex_shader_id); glDeleteShader(fragment_shader_id); |