From 6d460af6af77a0d5a5b568bcd6094b98e249ba93 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Apr 2004 14:16:46 +0000 Subject: 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. --- src/mesa/tnl/t_save_playback.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mesa/tnl/t_save_playback.c') 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 ); -- cgit v1.2.3