i965: Add a pass to demote sample interpolation intrinsics.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 18 Jul 2016 01:37:08 +0000 (18:37 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 20 Jul 2016 18:01:08 +0000 (11:01 -0700)
commit048a56c1fc8f66e74645cc5ff4b4eb3d5ee471a8
tree3746b590e46880e42de47df946fea53f1e3726f1
parent707ca00fce464af84212fa1fff573f5814a8c118
i965: Add a pass to demote sample interpolation intrinsics.

When working with a non-multisampled render target, asking for "sample"
interpolation locations doesn't make sense.  We demote them to centroid.

In a couple of patches, brw_compute_barycentric_modes will begin looking
at these intrinsics to determine the barycentric modes.  fs_visitor also
will use them to code-generate pixel interpolator messages or payload
references.  Handling the "but what if it's not MSAA?" logic ahead of
time in a NIR pass simplifies things and prevents duplicated logic.

This patch doesn't actually do anything useful yet as we don't generate
these intrinsics.  I decided to keep it separate as it's self-contained,
in the hopes of shrinking the "convert everything" patch for reviewers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_fs.cpp