[Mesa-dev] [PATCH] mesa: Flag _NEW_VARYING_VP_INPUTS when there's no vertex program.
Marek Olšák
maraeo at gmail.com
Wed Sep 26 18:06:15 PDT 2012
On Thu, Sep 27, 2012 at 1:53 AM, Ian Romanick <idr at freedesktop.org> wrote:
> On 09/18/2012 06:49 PM, Marek Olšák wrote:
>>
>> 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.
>
>
> So... based on that, it seems like _mesa_set-varying_vp_inputs should
> actually check ctx->FragmentProgram._TexEnvProgram instead, right?
Not sure about that.
After some more code reading, my previous theory seems to be wrong and
I think Kenneth's patch is correct. The TexEnvProgram uses
varying_vp_inputs only when there isn't any user-supplied vertex
program/shader and the condition "!ctx->VertexProgram._Current ||
ctx->VertexProgram._TnlProgram" satisfies that, right?
>
> As an aside, 'varying VP inputs' is one of the worst names ever. Vertex
> programs don't have varying inputs. I had to dig around in the code for
> quite some time to figure out what it actually was.
We could rename it to "non-const VP inputs". At least that sounds better to me.
Marek
More information about the mesa-dev
mailing list