Restore the UseTexEnvProgram logic.
Was removed during glsl-compiler work. Still need to go back and revisit this because of the interaction with fragment shaders...
This commit is contained in:
@@ -168,6 +168,7 @@ GLboolean i915CreateContext( const __GLcontextModes *mesaVis,
|
|||||||
ctx->Const.FragmentProgram.MaxNativeTexIndirections = I915_MAX_TEX_INDIRECT;
|
ctx->Const.FragmentProgram.MaxNativeTexIndirections = I915_MAX_TEX_INDIRECT;
|
||||||
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
|
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
|
||||||
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
||||||
|
ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
|
||||||
|
|
||||||
|
|
||||||
driInitExtensions( ctx, i915_extensions, GL_FALSE );
|
driInitExtensions( ctx, i915_extensions, GL_FALSE );
|
||||||
|
@@ -531,7 +531,7 @@ void i915_update_fog( GLcontext *ctx )
|
|||||||
GLboolean enabled;
|
GLboolean enabled;
|
||||||
GLboolean try_pixel_fog;
|
GLboolean try_pixel_fog;
|
||||||
|
|
||||||
if (ctx->FragmentProgram._Enabled) {
|
if (ctx->FragmentProgram._Active) {
|
||||||
/* Pull in static fog state from program */
|
/* Pull in static fog state from program */
|
||||||
|
|
||||||
mode = ctx->FragmentProgram._Current->FogOption;
|
mode = ctx->FragmentProgram._Current->FogOption;
|
||||||
|
@@ -46,7 +46,7 @@ static void i915_render_start( intelContextPtr intel )
|
|||||||
GLcontext *ctx = &intel->ctx;
|
GLcontext *ctx = &intel->ctx;
|
||||||
i915ContextPtr i915 = I915_CONTEXT(intel);
|
i915ContextPtr i915 = I915_CONTEXT(intel);
|
||||||
|
|
||||||
if (ctx->FragmentProgram._Current)
|
if (ctx->FragmentProgram._Active)
|
||||||
i915ValidateFragmentProgram( i915 );
|
i915ValidateFragmentProgram( i915 );
|
||||||
else {
|
else {
|
||||||
assert(!ctx->FragmentProgram._MaintainTexEnvProgram);
|
assert(!ctx->FragmentProgram._MaintainTexEnvProgram);
|
||||||
|
@@ -158,7 +158,7 @@ i915CreateContext(const __GLcontextModes * mesaVis,
|
|||||||
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
|
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
|
||||||
|
|
||||||
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
||||||
/*ctx->_UseTexEnvProgram = 1;*/
|
ctx->_UseTexEnvProgram = GL_TRUE;
|
||||||
|
|
||||||
driInitExtensions(ctx, i915_extensions, GL_FALSE);
|
driInitExtensions(ctx, i915_extensions, GL_FALSE);
|
||||||
|
|
||||||
|
@@ -561,7 +561,7 @@ i915_update_fog(GLcontext * ctx)
|
|||||||
GLboolean enabled;
|
GLboolean enabled;
|
||||||
GLboolean try_pixel_fog;
|
GLboolean try_pixel_fog;
|
||||||
|
|
||||||
if (ctx->FragmentProgram._Enabled) {
|
if (ctx->FragmentProgram._Active) {
|
||||||
/* Pull in static fog state from program */
|
/* Pull in static fog state from program */
|
||||||
|
|
||||||
mode = ctx->FragmentProgram._Current->FogOption;
|
mode = ctx->FragmentProgram._Current->FogOption;
|
||||||
|
@@ -1355,14 +1355,16 @@ _mesa_initialize_context(GLcontext *ctx,
|
|||||||
ctx->TnlModule.SwapCount = 0;
|
ctx->TnlModule.SwapCount = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ctx->FragmentProgram._MaintainTexEnvProgram
|
||||||
|
= (_mesa_getenv("MESA_TEX_PROG") != NULL);
|
||||||
|
ctx->FragmentProgram._UseTexEnvProgram = ctx->FragmentProgram._MaintainTexEnvProgram;
|
||||||
|
|
||||||
ctx->VertexProgram._MaintainTnlProgram
|
ctx->VertexProgram._MaintainTnlProgram
|
||||||
= (_mesa_getenv("MESA_TNL_PROG") != NULL);
|
= (_mesa_getenv("MESA_TNL_PROG") != NULL);
|
||||||
if (ctx->VertexProgram._MaintainTnlProgram)
|
if (ctx->VertexProgram._MaintainTnlProgram) {
|
||||||
/* this is required... */
|
/* this is required... */
|
||||||
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
|
||||||
else
|
}
|
||||||
ctx->FragmentProgram._MaintainTexEnvProgram
|
|
||||||
= (_mesa_getenv("MESA_TEX_PROG") != NULL);
|
|
||||||
|
|
||||||
ctx->FirstTimeCurrent = GL_TRUE;
|
ctx->FirstTimeCurrent = GL_TRUE;
|
||||||
|
|
||||||
|
@@ -1987,6 +1987,7 @@ struct gl_fragment_program_state
|
|||||||
{
|
{
|
||||||
GLboolean Enabled; /**< User-set fragment program enable flag */
|
GLboolean Enabled; /**< User-set fragment program enable flag */
|
||||||
GLboolean _Enabled; /**< Fragment program enabled and valid? */
|
GLboolean _Enabled; /**< Fragment program enabled and valid? */
|
||||||
|
GLboolean _Active;
|
||||||
struct gl_fragment_program *Current; /**< User-bound fragment program */
|
struct gl_fragment_program *Current; /**< User-bound fragment program */
|
||||||
|
|
||||||
/** Currently enabled and valid program (including internal programs
|
/** Currently enabled and valid program (including internal programs
|
||||||
@@ -1998,6 +1999,7 @@ struct gl_fragment_program_state
|
|||||||
|
|
||||||
/** Should fixed-function texturing be implemented with a fragment prog? */
|
/** Should fixed-function texturing be implemented with a fragment prog? */
|
||||||
GLboolean _MaintainTexEnvProgram;
|
GLboolean _MaintainTexEnvProgram;
|
||||||
|
GLboolean _UseTexEnvProgram;
|
||||||
|
|
||||||
/** Program to emulate fixed-function texture env/combine (see above) */
|
/** Program to emulate fixed-function texture env/combine (see above) */
|
||||||
struct gl_fragment_program *_TexEnvProgram;
|
struct gl_fragment_program *_TexEnvProgram;
|
||||||
|
@@ -964,6 +964,9 @@ update_program(GLcontext *ctx)
|
|||||||
|
|
||||||
if (shProg && shProg->LinkStatus) {
|
if (shProg && shProg->LinkStatus) {
|
||||||
/* Use shader programs */
|
/* 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->VertexProgram._Current = shProg->VertexProgram;
|
||||||
ctx->FragmentProgram._Current = shProg->FragmentProgram;
|
ctx->FragmentProgram._Current = shProg->FragmentProgram;
|
||||||
}
|
}
|
||||||
@@ -1000,6 +1003,13 @@ update_program(GLcontext *ctx)
|
|||||||
ctx->FragmentProgram._Current = NULL;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -87,7 +87,7 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy)
|
|||||||
if (swrast->_FragmentAttribs & (1 << attr)) {
|
if (swrast->_FragmentAttribs & (1 << attr)) {
|
||||||
GLfloat (*attribArray)[4] = line->span.array->attribs[attr];
|
GLfloat (*attribArray)[4] = line->span.array->attribs[attr];
|
||||||
GLfloat invQ;
|
GLfloat invQ;
|
||||||
if (ctx->FragmentProgram._Current) {
|
if (ctx->FragmentProgram._Active) {
|
||||||
invQ = 1.0F;
|
invQ = 1.0F;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -121,7 +121,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
|
|||||||
#endif
|
#endif
|
||||||
#if FLAGS & TEXTURE
|
#if FLAGS & TEXTURE
|
||||||
span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
|
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) */
|
/* Don't divide texture s,t,r by q (use TXP to do that) */
|
||||||
for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) {
|
for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) {
|
||||||
if (swrast->_FragmentAttribs & (1 << attr)) {
|
if (swrast->_FragmentAttribs & (1 << attr)) {
|
||||||
|
@@ -138,7 +138,7 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Fog.Enabled ||
|
if (ctx->Fog.Enabled ||
|
||||||
(ctx->FragmentProgram._Current &&
|
(ctx->FragmentProgram._Active &&
|
||||||
(ctx->FragmentProgram._Current->FogOption != GL_NONE ||
|
(ctx->FragmentProgram._Current->FogOption != GL_NONE ||
|
||||||
ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)))
|
ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)))
|
||||||
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );
|
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );
|
||||||
|
Reference in New Issue
Block a user