mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
nv2a/gl: Check GL_LINK_STATUS when loading cached shaders
The GL docs indicate that GL_LINK_STATUS will be set to false in cases where the cached binary cannot be loaded successfully. This seems to be separate from the listed glGetError failure modes, indicating that both likely need to be tested.
This commit is contained in:
@@ -324,6 +324,15 @@ bool pgraph_gl_shader_load_from_memory(ShaderBinding *binding)
|
||||
return false;
|
||||
}
|
||||
|
||||
GLint link_status = GL_FALSE;
|
||||
glGetProgramiv(gl_program, GL_LINK_STATUS, &link_status);
|
||||
if (!link_status) {
|
||||
NV2A_DPRINTF(
|
||||
"failed to load shader binary from disk: link status is FALSE\n");
|
||||
glDeleteProgram(gl_program);
|
||||
return false;
|
||||
}
|
||||
|
||||
glUseProgram(gl_program);
|
||||
|
||||
g_free(binding->program);
|
||||
|
||||
Reference in New Issue
Block a user