[gtk/wip/otte/conic: 1/3] glrenderer: Emit more useful error messages
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/conic: 1/3] glrenderer: Emit more useful error messages
- Date: Thu, 3 Dec 2020 05:03:39 +0000 (UTC)
commit d1e8772740d33ebc0c0e1365fc563ea818169364
Author: Benjamin Otte <otte redhat com>
Date: Thu Dec 3 05:33:30 2020 +0100
glrenderer: Emit more useful error messages
In particular, don't print some random string, blame ourselves for not
tracking what went wrong.
gsk/gl/gskglrenderer.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index bb09be8bdd..cff7b77c6e 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -54,6 +54,8 @@
glGetUniformLocation(programs->program_name ## _program.id, "u_"
#uniform_basename);\
if (programs->program_name ## _program.program_name.uniform_basename ## _location == -1) \
{ \
+ g_set_error (error, GDK_GL_ERROR, GDK_GL_ERROR_LINK_FAILED, \
+ "Failed to find variable \"u_%s\" in shader", #uniform_basename); \
g_clear_pointer (&programs, gsk_gl_renderer_programs_unref); \
goto out; \
} \
@@ -3363,7 +3365,7 @@ out:
if (error && !(*error) && !programs)
g_set_error (error, GDK_GL_ERROR, GDK_GL_ERROR_COMPILATION_FAILED,
- "Failed to compile all shader programs"); /* Probably, eh. */
+ "Failed to emit an error in the correct place - now compilation failed and we don't know
why."); /* Probably, eh. */
return programs;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]