[Mesa-dev] [PATCH] anv: fix viewport transformation for z component

Jason Ekstrand jason at jlekstrand.net
Fri Sep 22 15:40:24 UTC 2017


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Cc: mesa-stable at lists.freedesktop.org

On Fri, Sep 22, 2017 at 3:22 AM, Samuel Iglesias Gonsálvez <
siglesias at igalia.com> wrote:

> Kindly reminder that this patch is still unreviewed.
>
> Sam
>
> On Friday, September 15, 2017 11:50:46 AM CEST you wrote:
> > In Vulkan, for 'z' (depth) component, the scale and translate values
> > for the viewport transformation are:
> >
> > pz = maxDepth - minDepth
> > oz = minDepth
> >
> > zf = pz × zd + oz
> >
> > Being zd, the third component in vertex's normalized device coordinates.
> >
> > Fixes: dEQP-VK.draw.inverted_depth_ranges.*
> >
> > Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> > ---
> >  src/intel/vulkan/gen8_cmd_buffer.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/intel/vulkan/gen8_cmd_buffer.c
> > b/src/intel/vulkan/gen8_cmd_buffer.c index 064b8e930e..7bea231ea7 100644
> > --- a/src/intel/vulkan/gen8_cmd_buffer.c
> > +++ b/src/intel/vulkan/gen8_cmd_buffer.c
> > @@ -49,10 +49,10 @@ gen8_cmd_buffer_emit_viewport(struct anv_cmd_buffer
> > *cmd_buffer) struct GENX(SF_CLIP_VIEWPORT) sf_clip_viewport = {
> >           .ViewportMatrixElementm00 = vp->width / 2,
> >           .ViewportMatrixElementm11 = vp->height / 2,
> > -         .ViewportMatrixElementm22 = 1.0,
> > +         .ViewportMatrixElementm22 = vp->maxDepth - vp->minDepth,
> >           .ViewportMatrixElementm30 = vp->x + vp->width / 2,
> >           .ViewportMatrixElementm31 = vp->y + vp->height / 2,
> > -         .ViewportMatrixElementm32 = 0.0,
> > +         .ViewportMatrixElementm32 = vp->minDepth,
> >           .XMinClipGuardband = -1.0f,
> >           .XMaxClipGuardband = 1.0f,
> >           .YMinClipGuardband = -1.0f,
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170922/a7887e79/attachment.html>


More information about the mesa-dev mailing list