[gtk/wip/chergert/glproto] handle unlinked uniforms more gracefully
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto] handle unlinked uniforms more gracefully
- Date: Fri, 29 Jan 2021 07:42:11 +0000 (UTC)
commit 7943857580bc3afc4d1dcfa9f00ae33f40d3cccf
Author: Christian Hergert <chergert redhat com>
Date: Thu Jan 28 23:41:51 2021 -0800
handle unlinked uniforms more gracefully
easiest to do it deeper here than higher up and plumb through everything.
gsk/next/gskgluniformstate.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gsk/next/gskgluniformstate.c b/gsk/next/gskgluniformstate.c
index 3728a10151..3006b8977d 100644
--- a/gsk/next/gskgluniformstate.c
+++ b/gsk/next/gskgluniformstate.c
@@ -211,8 +211,12 @@ get_uniform (GskGLUniformState *state,
g_assert (program > 0);
g_assert (array_count < 256);
g_assert ((int)format >= 0 && format < GSK_GL_UNIFORM_FORMAT_LAST);
- g_assert (location < GL_MAX_UNIFORM_LOCATIONS);
g_assert (format > 0);
+ g_assert (location < GL_MAX_UNIFORM_LOCATIONS || location == (guint)-1);
+
+ /* Handle unused uniforms gracefully */
+ if (location == (guint)-1)
+ return NULL;
/* Fast path for common case (state already initialized) */
if G_LIKELY (program < state->program_info->len &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]