[Mesa-dev] [PATCH v2 6/7] i965: add functional changes for AMD_depth_clamp_separate

Ilia Mirkin imirkin at alum.mit.edu
Wed Aug 22 20:32:49 UTC 2018


I admit to always being confused by depth, but:

On Wed, Aug 22, 2018, 16:23 Sagar Ghuge <sagar.ghuge at intel.com> wrote:

> Gen >= 9 have ability to control clamping of depth values separately at
> near and far plane.
>
> z_w is clamped to the range [min(n,f), 0] if clamping at near plane is
> enabled, [0, max(n,f)] if clamping at far plane is enabled and [min(n,f)
> max(n,f)] if clamping at both plane is enabled.
>
> v2: 1) Use better coding style (Ian Romanick)
>
> Signed-off-by: Sagar Ghuge <sagar.ghuge at intel.com>
> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/mesa/drivers/dri/i965/genX_state_upload.c | 20 ++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c
> b/src/mesa/drivers/dri/i965/genX_state_upload.c
> index dc54cb67af..b49c5839b5 100644
> --- a/src/mesa/drivers/dri/i965/genX_state_upload.c
> +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
> @@ -2343,6 +2343,12 @@ genX(upload_cc_viewport)(struct brw_context *brw)
>        if (ctx->Transform.DepthClampNear && ctx->Transform.DepthClampFar) {
>           ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
>           ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
> +      } else if (ctx->Transform.DepthClampNear) {
> +         ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
> +         ccv.MaximumDepth = 0.0;
>

Should this be 1.0? If so, probably should add some tests that would catch
it.

Cheers,

  -ilia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180822/ca571627/attachment.html>


More information about the mesa-dev mailing list