summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-02-25 20:09:40 -0700
committerBrian Paul <brianp@vmware.com>2010-02-25 20:09:42 -0700
commit6f494186f6f85aeaa291e37cac50342668005957 (patch)
tree0ab0cb6de2e3b802c3965e8451b053190a396d4c
parent0b0f3ac7d303226b80f69d678dc831175c5e140b (diff)
util: allow single shader in piglit_link_simple_program()
We sometimes only need a vertex shader or a fragment shader and not both.
-rw-r--r--tests/util/piglit-util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index ce036c46..ba4efa00 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -470,8 +470,10 @@ GLint piglit_link_simple_program(GLint vs, GLint fs)
GLint prog, ok;
prog = glCreateProgram();
- glAttachShader(prog, fs);
- glAttachShader(prog, vs);
+ if (fs)
+ glAttachShader(prog, fs);
+ if (vs)
+ glAttachShader(prog, vs);
glLinkProgram(prog);
glGetProgramiv(prog, GL_LINK_STATUS, &ok);