[Mesa-dev] [PATCH 0/8] Interpolation qualifier support for i965

Paul Berry stereotype441 at gmail.com
Mon Oct 24 14:38:38 PDT 2011

This patch series adds support for the GLSL 1.30 interpolation
qualifiers 'flat', 'noperspective', and 'smooth' to i965 Gen6+.

There was already some support in Mesa core for these qualifiers,
however, it did not distinguish correctly between 'smooth' and no
interpolation qualifier at all, and it did not provide a reasonable
mechanism for back-ends to determine which interpolation mode to use
for a variable, or which interpolation modes are needed by the
fragment shader as a whole.  These deficiencies are addressed in
patches 1-3.

Note that there is some overlap in the funcationality of patches 2 and
3.  Patch 2 introduces ir_varible::determine_interpolation_mode(),
which tells how a single variable should be interpolated.  Patch 3
introduces bitfields which tell how all fragment shader inputs should
be interpolated.  Strictly speaking, this is redundant.  However, for
code that deals with GLSL IR variables directly (such as the i965
fragment-shader back-end), it is far easier to use
ir_varible::determine_interpolation_mode(), and for code that doesn't
deal with the GLSL IR variables (such as the i965's SF and CLIP setup
functions), it is far easier to use bitfields.  So it seemed prudent
to make both mechanisms available in core mesa.

The remaining patches add interpolation qualifier support to the i965
back-end.  This required modifying the CLIP stage to output
noperspective barycentric coordinates when needed, modifying the SF
stage to perform flat interpolation at the right time, and modifying
the FS back-end to allocate registers for noperspective barycentric
coordinates and use them when appropriate.

[PATCH 1/8] glsl: Distinguish between no interpolation qualifier and 'smooth'
[PATCH 2/8] glsl: add ir_variable::determine_interpolation_mode() function.
[PATCH 3/8] mesa: Add interpolation override bitfields.
[PATCH 4/8] i965/fs: Fix split_virtual_grfs() when delta_xy not in a virtual register.
[PATCH 5/8] i965/gen6+: Parameterize barycentric interpolation modes.
[PATCH 6/8] i965/fs: use determine_interpolation_mode().
[PATCH 7/8] i965/gen6+: Rename GEN6_CLIP_BARYCENTRIC_ENABLE.
[PATCH 8/8] i965/gen6+: Add support for noperspective interpolation.

More information about the mesa-dev mailing list