diff options
author | Brian Paul <[email protected]> | 2004-04-23 14:16:46 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-04-23 14:16:46 +0000 |
commit | 6d460af6af77a0d5a5b568bcd6094b98e249ba93 (patch) | |
tree | 08656028582b357d5c9730c521cc3e1770604c50 /src/mesa/swrast/s_span.c | |
parent | 384800fe12e368f3489111de4572dbc8846a7dea (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/swrast/s_span.c')
-rw-r--r-- | src/mesa/swrast/s_span.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 871e4740055..41db42e2b80 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -379,7 +379,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) 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; } @@ -404,7 +404,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) 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; @@ -455,7 +455,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) 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; @@ -513,7 +513,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) 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; } @@ -538,7 +538,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) 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; @@ -589,7 +589,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span) 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; @@ -1104,7 +1104,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) } /* 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) { @@ -1326,7 +1326,7 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span) 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); @@ -1386,7 +1386,7 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span) /* 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 ); @@ -1453,7 +1453,7 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *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 ); |