intel/fs: Set NonPerspectiveBarycentricEnable when the interpolator needs it.

[anholt: changed to make all drivers do the right thing by moving the
payload barycentric check into the compiler]

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17381>
This commit is contained in:
Lionel Landwerlin
2022-07-07 12:24:38 +03:00
committed by Marge Bot
parent 075564c251
commit 2d1f021e16
6 changed files with 22 additions and 10 deletions

View File

@@ -889,10 +889,17 @@ struct brw_wm_prog_data {
/**
* Mask of which interpolation modes are required by the fragment shader.
* Used in hardware setup on gfx6+.
* Those interpolations are delivered as part of the thread payload. Used
* in hardware setup on gfx6+.
*/
uint32_t barycentric_interp_modes;
/**
* Whether nonperspective interpolation modes are used by the
* barycentric_interp_modes or fragment shader through interpolator messages.
*/
bool uses_nonperspective_interp_modes;
/**
* Mask of which FS inputs are marked flat by the shader source. This is
* needed for setting up 3DSTATE_SF/SBE.

View File

@@ -7277,6 +7277,9 @@ brw_nir_populate_wm_prog_data(const nir_shader *shader,
prog_data->barycentric_interp_modes =
brw_compute_barycentric_interp_modes(devinfo, shader);
prog_data->uses_nonperspective_interp_modes |=
(prog_data->barycentric_interp_modes &
BRW_BARYCENTRIC_NONPERSPECTIVE_BITS) != 0;
/* You can't be coarse and per-sample */
assert(!key->coarse_pixel || !key->persample_interp);

View File

@@ -2168,7 +2168,14 @@ emit_pixel_interpolater_send(const fs_builder &bld,
fs_inst *inst = bld.emit(opcode, dst, src, desc);
/* 2 floats per slot returned */
inst->size_written = 2 * dst.component_size(inst->exec_size);
inst->pi_noperspective = interpolation == INTERP_MODE_NOPERSPECTIVE;
if (interpolation == INTERP_MODE_NOPERSPECTIVE) {
inst->pi_noperspective = true;
/* TGL BSpec says:
* This field cannot be set to "Linear Interpolation"
* unless Non-Perspective Barycentric Enable in 3DSTATE_CLIP is enabled"
*/
wm_prog_data->uses_nonperspective_interp_modes = true;
}
wm_prog_data->pulls_bary = true;