anv: fix viewport transformation for z component
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Fri, 15 Sep 2017 08:05:03 +0000 (10:05 +0200)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Mon, 25 Sep 2017 04:39:40 +0000 (06:39 +0200)
commitd2cd9deeb8db5941e99b149fa637f711198ca741
tree4153daab3e9f4abdbddc2d3a182cd9ea5bcb9608
parent3e544932658d87beb661a3e762621264733171df
anv: fix viewport transformation for z component

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@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
src/intel/vulkan/gen8_cmd_buffer.c