i965/skl: Set the pulls bary bit in 3DSTATE_PS_EXTRA
authorNeil Roberts <neil@linux.intel.com>
Fri, 3 Jul 2015 12:15:21 +0000 (13:15 +0100)
committerNeil Roberts <neil@linux.intel.com>
Mon, 6 Jul 2015 15:15:31 +0000 (08:15 -0700)
On Gen9+ there is a new bit in 3DSTATE_PS_EXTRA that must be set if
the shader sends a message to the pixel interpolator. This fixes the
interpolateAt* tests on SKL, apart from interpolateatsample-nonconst
but that is not implemented anywhere so it's not a regression.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.6 10.5" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_defines.h
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/gen8_ps_state.c

index 3553f6ec48cc9eba40a3ac260bad3c8394251e1c..759613951d8a43be112340f76913e24522ce06bf 100644 (file)
@@ -415,6 +415,7 @@ struct brw_wm_prog_data {
    bool uses_pos_offset;
    bool uses_omask;
    bool uses_kill;
+   bool pulls_bary;
    uint32_t prog_offset_16;
 
    /**
index 66b9abc99910a329cb83d5cba110442ff9ba7bd5..19489aba5beba914ccf76b56b12aef4eedca0fbc 100644 (file)
@@ -2145,6 +2145,7 @@ enum brw_pixel_shader_computed_depth_mode {
 # define GEN8_PSX_SHADER_DISABLES_ALPHA_TO_COVERAGE     (1 << 7)
 # define GEN8_PSX_SHADER_IS_PER_SAMPLE                  (1 << 6)
 # define GEN8_PSX_SHADER_COMPUTES_STENCIL               (1 << 5)
+# define GEN9_PSX_SHADER_PULLS_BARY                     (1 << 3)
 # define GEN8_PSX_SHADER_HAS_UAV                        (1 << 2)
 # define GEN8_PSX_SHADER_USES_INPUT_COVERAGE_MASK       (1 << 1)
 
index bd71404ef8d42f72452f2140fc6160f914c9052d..3ebc3a2c5e47798593650e9e5660175d168c49b3 100644 (file)
@@ -1481,6 +1481,10 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
    case nir_intrinsic_interp_var_at_centroid:
    case nir_intrinsic_interp_var_at_sample:
    case nir_intrinsic_interp_var_at_offset: {
+      assert(stage == MESA_SHADER_FRAGMENT);
+
+      ((struct brw_wm_prog_data *) prog_data)->pulls_bary = true;
+
       fs_reg dst_xy = bld.vgrf(BRW_REGISTER_TYPE_F, 2);
 
       /* For most messages, we need one reg of ignored data; the hardware
index a88f109c691a6c1bf4c39b6644eaf086cc515f0d..d5445093e67f075b46a4c7dd4307699736826a0d 100644 (file)
@@ -58,6 +58,9 @@ gen8_upload_ps_extra(struct brw_context *brw,
    if (prog_data->uses_omask)
       dw1 |= GEN8_PSX_OMASK_TO_RENDER_TARGET;
 
+   if (brw->gen >= 9 && prog_data->pulls_bary)
+      dw1 |= GEN9_PSX_SHADER_PULLS_BARY;
+
    if (_mesa_active_fragment_shader_has_atomic_ops(&brw->ctx))
       dw1 |= GEN8_PSX_SHADER_HAS_UAV;