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.
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
{
ACcontext *ac = AC_CONTEXT(ctx);
ASSERT(ctx->Array.Vertex.Enabled
- || (ctx->VertexProgram.Enabled && ctx->Array.VertexAttrib[0].Enabled));
+ || (ctx->VertexProgram._Enabled && ctx->Array.VertexAttrib[0].Enabled));
ac->Raw.Vertex = ctx->Array.Vertex;
STRIDE_ARRAY(ac->Raw.Vertex, ac->start);
ac->IsCached.Vertex = GL_FALSE;
*/
if (!ctx->Eval.Map1Vertex4 &&
!ctx->Eval.Map1Vertex3 &&
- !(ctx->VertexProgram.Enabled && ctx->Eval.Map1Attrib[VERT_ATTRIB_POS]))
+ !(ctx->VertexProgram._Enabled && ctx->Eval.Map1Attrib[VERT_ATTRIB_POS]))
return;
du = ctx->Eval.MapGrid1du;
*/
if (!ctx->Eval.Map2Vertex4 &&
!ctx->Eval.Map2Vertex3 &&
- !(ctx->VertexProgram.Enabled && ctx->Eval.Map2Attrib[VERT_ATTRIB_POS]))
+ !(ctx->VertexProgram._Enabled && ctx->Eval.Map2Attrib[VERT_ATTRIB_POS]))
return;
du = ctx->Eval.MapGrid2du;
-
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.1
*
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
*
/* Always need vertex positions */
if (!ctx->Array.Vertex.Enabled
- && !(ctx->VertexProgram.Enabled && ctx->Array.VertexAttrib[0].Enabled))
+ && !(ctx->VertexProgram._Enabled && ctx->Array.VertexAttrib[0].Enabled))
return GL_FALSE;
/* Vertex buffer object tests */
/* Always need vertex positions */
if (!ctx->Array.Vertex.Enabled
- && !(ctx->VertexProgram.Enabled && ctx->Array.VertexAttrib[0].Enabled))
+ && !(ctx->VertexProgram._Enabled && ctx->Array.VertexAttrib[0].Enabled))
return GL_FALSE;
if (ctx->Const.CheckArrayBounds) {
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
(((CTX)->Light.Enabled && \
(CTX)->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) \
|| (CTX)->Fog.ColorSumEnabled \
- || ((CTX)->VertexProgram.Enabled && \
+ || ((CTX)->VertexProgram._Enabled && \
((CTX)->VertexProgram.Current->InputsRead & VERT_BIT_COLOR1)) \
- || ((CTX)->FragmentProgram.Enabled && \
+ || ((CTX)->FragmentProgram._Enabled && \
((CTX)->FragmentProgram.Current->InputsRead & FRAG_BIT_COL1)) \
)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->FragmentProgram.Enabled
- && !ctx->FragmentProgram.Current->Instructions) {
+ if (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glDrawPixels (invalid fragment program)");
return;
GLint destx, desty;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->FragmentProgram.Enabled
- && !ctx->FragmentProgram.Current->Instructions) {
+ if (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyPixels (invalid fragment program)");
return;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->FragmentProgram.Enabled
- && !ctx->FragmentProgram.Current->Instructions) {
+ if (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBitmap (invalid fragment program)");
return;
*/
struct vertex_program_state
{
- GLboolean Enabled; /**< GL_VERTEX_PROGRAM_NV */
- GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_NV */
- GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_NV */
- struct vertex_program *Current; /**< ptr to currently bound program */
+ GLboolean Enabled; /**< GL_VERTEX_PROGRAM_NV */
+ GLboolean _Enabled; /**< Really enabled? */
+ GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_NV */
+ GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ struct vertex_program *Current; /**< ptr to currently bound program */
GLenum TrackMatrix[MAX_NV_VERTEX_PROGRAM_PARAMS / 4];
GLenum TrackMatrixTransform[MAX_NV_VERTEX_PROGRAM_PARAMS / 4];
struct fragment_program_state
{
GLboolean Enabled; /* GL_VERTEX_PROGRAM_NV */
+ GLboolean _Enabled; /* Really enabled? */
struct fragment_program *Current; /* ptr to currently bound program */
struct fp_machine Machine; /* machine state */
GLfloat Parameters[MAX_NV_FRAGMENT_PROGRAM_PARAMS][4]; /* Env params */
if (ctx->NewState)
_mesa_update_state( ctx );
- if (ctx->VertexProgram.Enabled) {
+ if (ctx->VertexProgram._Enabled) {
/* XXX implement this */
_mesa_problem(ctx, "Vertex programs not implemented for glRasterPos");
return;
-/**
- * \file state.c
- * State management.
- *
- * This file manages recalculation of derived values in the __GLcontextRec.
- * Also, this is where we initialize the API dispatch table.
- */
-
/*
* Mesa 3-D graphics library
* Version: 6.1
*/
+/**
+ * \file state.c
+ * State management.
+ *
+ * This file manages recalculation of derived values in the __GLcontextRec.
+ * Also, this is where we initialize the API dispatch table.
+ */
+
#include "glheader.h"
#include "accum.h"
#include "api_loopback.h"
/* find min of _MaxElement values for all enabled arrays */
/* 0 */
- if (ctx->VertexProgram.Enabled
+ if (ctx->VertexProgram._Enabled
&& ctx->Array.VertexAttrib[VERT_ATTRIB_POS].Enabled) {
min = ctx->Array.VertexAttrib[VERT_ATTRIB_POS]._MaxElement;
}
}
/* 1 */
- if (ctx->VertexProgram.Enabled
+ if (ctx->VertexProgram._Enabled
&& ctx->Array.VertexAttrib[VERT_ATTRIB_WEIGHT].Enabled) {
min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_WEIGHT]._MaxElement);
}
/* no conventional vertex weight array */
/* 2 */
- if (ctx->VertexProgram.Enabled
+ if (ctx->VertexProgram._Enabled
&& ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) {
min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL]._MaxElement);
}
}
/* 3 */
- if (ctx->VertexProgram.Enabled
+ if (ctx->VertexProgram._Enabled
&& ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) {
min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR0]._MaxElement);
}
}
/* 4 */
- if (ctx->VertexProgram.Enabled
+ if (ctx->VertexProgram._Enabled
&& ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) {
min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR1]._MaxElement);
}
}
/* 5 */
- if (ctx->VertexProgram.Enabled
+ if (ctx->VertexProgram._Enabled
&& ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Enabled) {
min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_FOG]._MaxElement);
}
}
/* 6 */
- if (ctx->VertexProgram.Enabled
+ if (ctx->VertexProgram._Enabled
&& ctx->Array.VertexAttrib[VERT_ATTRIB_SIX].Enabled) {
min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_SIX]._MaxElement);
}
/* 7 */
- if (ctx->VertexProgram.Enabled
+ if (ctx->VertexProgram._Enabled
&& ctx->Array.VertexAttrib[VERT_ATTRIB_SEVEN].Enabled) {
min = MIN2(min, ctx->Array.VertexAttrib[VERT_ATTRIB_SEVEN]._MaxElement);
}
/* 8..15 */
for (i = VERT_ATTRIB_TEX0; i < VERT_ATTRIB_MAX; i++) {
- if (ctx->VertexProgram.Enabled
+ if (ctx->VertexProgram._Enabled
&& ctx->Array.VertexAttrib[i].Enabled) {
min = MIN2(min, ctx->Array.VertexAttrib[i]._MaxElement);
}
}
+/**
+ * Update derived vertex/fragment program state.
+ */
+static void
+update_program(GLcontext *ctx)
+{
+ /* For now, just set the _Enabled (really enabled) flags.
+ * In the future we may have to check other state to be sure we really
+ * have a runable program or shader.
+ */
+ ctx->VertexProgram._Enabled = ctx->VertexProgram.Enabled
+ && ctx->VertexProgram.Current->Instructions;
+ ctx->FragmentProgram._Enabled = ctx->FragmentProgram.Enabled
+ && ctx->FragmentProgram.Current->Instructions;
+}
+
/*
* If __GLcontextRec::NewState is non-zero then this function \b must be called
if (MESA_VERBOSE & VERBOSE_STATE)
_mesa_print_state("_mesa_update_state", new_state);
+ if (new_state & _NEW_PROGRAM)
+ update_program( ctx );
+
if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
_mesa_update_modelview_project( ctx, new_state );
texUnit->_GenFlags = 0;
/* Get the bitmask of texture enables */
- if (ctx->FragmentProgram.Enabled && ctx->FragmentProgram.Current) {
+ if (ctx->FragmentProgram._Enabled) {
enableBits = ctx->FragmentProgram.Current->TexturesUsed[unit];
}
else {
/* Fragment programs may need texture coordinates but not the
* corresponding texture images.
*/
- if (ctx->FragmentProgram.Enabled && ctx->FragmentProgram.Current) {
+ if (ctx->FragmentProgram._Enabled) {
ctx->Texture._EnabledCoordUnits |=
(ctx->FragmentProgram.Current->InputsRead >> FRAG_ATTRIB_TEX0);
}
/*
* Mesa 3-D graphics library
- * Version: 6.0
+ * Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
"glGetProgramRegisterfvMESA(target)");
return;
}
- if (!ctx->VertexProgram.Enabled) {
+ if (!ctx->VertexProgram._Enabled) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramRegisterfvMESA");
return;
"glGetProgramRegisterfvMESA(target)");
return;
}
- if (!ctx->FragmentProgram.Enabled) {
+ if (!ctx->FragmentProgram._Enabled) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramRegisterfvMESA");
return;
"glGetProgramRegisterfvMESA(target)");
return;
}
- if (!ctx->FragmentProgram.Enabled) {
+ if (!ctx->FragmentProgram._Enabled) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramRegisterfvMESA");
return;
RasterMask |= MULTI_DRAW_BIT; /* all color index bits disabled */
}
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
RasterMask |= FRAGPROG_BIT;
}
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
swrast->_PreferPixelFog = (!swrast->AllowVertexFog ||
- ctx->FragmentProgram.Enabled ||
+ ctx->FragmentProgram._Enabled ||
(ctx->Hint.Fog == GL_NICEST &&
swrast->AllowPixelFog));
}
if (ctx->Fog.Enabled) {
swrast->_FogEnabled = GL_TRUE;
}
- else if (ctx->FragmentProgram.Enabled &&
+ else if (ctx->FragmentProgram._Enabled &&
ctx->FragmentProgram.Current->Base.Target == GL_FRAGMENT_PROGRAM_ARB) {
const struct fragment_program *p;
p = (struct fragment_program *) ctx->FragmentProgram.Current;
static void
_swrast_update_fragment_program( GLcontext *ctx )
{
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
struct fragment_program *program = ctx->FragmentProgram.Current;
_mesa_load_state_parameters(ctx, program->Parameters);
}
if (ctx->Texture._EnabledUnits == 0
&& NEED_SECONDARY_COLOR(ctx)
- && !ctx->FragmentProgram.Enabled) {
+ && !ctx->FragmentProgram._Enabled) {
/* separate specular color, but no texture */
swrast->SpecTriangle = swrast->Triangle;
swrast->Triangle = _swrast_add_spec_terms_triangle;
if (ctx->Texture._EnabledUnits == 0
&& NEED_SECONDARY_COLOR(ctx)
- && !ctx->FragmentProgram.Enabled) {
+ && !ctx->FragmentProgram._Enabled) {
swrast->SpecLine = swrast->Line;
swrast->Line = _swrast_add_spec_terms_line;
}
if (ctx->Texture._EnabledUnits == 0
&& NEED_SECONDARY_COLOR(ctx)
- && !ctx->FragmentProgram.Enabled) {
+ && !ctx->FragmentProgram._Enabled) {
swrast->SpecPoint = swrast->Point;
swrast->Point = _swrast_add_spec_terms_point;
}
if (obj) {
const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
needLambda = (obj->MinFilter != obj->MagFilter)
- || ctx->FragmentProgram.Enabled;
+ || ctx->FragmentProgram._Enabled;
texW = img->WidthScale;
texH = img->HeightScale;
}
GLfloat r = span->tex[u][2];
GLfloat q = span->tex[u][3];
GLuint i;
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
GLfloat w = span->w;
GLfloat r = span->tex[u][2];
GLfloat q = span->tex[u][3];
GLuint i;
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
GLfloat w = span->w;
if (obj) {
const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
needLambda = (obj->MinFilter != obj->MagFilter)
- || ctx->FragmentProgram.Enabled;
+ || ctx->FragmentProgram._Enabled;
texW = (GLfloat) img->WidthScale;
texH = (GLfloat) img->HeightScale;
}
GLfloat r = span->tex[0][2];
GLfloat q = span->tex[0][3];
GLuint i;
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
GLfloat w = span->w;
GLfloat r = span->tex[0][2];
GLfloat q = span->tex[0][3];
GLuint i;
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
GLfloat w = span->w;
}
/* Fragment program */
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
/* Now we may need to interpolate the colors and texcoords */
if ((span->interpMask & SPAN_RGBA) &&
(span->arrayMask & SPAN_RGBA) == 0) {
span->primitive == GL_POLYGON || span->primitive == GL_BITMAP);
ASSERT(span->end <= MAX_WIDTH);
ASSERT((span->interpMask & span->arrayMask) == 0);
- ASSERT(ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram.Enabled);
+ ASSERT(ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Enabled);
/*
printf("%s() interp 0x%x array 0x%x\n", __FUNCTION__, span->interpMask, span->arrayMask);
/* Texturing without alpha is done after depth-testing which
* gives a potential speed-up.
*/
- if (ctx->FragmentProgram.Enabled)
+ if (ctx->FragmentProgram._Enabled)
_swrast_exec_fragment_program( ctx, span );
else
_swrast_texture_span( ctx, span );
interpolate_specular(ctx, span);
}
- if (ctx->FragmentProgram.Enabled)
+ if (ctx->FragmentProgram._Enabled)
_swrast_exec_fragment_program( ctx, span );
else
_swrast_texture_span( ctx, span );
}
}
- if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram.Enabled) {
+ if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Enabled) {
/* Ugh, we do a _lot_ of tests to pick the best textured tri func */
const struct gl_texture_object *texObj2D;
const struct gl_texture_image *texImg;
/* First see if we can use an optimized 2-D texture function */
if (ctx->Texture._EnabledCoordUnits == 1
- && !ctx->FragmentProgram.Enabled
+ && !ctx->FragmentProgram._Enabled
&& ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT
&& texObj2D->WrapS==GL_REPEAT
&& texObj2D->WrapT==GL_REPEAT
/*
* Mesa 3-D graphics library
- * Version: 6.0.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
ind |= SS_OFFSET_BIT;
if ((ctx->Light.Enabled && ctx->Light.Model.TwoSide) ||
- (ctx->VertexProgram.Enabled && ctx->VertexProgram.TwoSideEnabled))
+ (ctx->VertexProgram._Enabled && ctx->VertexProgram.TwoSideEnabled))
ind |= SS_TWOSIDE_BIT;
/* We piggyback the two-sided stencil front/back determination on the
/*
* Mesa 3-D graphics library
- * Version: 6.0
+ * Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
/* When vertex program mode is enabled, the generic vertex attribute
* arrays have priority over the conventional vertex arrays.
*/
- if (ctx->VertexProgram.Enabled
+ if (ctx->VertexProgram._Enabled
&& ctx->Array.VertexAttrib[index].Enabled) {
/* Use generic attribute array */
_tnl_import_attrib( ctx, index, GL_FALSE, GL_TRUE );
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
tnl->render_inputs |= _TNL_BIT_TEX0;
if (ctx->Point._Attenuated ||
- (ctx->VertexProgram.Enabled && ctx->VertexProgram.PointSizeEnabled))
+ (ctx->VertexProgram._Enabled && ctx->VertexProgram.PointSizeEnabled))
tnl->render_inputs |= _TNL_BIT_POINTSIZE;
}
/*
* Mesa 3-D graphics library
- * Version: 6.0
+ * Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
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 );
static void
check_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
{
- stage->active = ctx->Fog.Enabled && !ctx->VertexProgram.Enabled;
+ stage->active = ctx->Fog.Enabled && !ctx->VertexProgram._Enabled;
if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT)
stage->inputs = _TNL_BIT_POS;
-
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*/
static void check_lighting( GLcontext *ctx, struct tnl_pipeline_stage *stage )
{
- stage->active = ctx->Light.Enabled && !ctx->VertexProgram.Enabled;
+ stage->active = ctx->Light.Enabled && !ctx->VertexProgram._Enabled;
if (stage->active) {
if (stage->privatePtr)
stage->run = run_validate_lighting;
-
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
static void check_normal_transform( GLcontext *ctx,
struct tnl_pipeline_stage *stage )
{
- stage->active = !ctx->VertexProgram.Enabled &&
+ stage->active = !ctx->VertexProgram._Enabled &&
(ctx->Light.Enabled || (ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS));
/* Don't clobber the initialize function:
-
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*/
static void check_point_size( GLcontext *ctx, struct tnl_pipeline_stage *d )
{
- d->active = ctx->Point._Attenuated && !ctx->VertexProgram.Enabled;
+ d->active = ctx->Point._Attenuated && !ctx->VertexProgram._Enabled;
}
static GLboolean alloc_point_data( GLcontext *ctx,
*/
static void check_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
{
- stage->active = ctx->VertexProgram.Enabled;
+ stage->active = ctx->VertexProgram._Enabled;
if (stage->active) {
/* Set stage->inputs equal to the bitmask of vertex attributes
/*
* Mesa 3-D graphics library
- * Version: 6.0
+ * Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
GLuint i;
stage->active = 0;
- if (ctx->Texture._TexGenEnabled && !ctx->VertexProgram.Enabled) {
+ if (ctx->Texture._TexGenEnabled && !ctx->VertexProgram._Enabled) {
GLuint inputs = 0;
GLuint outputs = 0;
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
GLuint i;
stage->active = 0;
- if (ctx->Texture._TexMatEnabled && !ctx->VertexProgram.Enabled) {
+ if (ctx->Texture._TexMatEnabled && !ctx->VertexProgram._Enabled) {
GLuint flags = 0;
for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
-
/*
* Mesa 3-D graphics library
- * Version: 5.0
+ * Version: 6.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
- ASSERT(!ctx->VertexProgram.Enabled);
+ ASSERT(!ctx->VertexProgram._Enabled);
if (stage->changed_inputs) {
static void check_vertex( GLcontext *ctx, struct tnl_pipeline_stage *stage )
{
- stage->active = !ctx->VertexProgram.Enabled;
+ stage->active = !ctx->VertexProgram._Enabled;
}
static GLboolean init_vertex_stage( GLcontext *ctx,
{
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);
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
clear_active_eval2( tnl, attr );
}
- if (ctx->VertexProgram.Enabled) {
+ if (ctx->VertexProgram._Enabled) {
for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
if (ctx->Eval.Map1Attrib[attr])
set_active_eval1( tnl, attr, 4, &ctx->EvalMap.Map1Attrib[attr] );