ctx->Const.FragmentProgram.MaxNativeTexIndirections = I915_MAX_TEX_INDIRECT;
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
+ ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
driInitExtensions( ctx, i915_extensions, GL_FALSE );
GLboolean enabled;
GLboolean try_pixel_fog;
- if (ctx->FragmentProgram._Enabled) {
+ if (ctx->FragmentProgram._Active) {
/* Pull in static fog state from program */
mode = ctx->FragmentProgram._Current->FogOption;
GLcontext *ctx = &intel->ctx;
i915ContextPtr i915 = I915_CONTEXT(intel);
- if (ctx->FragmentProgram._Current)
+ if (ctx->FragmentProgram._Active)
i915ValidateFragmentProgram( i915 );
else {
assert(!ctx->FragmentProgram._MaintainTexEnvProgram);
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
- /*ctx->_UseTexEnvProgram = 1;*/
+ ctx->_UseTexEnvProgram = GL_TRUE;
driInitExtensions(ctx, i915_extensions, GL_FALSE);
GLboolean enabled;
GLboolean try_pixel_fog;
- if (ctx->FragmentProgram._Enabled) {
+ if (ctx->FragmentProgram._Active) {
/* Pull in static fog state from program */
mode = ctx->FragmentProgram._Current->FogOption;
ctx->TnlModule.SwapCount = 0;
#endif
+ ctx->FragmentProgram._MaintainTexEnvProgram
+ = (_mesa_getenv("MESA_TEX_PROG") != NULL);
+ ctx->FragmentProgram._UseTexEnvProgram = ctx->FragmentProgram._MaintainTexEnvProgram;
+
ctx->VertexProgram._MaintainTnlProgram
= (_mesa_getenv("MESA_TNL_PROG") != NULL);
- if (ctx->VertexProgram._MaintainTnlProgram)
+ if (ctx->VertexProgram._MaintainTnlProgram) {
/* this is required... */
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
- else
- ctx->FragmentProgram._MaintainTexEnvProgram
- = (_mesa_getenv("MESA_TEX_PROG") != NULL);
+ }
ctx->FirstTimeCurrent = GL_TRUE;
{
GLboolean Enabled; /**< User-set fragment program enable flag */
GLboolean _Enabled; /**< Fragment program enabled and valid? */
+ GLboolean _Active;
struct gl_fragment_program *Current; /**< User-bound fragment program */
/** Currently enabled and valid program (including internal programs
/** Should fixed-function texturing be implemented with a fragment prog? */
GLboolean _MaintainTexEnvProgram;
+ GLboolean _UseTexEnvProgram;
/** Program to emulate fixed-function texture env/combine (see above) */
struct gl_fragment_program *_TexEnvProgram;
if (shProg && shProg->LinkStatus) {
/* Use shader programs */
+ /* XXX this isn't quite right, since we may have either a vertex
+ * _or_ fragment shader (not always both).
+ */
ctx->VertexProgram._Current = shProg->VertexProgram;
ctx->FragmentProgram._Current = shProg->FragmentProgram;
}
ctx->FragmentProgram._Current = NULL;
}
}
+
+ ctx->FragmentProgram._Active = ctx->FragmentProgram._Enabled;
+ if (ctx->FragmentProgram._MaintainTexEnvProgram &&
+ !ctx->FragmentProgram._Enabled) {
+ if (ctx->FragmentProgram._UseTexEnvProgram)
+ ctx->FragmentProgram._Active = GL_TRUE;
+ }
}
if (swrast->_FragmentAttribs & (1 << attr)) {
GLfloat (*attribArray)[4] = line->span.array->attribs[attr];
GLfloat invQ;
- if (ctx->FragmentProgram._Current) {
+ if (ctx->FragmentProgram._Active) {
invQ = 1.0F;
}
else {
#endif
#if FLAGS & TEXTURE
span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
- if (ctx->FragmentProgram._Current) {
+ if (ctx->FragmentProgram._Active) {
/* Don't divide texture s,t,r by q (use TXP to do that) */
for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) {
if (swrast->_FragmentAttribs & (1 << attr)) {
}
if (ctx->Fog.Enabled ||
- (ctx->FragmentProgram._Current &&
+ (ctx->FragmentProgram._Active &&
(ctx->FragmentProgram._Current->FogOption != GL_NONE ||
ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)))
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );