v3d: handle Z clipping in v71

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
This commit is contained in:
Alejandro Piñeiro 2021-10-22 14:26:29 +02:00 committed by Marge Bot
parent 6eb063c66e
commit e54fbc197c

View file

@ -539,8 +539,22 @@ v3dX(emit_state)(struct pipe_context *pctx)
v3d_line_smoothing_enabled(v3d) ?
V3D_LINE_RASTERIZATION_PERP_END_CAPS :
V3D_LINE_RASTERIZATION_DIAMOND_EXIT;
}
#if V3D_VERSION >= 71
/* The following follows the logic implemented in v3dv
* plus the definition of depth_clip_near/far and
* depth_clamp.
*
* Note: some extensions are not supported by v3d
* (like ARB_depth_clamp) that would affect this, but
* the values on rasterizer are taking that into
* account.
*/
config.z_clipping_mode = v3d->rasterizer->base.depth_clip_near ||
v3d->rasterizer->base.depth_clip_far ?
V3D_Z_CLIP_MODE_MIN_ONE_TO_ONE : V3D_Z_CLIP_MODE_NONE;
#endif
}
}
if (v3d->dirty & V3D_DIRTY_RASTERIZER &&