[Mesa-dev] [PATCH] i965/fs: Don't try to use bogus interpolation modes pre-Gen6.

Paul Berry stereotype441 at gmail.com
Fri Apr 26 21:26:36 PDT 2013


On 26 April 2013 16:52, Chris Forbes <chrisf at ijw.co.nz> wrote:

> 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 at ijw.co.nz>
>

This bug was my fault--thanks for fixing it.

Reviewed-by: Paul Berry <stereotype441 at gmail.com>

A few procedural notes about backporting this stuff to 9.1:

- Usually we like to let patches sit on master for about a week before
backporting them to 9.1 to make sure no one discovers problems with them.
So I would say go ahead and commit your backport of 0967c362 now (since
it's based on a commit that's been in master for nearly a month), but wait
a while before backporting this patch.

- When committing a patch to master that's intended to be backported to
stable branches, please include the comment "NOTE: This is a candidate for
the 9.1 branch." or "NOTE: This is a candidate for stable branches".  We
have a script (bin/get-pick-list.sh) which uses this phrase to identify
patches that should be backported to stable branches.

- When you do the backport, please use "git cherry-pick -x".  This adds
"(cherry picked from commit ...)" to the commit message.
bin/get-pick-list.sh looks for this message to identify patches that no
longer need backporting.

- We try really hard to make sure that no patch on a stable branch
introduces any regressions or build errors (not even transient ones that
are fixed in the next commit).  Please do a clean build and a full piglit
run before pushing to 9.1 to make sure there are no regressions.

Thanks :)

>
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 26 +++++++++++++++++---------
>  1 file changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp
> b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 66e78d0..1d810d8 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -984,16 +984,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],
> --
> 1.8.2.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130426/fbe9c279/attachment.html>


More information about the mesa-dev mailing list