From f5e58838c2dc7fbca7f1fe2936b0e575cfe7067b Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 24 Apr 2020 17:45:08 -0500 Subject: [PATCH] intel/fs: Handle non-perspective-correct interpolation on gen4-5 Reviewed-by: Dave Airlie Part-of: --- src/intel/compiler/brw_fs_visitor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/intel/compiler/brw_fs_visitor.cpp b/src/intel/compiler/brw_fs_visitor.cpp index b58ec72e465..ae891703831 100644 --- a/src/intel/compiler/brw_fs_visitor.cpp +++ b/src/intel/compiler/brw_fs_visitor.cpp @@ -191,6 +191,13 @@ fs_visitor::emit_interpolation_setup_gfx4() this->pixel_z = fetch_payload_reg(bld, payload.source_depth_reg); + /* The SF program automatically handles doing the perspective correction or + * not based on wm_prog_data::interp_mode[] so we can use the same pixel + * offsets for both perspective and non-perspective. + */ + this->delta_xy[BRW_BARYCENTRIC_NONPERSPECTIVE_PIXEL] = + this->delta_xy[BRW_BARYCENTRIC_PERSPECTIVE_PIXEL]; + abld = bld.annotate("compute pos.w and 1/pos.w"); /* Compute wpos.w. It's always in our setup, since it's needed to * interpolate the other attributes.