intel/fs: Don't use pixel_z for Gen4-5 source_depth_to_render_target
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 3 May 2021 18:59:30 +0000 (13:59 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 3 May 2021 23:51:51 +0000 (23:51 +0000)
commit3f36e027d37e28af08b91019df4bf3cdf08bfa2f
treeb179f846134340e251450900e8ac700bcb355471
parent71cff8171c22d0b363073625cfb4aab46c15c2ba
intel/fs: Don't use pixel_z for Gen4-5 source_depth_to_render_target

The source_depth_to_render_target flag can get set on old gen4-5 HW in a
few cases which are independent of the app writing gl_FragDepth.  It
should be safe to just use fetch_payload_reg in that case instead of
depending in interpolation setup.  This fixes a bug with certain very
simple shaders where we might end up not including the depth when we
should have.

While we're here, rework the logic around setting src_depth and add a
comment so it's more clear what's going on.

Fixes: 6d4070f3ddb5 "intel/compiler: add support for fragment coordinate..."
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10596>
src/intel/compiler/brw_fs_visitor.cpp