diff options
author | marha <marha@users.sourceforge.net> | 2011-04-14 08:39:30 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-04-14 08:39:30 +0000 |
commit | 898081f31f99dc35a1602a607a07d1aaff49ac40 (patch) | |
tree | b2adbc0fd699cc5dc2af141df26130e7874f9369 /mesalib/src/mesa/program/program_parse.y | |
parent | c1e91b66cbcf91645f65b9d63f115dcb5a441406 (diff) | |
parent | 019fc27ce6dc2a1809107be10d4deb80e0fa436b (diff) | |
download | vcxsrv-898081f31f99dc35a1602a607a07d1aaff49ac40.tar.gz vcxsrv-898081f31f99dc35a1602a607a07d1aaff49ac40.tar.bz2 vcxsrv-898081f31f99dc35a1602a607a07d1aaff49ac40.zip |
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/program/program_parse.y')
-rw-r--r-- | mesalib/src/mesa/program/program_parse.y | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mesalib/src/mesa/program/program_parse.y b/mesalib/src/mesa/program/program_parse.y index e63a9f1e1..292cd5ac1 100644 --- a/mesalib/src/mesa/program/program_parse.y +++ b/mesalib/src/mesa/program/program_parse.y @@ -2064,6 +2064,34 @@ optResultFaceType: ? VERT_RESULT_COL0
: FRAG_RESULT_COLOR;
}
+ | '[' INTEGER ']'
+ {
+ if (state->mode == ARB_vertex) {
+ yyerror(& @1, state, "invalid program result name");
+ YYERROR;
+ } else {
+ if (!state->option.DrawBuffers) {
+ /* From the ARB_draw_buffers spec (same text exists
+ * for ATI_draw_buffers):
+ *
+ * If this option is not specified, a fragment
+ * program that attempts to bind
+ * "result.color[n]" will fail to load, and only
+ * "result.color" will be allowed.
+ */
+ yyerror(& @1, state,
+ "result.color[] used without "
+ "`OPTION ARB_draw_buffers' or "
+ "`OPTION ATI_draw_buffers'");
+ YYERROR;
+ } else if ($2 >= state->MaxDrawBuffers) {
+ yyerror(& @1, state,
+ "result.color[] exceeds MAX_DRAW_BUFFERS_ARB");
+ YYERROR;
+ }
+ $$ = FRAG_RESULT_DATA0 + $2;
+ }
+ }
| FRONT
{
if (state->mode == ARB_vertex) {
@@ -2681,6 +2709,7 @@ _mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *st state->MaxClipPlanes = ctx->Const.MaxClipPlanes;
state->MaxLights = ctx->Const.MaxLights;
state->MaxProgramMatrices = ctx->Const.MaxProgramMatrices;
+ state->MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
state->state_param_enum = (target == GL_VERTEX_PROGRAM_ARB)
? STATE_VERTEX_PROGRAM : STATE_FRAGMENT_PROGRAM;
|