mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 17:48:10 +02:00
i965/fs: Don't try to use bogus interpolation modes pre-Gen6.
Interpolation modes other than perspective-barycentric-pixel-center (and
their associated coefficients in the WM payload) only exist in Gen6 and
later.
Unfortunately, if a varying was declared as `centroid`, we would blindly
read the nonexistant values, and so produce all manner of bad behavior
-- texture swimming, snow, etc.
Fixes rendering in Counter-Strike Source and Team Fortress 2 on
Ironlake.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 79f786f936)
This commit is contained in:
parent
f81eea3f1f
commit
34a4fc5989
1 changed files with 17 additions and 9 deletions
|
|
@ -959,16 +959,24 @@ fs_visitor::emit_linterp(const fs_reg &attr, const fs_reg &interp,
|
|||
bool is_centroid)
|
||||
{
|
||||
brw_wm_barycentric_interp_mode barycoord_mode;
|
||||
if (is_centroid) {
|
||||
if (interpolation_mode == INTERP_QUALIFIER_SMOOTH)
|
||||
barycoord_mode = BRW_WM_PERSPECTIVE_CENTROID_BARYCENTRIC;
|
||||
else
|
||||
barycoord_mode = BRW_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC;
|
||||
if (intel->gen >= 6) {
|
||||
if (is_centroid) {
|
||||
if (interpolation_mode == INTERP_QUALIFIER_SMOOTH)
|
||||
barycoord_mode = BRW_WM_PERSPECTIVE_CENTROID_BARYCENTRIC;
|
||||
else
|
||||
barycoord_mode = BRW_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC;
|
||||
} else {
|
||||
if (interpolation_mode == INTERP_QUALIFIER_SMOOTH)
|
||||
barycoord_mode = BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC;
|
||||
else
|
||||
barycoord_mode = BRW_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC;
|
||||
}
|
||||
} else {
|
||||
if (interpolation_mode == INTERP_QUALIFIER_SMOOTH)
|
||||
barycoord_mode = BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC;
|
||||
else
|
||||
barycoord_mode = BRW_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC;
|
||||
/* On Ironlake and below, there is only one interpolation mode.
|
||||
* Centroid interpolation doesn't mean anything on this hardware --
|
||||
* there is no multisampling.
|
||||
*/
|
||||
barycoord_mode = BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC;
|
||||
}
|
||||
return emit(FS_OPCODE_LINTERP, attr,
|
||||
this->delta_x[barycoord_mode],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue