summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_link.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-03-07 07:52:24 -0700
committerBrian <[email protected]>2007-03-07 07:52:24 -0700
commit55821d021d87fba6551509f5612ee16d9ece977f (patch)
tree3f0e0318dc95a0d38ddb0315f3105128ca1a6591 /src/mesa/shader/slang/slang_link.c
parent6cb0aa12b82bf29e0306de7a2baa1c398732688c (diff)
Generate an error if the vertex shader does not write to gl_Position.
Diffstat (limited to 'src/mesa/shader/slang/slang_link.c')
-rw-r--r--src/mesa/shader/slang/slang_link.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 8f924739b49..e564d6d5767 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -548,8 +548,19 @@ _slang_link(GLcontext *ctx,
}
}
- if (shProg->VertexProgram)
+ if (shProg->VertexProgram) {
_slang_update_inputs_outputs(&shProg->VertexProgram->Base);
+ if (!(shProg->VertexProgram->Base.OutputsWritten & VERT_RESULT_HPOS)) {
+ /* the vertex program did not compute a vertex position */
+ if (shProg->InfoLog) {
+ _mesa_free(shProg->InfoLog);
+ }
+ shProg->InfoLog
+ = _mesa_strdup("gl_Position was not written by vertex shader");
+ shProg->LinkStatus = GL_FALSE;
+ return;
+ }
+ }
if (shProg->FragmentProgram)
_slang_update_inputs_outputs(&shProg->FragmentProgram->Base);