diff options
author | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2023-02-27 13:15:02 +0100 |
---|---|---|
committer | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2023-03-06 09:56:23 +0100 |
commit | db952f9ffd5eef714de1b94719a39cacbff09013 (patch) | |
tree | 1bd84e16ad2f83da6ac0fe8a4b6a10426a87ccd0 | |
parent | 84ced0fac5203e8ca4a4f86f3d3377db3a544e9d (diff) | |
download | mesa-demos-db952f9ffd5eef714de1b94719a39cacbff09013.tar.gz |
tests: use gl2-functions for logs
glGetInfoLogARB is only available in ARB_shader_objects, which we don't
really use. So let's use the GL2 equivialents instead.
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
-rw-r--r-- | src/tests/shader_api.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/tests/shader_api.c b/src/tests/shader_api.c index 3da001a9..efc100ae 100644 --- a/src/tests/shader_api.c +++ b/src/tests/shader_api.c @@ -42,30 +42,33 @@ static void assert_error_test(const char *file, int line, GLenum expect) #define assert_error(err) assert_error_test(__FILE__, __LINE__, (err)) -static void check_status(GLuint id, GLenum pname, void (GLAPIENTRY *query)(GLuint, GLenum, GLint *)) -{ - GLint status; - - query(id, pname, &status); - if (!status) - { - char info[65536]; - - fprintf(stderr, "Compilation/link failure:\n"); - glGetInfoLogARB(id, sizeof(info), NULL, info); - fprintf(stderr, "%s\n", info); - exit(1); - } -} - static void check_compile_status(GLuint id) { - check_status(id, GL_COMPILE_STATUS, glGetShaderiv); + GLint status; + + glGetShaderiv(id, GL_COMPILE_STATUS, &status); + if (!status) { + char info[65536]; + fprintf(stderr, "Compilation failure:\n"); + glGetShaderInfoLog(id, sizeof(info), NULL, info); + fprintf(stderr, "%s\n", info); + exit(1); + } } static void check_link_status(GLuint id) { - check_status(id, GL_LINK_STATUS, glGetProgramiv); + GLint status; + + glGetProgramiv(id, GL_LINK_STATUS, &status); + if (!status) { + char info[65536]; + + fprintf(stderr, "Compilation/link failure:\n"); + glGetProgramInfoLog(id, sizeof(info), NULL, info); + fprintf(stderr, "%s\n", info); + exit(1); + } } static GLuint make_shader(GLenum type, const char *src) |