summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_save_playback.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-04-23 14:16:46 +0000
committerBrian Paul <[email protected]>2004-04-23 14:16:46 +0000
commit6d460af6af77a0d5a5b568bcd6094b98e249ba93 (patch)
tree08656028582b357d5c9730c521cc3e1770604c50 /src/mesa/tnl/t_save_playback.c
parent384800fe12e368f3489111de4572dbc8846a7dea (diff)
Added ctx->Vertex/FragmentProgram._Enable flags. Set when vertex/fragment
program is enabled AND the currently bound program is valid. Check _Enable instead of Enable to prevent things from blowing up when someone calls glEnable(GL_VERTEX_PROGRAM_ARB) without actually defining a program.
Diffstat (limited to 'src/mesa/tnl/t_save_playback.c')
-rw-r--r--src/mesa/tnl/t_save_playback.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/tnl/t_save_playback.c b/src/mesa/tnl/t_save_playback.c
index 264748e9b11..dc9ffa8db4b 100644
--- a/src/mesa/tnl/t_save_playback.c
+++ b/src/mesa/tnl/t_save_playback.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.0
+ * Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -199,6 +199,13 @@ void _tnl_playback_vertex_list( GLcontext *ctx, void *data )
if (ctx->NewState)
_mesa_update_state( ctx );
+ if ((ctx->VertexProgram.Enabled && !ctx->VertexProgram._Enabled) ||
+ (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBegin (invalid vertex/fragment program)");
+ return;
+ }
+
if (tnl->pipeline.build_state_changes)
_tnl_validate_pipeline( ctx );