summaryrefslogtreecommitdiff
path: root/src/mesa/shader/arbprogram.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-02-04 16:49:35 -0700
committerBrian Paul <brianp@vmware.com>2010-02-04 16:53:27 -0700
commit4ac9c80e5beea26e13ccf12ce6bd9ee051c229f5 (patch)
tree80b3ca588ae0befc950beec84fe3fdc89fd2890d /src/mesa/shader/arbprogram.c
parent0f763c5b000ad87c43da12bec014d5e367ae64fe (diff)
mesa: change ctx->Driver.ProgramStringNotify() to return GLboolean
GL_TRUE indicates that the driver accepts the program. GL_FALSE indicates the program can't be compiled/translated by the driver for some reason (too many resources used, etc). Propogate this result up to the GL API: set GL_INVALID_OPERATION error if glProgramString() was called. Set shader program link status to GL_FALSE if glLinkProgram() was called. At this point, drivers still don't do any program checking and always return GL_TRUE.
Diffstat (limited to 'src/mesa/shader/arbprogram.c')
-rw-r--r--src/mesa/shader/arbprogram.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c
index 746138071e..7e3040a6ef 100644
--- a/src/mesa/shader/arbprogram.c
+++ b/src/mesa/shader/arbprogram.c
@@ -489,8 +489,13 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
return;
}
- if (ctx->Program.ErrorPos == -1 && ctx->Driver.ProgramStringNotify)
- ctx->Driver.ProgramStringNotify( ctx, target, base );
+ if (ctx->Program.ErrorPos == -1) {
+ /* finally, give the program to the driver for translation/checking */
+ if (!ctx->Driver.ProgramStringNotify(ctx, target, base)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glProgramStringARB(rejected by driver");
+ }
+ }
}