projects
/
platform
/
upstream
/
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
7458513
..
2f1c4e3
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 */