diff options
author | Jonathan Marek <[email protected]> | 2019-09-05 17:21:54 -0400 |
---|---|---|
committer | Jonathan Marek <[email protected]> | 2019-09-06 02:24:29 +0000 |
commit | 88ca73bcd04582ad5e42507e53b3cdff96a87fbd (patch) | |
tree | 59b837a5c2dd7d2a5275e5d10f0f68fe00ce9762 /src/gallium/drivers/freedreno/a2xx | |
parent | ac4ca24c32bc4a1821790b5d2fdbf201680d3e67 (diff) |
freedreno/a2xx: implement polygon offset
Fixes failures in the following deqp tests:
dEQP-GLES2.functional.polygon_offset.*
Signed-off-by: Jonathan Marek <[email protected]>
Reviewed-by: Rob Clark <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a2xx')
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/fd2_emit.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_emit.c b/src/gallium/drivers/freedreno/a2xx/fd2_emit.c index 38286ec939b..32da74f85a5 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_emit.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_emit.c @@ -301,6 +301,18 @@ fd2_emit_state(struct fd_context *ctx, const enum fd_dirty_3d_state dirty) OUT_RING(ring, fui(1.0)); /* PA_CL_GB_VERT_DISC_ADJ */ OUT_RING(ring, fui(1.0)); /* PA_CL_GB_HORZ_CLIP_ADJ */ OUT_RING(ring, fui(1.0)); /* PA_CL_GB_HORZ_DISC_ADJ */ + + if (rasterizer->base.offset_tri) { + /* TODO: why multiply scale by 2 ? without it deqp test fails + * deqp/piglit tests aren't very precise + */ + OUT_PKT3(ring, CP_SET_CONSTANT, 5); + OUT_RING(ring, CP_REG(REG_A2XX_PA_SU_POLY_OFFSET_FRONT_SCALE)); + OUT_RING(ring, fui(rasterizer->base.offset_scale * 2.0f)); /* FRONT_SCALE */ + OUT_RING(ring, fui(rasterizer->base.offset_units)); /* FRONT_OFFSET */ + OUT_RING(ring, fui(rasterizer->base.offset_scale * 2.0f)); /* BACK_SCALE */ + OUT_RING(ring, fui(rasterizer->base.offset_units)); /* BACK_OFFSET */ + } } /* NOTE: scissor enabled bit is part of rasterizer state: */ |