summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_vtx_api.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_vtx_api.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_vtx_api.c')
-rw-r--r--src/mesa/tnl/t_vtx_api.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c
index 7eccacc5047..1bc84ee53d3 100644
--- a/src/mesa/tnl/t_vtx_api.c
+++ b/src/mesa/tnl/t_vtx_api.c
@@ -724,21 +724,20 @@ static void GLAPIENTRY _tnl_Begin( GLenum mode )
{
GET_CURRENT_CONTEXT( ctx );
- if ((ctx->VertexProgram.Enabled
- && !ctx->VertexProgram.Current->Instructions) ||
- (ctx->FragmentProgram.Enabled
- && !ctx->FragmentProgram.Current->Instructions)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBegin (invalid vertex/fragment program)");
- return;
- }
-
if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1) {
TNLcontext *tnl = TNL_CONTEXT(ctx);
int i;
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->Driver.NotifyBegin &&
tnl->Driver.NotifyBegin( ctx, mode )))
ctx->Exec->Begin(mode);