i965/gen6+: Add support for noperspective interpolation.
authorPaul Berry <stereotype441@gmail.com>
Sat, 22 Oct 2011 16:33:16 +0000 (09:33 -0700)
committerPaul Berry <stereotype441@gmail.com>
Thu, 27 Oct 2011 22:32:20 +0000 (15:32 -0700)
commit5aa96286e7e1a5380673eb75e8653616b48751fd
tree9022be2d7baf88cd63f7502f378d5db216e2c742
parent4d563ec1cc912e4b3f02e71ad72d7b08f001d4d7
i965/gen6+: Add support for noperspective interpolation.

This required the following changes:

- WM setup now makes the appropriate set of barycentric coordinates
  (perspective vs. noperspective) available to the fragment shader,
  based on whether the shader requires perspective interpolation,
  noperspective interpolation, both, or neither.

- The fragment shader backend now uses the appropriate set of
  barycentric coordiantes when interpolating, based on the
  interpolation mode returned by
  ir_variable::determine_interpolation_mode().

- SF setup now uses gl_fragment_program::InterpQualifier to determine
  which attributes are to be flat shaded (as opposed to the old logic,
  which only flat shaded colors).

- CLIP setup now ensures that the clipper outputs non-perspective
  barycentric coordinates when they are needed by the fragment shader.

Fixes the remaining piglit tests of interpolation qualifiers that were
failing:
- interpolation-flat-*-smooth-none
- interpolation-flat-other-flat-none
- interpolation-noperspective-*
- interpolation-smooth-gl_*Color-flat-*

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_wm.c
src/mesa/drivers/dri/i965/gen6_clip_state.c
src/mesa/drivers/dri/i965/gen6_sf_state.c
src/mesa/drivers/dri/i965/gen6_wm_state.c
src/mesa/drivers/dri/i965/gen7_clip_state.c
src/mesa/drivers/dri/i965/gen7_sf_state.c
src/mesa/drivers/dri/i965/gen7_wm_state.c