On 10/24/2011 03:38 PM, Paul Berry wrote:
This patch adds the bitfields InterpOverridesFlat,
InterpOverridesSmooth, and InterpOverridesNoperspective to
gl_fragment_program.  These bitfields keep track of which fragment
shader inputs are overridden with the GLSL "flat", "smooth", and
"noperspective" interpolation qualifiers.

The names of those fields seems a little confusing to me. For example, "InterpOverridesFlat" sounds like a field that overrides flat shading with something else.

How about just "InterpFlat", "InterpSmooth", etc?

Or, how about an enum that indicates the interpolation mode for each fragment shader input? Something like this:

enum interp_mode
{
   INTERP_DEFAULT,  /* I _think_ we need a default mode, right? */
   INTERP_FLAT,
   INTERP_SMOOTH,
   INTERP_NO_PERSPECTIVE
};

struct gl_fragment_program
{
   ...
   enum interp_mode InterpMode[FRAG_ATTRIB_MAX];
   ...
};


This would also prevent a non-sensical state where a particular bit is accidentally set in more than one of the masks.

Finally, maybe use "CONSTANT", "LINEAR" and "PERSPECTIVE" instead of "FLAT", "NO_PERSPECTIVE" and "SMOOTH". That's what we have in gallium.



For GLSL fragment shaders, these fields are populated by the
do_set_program_inouts() function.  For non-GLSL fragment programs,
these bitfields are zero.

In addition, there are three new Mesa functions for determining how
fragment shader inputs should be interpolated, taking into account the
current shade model: _mesa_compute_frag_attribs_flat(),
_mesa_compute_frag_attribs_smooth(), and
_mesa_compute_frag_attribs_noperspective().  These functions are
equivalent to ir_variable::determine_interpolation_mode(), except that
they operate on all fragment shader inputs as a bitfield, rather than
a single fragment shader input by itself.

-Brian
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to