[Mesa-dev] [PATCH] mesa: Flag _NEW_VARYING_VP_INPUTS when TexEnv programs are active.

Marek Olšák maraeo at gmail.com
Wed Oct 3 05:33:10 PDT 2012


Reviewed-by: Marek Olšák <maraeo at gmail.com>

Of course, both patches are correct, because both lead to the texenv
program being updated when it should be. The only difference is that
this patch leads to _NEW_VARYING_VP_INPUTS being set even for the
cases where it doesn't actually have any effect on the texenv program.

It would be interesting to know if this more precise condition works too:

/* If there's the TnlProgram, set the flag and both the TnlProgram and
the TexEnvProgram (if present) are updated. The only remaining case is
that the TexEnvProgram must be updated if the vertex shader is
disabled completely.  */
(ctx->VertexProgram._TnlProgram ||
 (ctx->FragmentProgram._TexEnvProgram &&
  !ctx->VertexProgram._Current))

Marek

On Tue, Oct 2, 2012 at 5:11 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> The idea here is to not flag _NEW_VARYING_VP_INPUTS when shaders (either
> GLSL or ARB vp/fp) are in use.  If either TNL or TexEnv programs are
> active, at least one stage is using fixed function.
>
> On Pineview, fixes 20 Piglit, 60 oglconforms, and 7 ES 1.1 conformance
> tests, as well as missing textures in Xonotic.  These were all
> regressions since commit fb4a34e60eb4c1bdc7b0fdcd98d1bf3038c354e8.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49127
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54807
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/main/state.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> Here's a different patch, suggested by Ian.  Either seems to work fine.
>
> diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
> index 76946bd..fb8b71c 100644
> --- a/src/mesa/main/state.c
> +++ b/src/mesa/main/state.c
> @@ -627,7 +627,8 @@ _mesa_set_varying_vp_inputs( struct gl_context *ctx,
>         *
>         * It's okay to check the VP pointer here, because this is called after
>         * _mesa_update_state in the vbo module. */
> -      if (ctx->VertexProgram._TnlProgram) {
> +      if (ctx->VertexProgram._TnlProgram ||
> +          ctx->FragmentProgram._TexEnvProgram) {
>           ctx->NewState |= _NEW_VARYING_VP_INPUTS;
>        }
>        /*printf("%s %x\n", __FUNCTION__, varying_inputs);*/
> --
> 1.7.10.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list