nvk: Fix viewport Z scale

Because Z needs to end up in [0, 1] and not [-1, 1], we don't want to
divide by 2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-01-30 20:11:55 -06:00 committed by Marge Bot
parent 9deab8f139
commit c6a50c2745

View file

@ -693,8 +693,7 @@ nvk_flush_vp_state(struct nvk_cmd_buffer *cmd)
P_MTHD(p, NV9097, SET_VIEWPORT_SCALE_X(i));
P_NV9097_SET_VIEWPORT_SCALE_X(p, i, fui(0.5f * vp->width));
P_NV9097_SET_VIEWPORT_SCALE_Y(p, i, fui(0.5f * vp->height));
P_NV9097_SET_VIEWPORT_SCALE_Z(p, i,
fui(0.5f * (vp->maxDepth - vp->minDepth)));
P_NV9097_SET_VIEWPORT_SCALE_Z(p, i, fui(vp->maxDepth - vp->minDepth));
P_NV9097_SET_VIEWPORT_OFFSET_X(p, i, fui(vp->x + 0.5f * vp->width));
P_NV9097_SET_VIEWPORT_OFFSET_Y(p, i, fui(vp->y + 0.5f * vp->height));