Mesa (main): intel/fs: Handle non-perspective-correct interpolation on gen4-5

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 3 02:55:26 UTC 2021


Module: Mesa
Branch: main
Commit: f5e58838c2dc7fbca7f1fe2936b0e575cfe7067b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f5e58838c2dc7fbca7f1fe2936b0e575cfe7067b

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Fri Apr 24 17:45:08 2020 -0500

intel/fs: Handle non-perspective-correct interpolation on gen4-5

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11125>

---

 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.



More information about the mesa-commit mailing list