summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_compiler.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-07-12 03:57:25 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-07-20 11:01:16 -0700
commit1eef0b73aa323d94d5a080cd1efa81ccacdbd0d2 (patch)
tree9158aca5168f3b47ec9b5417aeac88683068ea12 /src/mesa/drivers/dri/i965/brw_compiler.c
parenta2dc11a7818c04d8dc0324e8fcba98d60baea529 (diff)
downloadexternal_mesa3d-1eef0b73aa323d94d5a080cd1efa81ccacdbd0d2.zip
external_mesa3d-1eef0b73aa323d94d5a080cd1efa81ccacdbd0d2.tar.gz
external_mesa3d-1eef0b73aa323d94d5a080cd1efa81ccacdbd0d2.tar.bz2
i965: Rewrite FS input handling to use the new NIR intrinsics.
This eliminates the need to walk the list of input variables, recurse into their types (via logic largely redundant with nir_lower_io), and interpolate all possible inputs up front. The backend no longer has to care about variables at all, which eliminates complications from trying to pack multiple variables into the same location. Instead, each intrinsic specifies exactly what's needed. This should unblock Timothy's work on GL_ARB_enhanced_layouts. Each load_interpolated_input intrinsic corresponds to PLN instructions, while load_barycentric_at_* intrinsics correspond to pixel interpolator messages. The pixel/centroid/sample barycentric intrinsics simply refer to payload fields (delta_xy[]), and don't actually generate any code. Because we use a single intrinsic for both centroid-qualified variables and interpolateAtCentroid(), they become indistinguishable. We stop sending pixel interpolator messages for those, and instead use the payload provided data, which should be considerably faster. On Broadwell: total instructions in shared programs: 9067751 -> 9067570 (-0.00%) instructions in affected programs: 145902 -> 145721 (-0.12%) helped: 422 HURT: 209 total spills in shared programs: 2849 -> 2899 (1.76%) spills in affected programs: 760 -> 810 (6.58%) helped: 0 HURT: 10 total fills in shared programs: 3910 -> 3950 (1.02%) fills in affected programs: 617 -> 657 (6.48%) helped: 0 HURT: 10 LOST: 3 GAINED: 3 The differences mostly appear to be slight changes in MOVs. v2: Use nir_shader_compiler_options::use_interpolated_input_intrinsics flag rather than passing it directly to nir_lower_io. Use the unreachable() macro rather than assert in one place. (Review feedback from Chris Forbes.) Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Chris Forbes <chrisforbes@google.com> Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_compiler.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_compiler.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_compiler.c b/src/mesa/drivers/dri/i965/brw_compiler.c
index a4855a0..afb70a1 100644
--- a/src/mesa/drivers/dri/i965/brw_compiler.c
+++ b/src/mesa/drivers/dri/i965/brw_compiler.c
@@ -40,6 +40,7 @@
.lower_fdiv = true, \
.lower_flrp64 = true, \
.native_integers = true, \
+ .use_interpolated_input_intrinsics = true, \
.vertex_id_zero_based = true
static const struct nir_shader_compiler_options scalar_nir_options = {