Looks good. I'd like to see these fields go away. If there's
regressions we'll fix them.
-Brian
Eric Anholt wrote:
> There was a note in state.c about _Active deserving to die, and there were
> potential issues with it due to i965 forgetting to set _UseTexEnvProgram.
> Removing both simplifies things.
> ---
> src/mesa/drivers/dri/i915/i915_context.c | 1 -
> src/mesa/drivers/dri/i915/i915_state.c | 2 +-
> src/mesa/drivers/dri/intel/intel_pixel_draw.c | 25
> ++-----------------------
> src/mesa/main/context.c | 1 -
> src/mesa/main/mtypes.h | 2 --
> src/mesa/main/state.c | 11 -----------
> src/mesa/swrast/s_aalinetemp.h | 2 +-
> src/mesa/tnl/t_context.c | 2 +-
> 8 files changed, 5 insertions(+), 41 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i915/i915_context.c
> b/src/mesa/drivers/dri/i915/i915_context.c
> index 9bff742..3d6af38 100644
> --- a/src/mesa/drivers/dri/i915/i915_context.c
> +++ b/src/mesa/drivers/dri/i915/i915_context.c
> @@ -171,7 +171,6 @@ i915CreateContext(const __GLcontextModes * mesaVis,
> 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);
>
> diff --git a/src/mesa/drivers/dri/i915/i915_state.c
> b/src/mesa/drivers/dri/i915/i915_state.c
> index 9d04358..a53f120 100644
> --- a/src/mesa/drivers/dri/i915/i915_state.c
> +++ b/src/mesa/drivers/dri/i915/i915_state.c
> @@ -569,7 +569,7 @@ i915_update_fog(GLcontext * ctx)
> GLboolean enabled;
> GLboolean try_pixel_fog;
>
> - if (ctx->FragmentProgram._Active) {
> + if (ctx->FragmentProgram._Current) {
> /* Pull in static fog state from program */
> mode = ctx->FragmentProgram._Current->FogOption;
> enabled = (mode != GL_NONE);
> diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c
> b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
> index 0d66935..2af839b 100644
> --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c
> +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
> @@ -386,27 +386,6 @@ intelDrawPixels(GLcontext * ctx,
> if (INTEL_DEBUG & DEBUG_PIXEL)
> _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
>
> - if (ctx->FragmentProgram._Current == ctx->FragmentProgram._TexEnvProgram)
> {
> - /*
> - * We don't want the i915 texenv program to be applied to DrawPixels.
> - * This is really just a performance optimization (mesa will other-
> - * wise happily run the fragment program on each pixel in the image).
> - */
> - struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current;
> - /* can't just set current frag prog to 0 here as on buffer resize
> - we'll get new state checks which will segfault. Remains a hack. */
> - ctx->FragmentProgram._Current = NULL;
> - ctx->FragmentProgram._UseTexEnvProgram = GL_FALSE;
> - ctx->FragmentProgram._Active = GL_FALSE;
> - _swrast_DrawPixels( ctx, x, y, width, height, format, type,
> - unpack, pixels );
> - ctx->FragmentProgram._Current = fpSave;
> - ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
> - ctx->FragmentProgram._Active = GL_TRUE;
> - _swrast_InvalidateState(ctx, _NEW_PROGRAM);
> - }
> - else {
> - _swrast_DrawPixels( ctx, x, y, width, height, format, type,
> - unpack, pixels );
> - }
> + _swrast_DrawPixels(ctx, x, y, width, height, format, type,
> + unpack, pixels);
> }
> diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
> index b59ad35..98c23bb 100644
> --- a/src/mesa/main/context.c
> +++ b/src/mesa/main/context.c
> @@ -1225,7 +1225,6 @@ _mesa_initialize_context(GLcontext *ctx,
>
> ctx->FragmentProgram._MaintainTexEnvProgram
> = (_mesa_getenv("MESA_TEX_PROG") != NULL);
> - ctx->FragmentProgram._UseTexEnvProgram =
> ctx->FragmentProgram._MaintainTexEnvProgram;
>
> ctx->VertexProgram._MaintainTnlProgram
> = (_mesa_getenv("MESA_TNL_PROG") != NULL);
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 9cb6159..3eca8a8 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -2011,8 +2011,6 @@ struct gl_fragment_program_state
>
> /** Should fixed-function texturing be implemented with a fragment prog?
> */
> GLboolean _MaintainTexEnvProgram;
> - GLboolean _UseTexEnvProgram;
> - GLboolean _Active; /**< Use internal texenv program? */
>
> /** Program to emulate fixed-function texture env/combine (see above) */
> struct gl_fragment_program *_TexEnvProgram;
> diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
> index df1d197..6fe54c7 100644
> --- a/src/mesa/main/state.c
> +++ b/src/mesa/main/state.c
> @@ -254,17 +254,6 @@ update_program(GLcontext *ctx)
> _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL);
> }
>
> - /* XXX: get rid of _Active flag.
> - */
> -#if 1
> - ctx->FragmentProgram._Active = ctx->FragmentProgram._Enabled;
> - if (ctx->FragmentProgram._MaintainTexEnvProgram &&
> - !ctx->FragmentProgram._Enabled) {
> - if (ctx->FragmentProgram._UseTexEnvProgram)
> - ctx->FragmentProgram._Active = GL_TRUE;
> - }
> -#endif
> -
> /* Let the driver know what's happening:
> */
> if (ctx->FragmentProgram._Current != prevFP && ctx->Driver.BindProgram) {
> diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h
> index ca08203..42ffe9f 100644
> --- a/src/mesa/swrast/s_aalinetemp.h
> +++ b/src/mesa/swrast/s_aalinetemp.h
> @@ -76,7 +76,7 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix,
> int iy)
> ATTRIB_LOOP_BEGIN
> GLfloat (*attribArray)[4] = line->span.array->attribs[attr];
> if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0
> - && !ctx->FragmentProgram._Active) {
> + && !ctx->FragmentProgram._Current) {
> /* texcoord w/ divide by Q */
> const GLuint unit = attr - FRAG_ATTRIB_TEX0;
> const GLfloat invQ = solve_plane_recip(fx, fy,
> line->attrPlane[attr][3]);
> diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
> index 8977fad..5e2a582 100644
> --- a/src/mesa/tnl/t_context.c
> +++ b/src/mesa/tnl/t_context.c
> @@ -137,7 +137,7 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
> /* fixed-function fog */
> RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );
> }
> - else if (ctx->FragmentProgram._Active || ctx->FragmentProgram._Current) {
> + else if (ctx->FragmentProgram._Current) {
> struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
> if (fp) {
> if (fp->FogOption != GL_NONE || (fp->Base.InputsRead &
> FRAG_BIT_FOGC)) {
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev