i965/msaa: Adapt clip setup for centroid noperspective interpolation.
authorPaul Berry <stereotype441@gmail.com>
Mon, 18 Jun 2012 18:23:01 +0000 (11:23 -0700)
committerPaul Berry <stereotype441@gmail.com>
Mon, 25 Jun 2012 18:03:26 +0000 (11:03 -0700)
commit6d7ebb21f8848a4a407e458e2772a45f9c3bd28a
tree01bceae63607e816b738fd9a1594b50732bc92fd
parentbebb0438113efdcc1c2aaed95c70ba87de1d3053
i965/msaa: Adapt clip setup for centroid noperspective interpolation.

To save time, we only instruct the clip stage of the pipeline to
compute noperspective barycentric coordinates if those coordinates are
needed by the fragment shader.  Previously, we would determine whether
the coordinates were needed by seeing whether the fragment shader used
the BRW_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC interpolation mode.

However, with MSAA, it's possible that the fragment shader might use
BRW_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC instead.  In the future,
when we support ARB_sample_shading, it might use
BRW_WM_NONPERSPECTIVE_SAMPLE_BARYCENTRIC.

This patch modifies the upload_clip_state() functions to check for all
three possible noperspective interpolation modes.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_defines.h
src/mesa/drivers/dri/i965/gen6_clip_state.c
src/mesa/drivers/dri/i965/gen7_clip_state.c