[Mesa-dev] [PATCH] mesa: Flag _NEW_VARYING_VP_INPUTS when there's no vertex program.

Marek Olšák maraeo at gmail.com
Tue Sep 18 18:49:29 PDT 2012


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

Thanks to your patch, I've got a theory.

i915 doesn't set _MaintainTnlProgram to TRUE, which causes core Mesa
to set both _TnlProgram and _Current to NULL, therefore
_mesa_set_varying_vp_inputs is a no-op. (If _MaintainTnlProgram were
TRUE, the shaders would be set properly in main/state.c:199). However,
the tnl module looks if there is any state change
(tnl/t_pipeline.c:128) and calls _tnl_UpdateFixedFunctionProgram,
which then updates both _TnlProgram and _Current in a similar way
main/state.c:199 would do.

Clearly, the tnl module does use the fixed-function program and core
Mesa doesn't know about it. That's why it never got
_NEW_VARYING_VP_INPUTS. Also I guess _tnl_UpdateFixedFunctionProgram
should not mess with core Mesa's state.

Marek

On Sun, Sep 16, 2012 at 10:18 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.  Fixed function happens when either
> a) there is no vertex program, or b) it's the current TNL program.
>
> 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.
>
> I have to confess I don't understand exactly why this fixes the problem,
> but I figured it's better than reverting Marek's patch entirely.
>
> 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 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
> index 76946bd..5c9c5a5 100644
> --- a/src/mesa/main/state.c
> +++ b/src/mesa/main/state.c
> @@ -627,7 +627,7 @@ _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._Current || ctx->VertexProgram._TnlProgram) {
>           ctx->NewState |= _NEW_VARYING_VP_INPUTS;
>        }
>        /*printf("%s %x\n", __FUNCTION__, varying_inputs);*/
> --
> 1.7.11.4
>
> _______________________________________________
> 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