radeonsi: Implement POLYGON_OFFSET_UNITS_UNSCALED
authorAxel Davy <axel.davy@ens.fr>
Tue, 14 Jun 2016 20:41:50 +0000 (22:41 +0200)
committerAxel Davy <axel.davy@ens.fr>
Sat, 25 Jun 2016 08:16:15 +0000 (10:16 +0200)
commitbe7957b156e30ffe9fb647b58ba00e236e498c3f
tree32cbeb9404cc19247a6ee84254cd87d9ea801cfe
parentc2b7b48a54e0124dd8aa0513a264d76535ea9829
radeonsi: Implement POLYGON_OFFSET_UNITS_UNSCALED

Empirical tests show that the polygon offset
behaviour is entirely determined by the content of
the PA_SU_POLY_OFFSET states, and not by the depth buffer
format bound.

PA_SU_POLY_OFFSET seems to directly set the parameters of
the polygon offset formula, and setting 0 for
PA_SU_POLY_OFFSET_DB_FMT_CNTL (ie setting the unorm depth
bias behaviour with a scale of 2^0 = 1.0f) gives the unscaled
behaviour.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_state.c