lima: fix handling of reverse depth range
authorVasily Khoruzhick <anarsoul@gmail.com>
Wed, 15 Jan 2020 03:53:29 +0000 (19:53 -0800)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Jan 2020 01:57:05 +0000 (01:57 +0000)
commite5226cff75fc42bdd5a03287a8061f1d8992e062
treeee1f78ed3b73a00c5006dc06fefa1b269df98d68
parent784b84d308f51430dbd4d9c58fd598c34c4ceefb
lima: fix handling of reverse depth range

Looks like we need to handle cases when near > far and near == far.
In first case we just need to swap near and far, and in second we
need subtract epsilon from near if it's not zero.

Fixes 10 tests in dEQP-GLES2.functional.depth_range.*

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3400>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3400>
src/gallium/drivers/lima/lima_draw.c
src/gallium/drivers/lima/lima_state.c