lima: Fix drawing wide lines
authorAndreas Baierl <ichgeh@imkreisrum.de>
Tue, 21 Sep 2021 16:21:06 +0000 (18:21 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 11 Nov 2021 11:25:58 +0000 (11:25 +0000)
commitee41e1bbd2a57f58b616d560451759a4fcd940db
tree3f855f97df2a216a5afbc6bf0b663cf565598a61
parent3e7bac80ce5cc1de7d13dfc6ae17526a03ddffcc
lima: Fix drawing wide lines

GLES2.0 spec allows parts of wide lines and points to be drawn even if
their center is outside the viewport.
Therefore 0x2000 in PLBU_CMD_PRIMITIVE_SETUP has to be set for points.
This is already our default setting as it seems to have no negative
effect when this bit is always set. Points work as expected but lines
don't. It's hard to RE it, because the affected deqp tests also fail
with the blob.

To respect this behaviour for lines and solve another 2 tests, we need
to do a workaround and temporarily extend the viewport by half of the
line width. The scissor rectangle is still equal with the initial
viewport.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12971>
src/gallium/drivers/lima/ci/lima-fails.txt
src/gallium/drivers/lima/lima_context.h
src/gallium/drivers/lima/lima_draw.c
src/gallium/drivers/lima/lima_state.c