[Mesa-dev] [PATCH 3/5] glsl: Add gl_MESACurrentAttrib{Vert, Frag} internal builtin uniforms.

Eric Anholt eric at anholt.net
Mon Oct 10 11:06:06 PDT 2011


On Thu, 06 Oct 2011 14:40:28 -0700, Ian Romanick <idr at freedesktop.org> wrote:
> On 10/06/2011 09:36 AM, Eric Anholt wrote:
> > These will be used by the FF VS/FS to represent the current attributes
> > when they don't have an active vertex array.
> 
> I just want to make sure I grok this completely.  These are arrays of 
> vec4 uniforms that are used when, for example, glColor is called outside 
> glBegin.  Yes?

Exactly.

> If that's the case, what's the advantage of having it in the fragment 
> shader (as opposed to using uniforms to interpolate the potentially 
> constant values)?

Now I'm not grokking what you're suggesting.

> > @@ -284,6 +292,8 @@ const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[] = {
> >      STATEVAR(gl_MESABumpRotMatrix0),
> >      STATEVAR(gl_MESABumpRotMatrix1),
> >      STATEVAR(gl_MESAFogParamsOptimized),
> > +   STATEVAR(gl_MESACurrentAttribVert),
> > +   STATEVAR(gl_MESACurrentAttribFrag),
> 
> My preference would be to use the "regular" GLSL extension naming 
> convention (even though we're not exposing these names directly).  That 
> is, gl_CurrentAttribVertMESA and gl_CurrentAttribFragMESA.  I would have 
> made the same comment about the other statevar names here, but I was too 
> slow getting reviews out.

I'm up for that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111010/02683e2c/attachment.pgp>


More information about the mesa-dev mailing list