From: Jonathan Marek Date: Mon, 2 Sep 2019 18:46:15 +0000 (-0400) Subject: etnaviv: fix depth bias X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b524e1acbe7d704a9920302529a0e02e8ef9a55;p=mesa.git etnaviv: fix depth bias 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 Reviewed-by: Christian Gmeiner --- diff --git a/src/gallium/drivers/etnaviv/etnaviv_rasterizer.c b/src/gallium/drivers/etnaviv/etnaviv_rasterizer.c index b782e120537..2f218d6c063 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_rasterizer.c +++ b/src/gallium/drivers/etnaviv/etnaviv_rasterizer.c @@ -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 */ diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c index 79922f26647..e3c2345cb32 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_state.c +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c @@ -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 */