llvmpipe: always take depth clamping from state tracker

Don't be smarter than state tracker here, of d3d10 wants to do
something the state tracker should hard code that. Since lavapipe
wants to use clip_halfz and depth clipping independently.

This fixes some issues blitting Z that zink was seeing

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10068>
This commit is contained in:
Dave Airlie 2021-04-07 11:18:44 +10:00
parent f96f016c22
commit 60bdf61d68

View file

@ -3986,20 +3986,8 @@ make_variant_key(struct llvmpipe_context *lp,
* Propagate the depth clamp setting from the rasterizer state.
* depth_clip == 0 implies depth clamping is enabled.
*
* When clip_halfz is enabled, then always clamp the depth values.
*
* XXX: This is incorrect for GL, but correct for d3d10 (depth
* clamp is always active in d3d10, regardless if depth clip is
* enabled or not).
* (GL has an always-on [0,1] clamp on fs depth output instead
* to ensure the depth values stay in range. Doesn't look like
* we do that, though...)
*/
if (lp->rasterizer->clip_halfz) {
key->depth_clamp = 1;
} else {
key->depth_clamp = (lp->rasterizer->depth_clip_near == 0) ? 1 : 0;
}
key->depth_clamp = (lp->rasterizer->depth_clip_near == 0) ? 1 : 0;
/* alpha test only applies if render buffer 0 is non-integer (or does not exist) */
if (!lp->framebuffer.nr_cbufs ||