projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
26b5e92
)
util: check for frag/vertShader=0 before attaching
author
Brian Paul
<brian.paul@tungstengraphics.com>
Wed, 17 Dec 2008 20:58:05 +0000
(13:58 -0700)
committer
Brian Paul
<brian.paul@tungstengraphics.com>
Thu, 18 Dec 2008 21:17:06 +0000
(14:17 -0700)
progs/util/shaderutil.c
patch
|
blob
|
history
diff --git
a/progs/util/shaderutil.c
b/progs/util/shaderutil.c
index 745851395a735ddbacb1e9b5b6571ebbb7957984..2f1c4e38b3004b180d37a38cd4cc9b215ef8c05b 100644
(file)
--- a/
progs/util/shaderutil.c
+++ b/
progs/util/shaderutil.c
@@
-6,6
+6,7
@@
*/
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/glut.h>
@@
-106,8
+107,12
@@
LinkShaders(GLuint vertShader, GLuint fragShader)
{
GLuint program = glCreateProgram_func();
- glAttachShader_func(program, fragShader);
- glAttachShader_func(program, vertShader);
+ assert(vertShader || fragShader);
+
+ if (fragShader)
+ glAttachShader_func(program, fragShader);
+ if (vertShader)
+ glAttachShader_func(program, vertShader);
glLinkProgram_func(program);
/* check link */