etnaviv: fix depth bias
authorJonathan Marek <jonathan@marek.ca>
Mon, 2 Sep 2019 18:46:15 +0000 (14:46 -0400)
committerJonathan Marek <jonathan@marek.ca>
Wed, 30 Oct 2019 19:44:41 +0000 (19:44 +0000)
Fixes remaining failures in these deqp tests (tested on GC3000/GC7000L):
dEQP-GLES2.functional.polygon_offset.*

Fixes: 6c3c05dc ("etnaviv: fix polygon offset")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_rasterizer.c
src/gallium/drivers/etnaviv/etnaviv_state.c

index b782e120537bb30c219ce8ea603799c447648ec1..2f218d6c063341db7ac17e743e08816d95ef566f 100644 (file)
@@ -56,7 +56,7 @@ etna_rasterizer_state_create(struct pipe_context *pctx,
    cs->PA_LINE_WIDTH = fui(so->line_width / 2.0f);
    cs->PA_POINT_SIZE = fui(so->point_size / 2.0f);
    cs->SE_DEPTH_SCALE = fui(so->offset_scale);
-   cs->SE_DEPTH_BIAS = fui(so->offset_units);
+   cs->SE_DEPTH_BIAS = fui((so->offset_units / 65535.0f) * 2.0f);
    cs->SE_CONFIG = COND(so->line_last_pixel, VIVS_SE_CONFIG_LAST_PIXEL_ENABLE);
    /* XXX anything else? */
    /* XXX bottom_edge_rule */
index 79922f2664727dafbf49e8fb671fad85cf442f91..e3c2345cb327158e9844dc57ef7874ee52944633 100644 (file)
@@ -233,6 +233,7 @@ etna_set_framebuffer_state(struct pipe_context *pctx,
          depth_format |
          COND(depth_supertiled, VIVS_PE_DEPTH_CONFIG_SUPER_TILED) |
          VIVS_PE_DEPTH_CONFIG_DEPTH_MODE_Z |
+         VIVS_PE_DEPTH_CONFIG_UNK18 | /* something to do with clipping? */
          COND(ctx->specs.halti >= 5, VIVS_PE_DEPTH_CONFIG_DISABLE_ZS) /* Needs to be enabled on GC7000, otherwise depth writes hang w/ TS - apparently it does something else now */
          ;
       /* VIVS_PE_DEPTH_CONFIG_ONLY_DEPTH */