mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-12 08:49:43 -06:00
do binding of VS inputs and FS outputs before linking shader programs, as per OpenGL standard.
should fix the rendering issues with strict drivers (AMD, Intel).
This commit is contained in:
@ -85,6 +85,14 @@ bool OpenGL_BuildShaderProgram(const char* vs, const char* fs, GLuint* ids, cons
|
||||
ids[2] = glCreateProgram();
|
||||
glAttachShader(ids[2], ids[0]);
|
||||
glAttachShader(ids[2], ids[1]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OpenGL_LinkShaderProgram(GLuint* ids)
|
||||
{
|
||||
int res;
|
||||
|
||||
glLinkProgram(ids[2]);
|
||||
|
||||
glGetProgramiv(ids[2], GL_LINK_STATUS, &res);
|
||||
@ -94,7 +102,7 @@ bool OpenGL_BuildShaderProgram(const char* vs, const char* fs, GLuint* ids, cons
|
||||
if (res < 1) res = 1024;
|
||||
char* log = new char[res+1];
|
||||
glGetProgramInfoLog(ids[2], res+1, NULL, log);
|
||||
printf("OpenGL: failed to link program %s: %s\n", name, log);
|
||||
printf("OpenGL: failed to link shader program: %s\n", log);
|
||||
delete[] log;
|
||||
|
||||
glDeleteShader(ids[0]);
|
||||
|
Reference in New Issue
Block a user