summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d/v3dx_emit.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-06-13 13:44:01 -0700
committerEric Anholt <[email protected]>2018-06-14 17:03:16 -0700
commitcd2e673abc436d71e304fd5ad577054197041c7f (patch)
treebde441620854c98c91cff193dfaa23d7c49fc7a0 /src/gallium/drivers/v3d/v3dx_emit.c
parentd91e06a06572a4c4772b02dfc39dcbd283b490f9 (diff)
v3d: Fix polygon offset for Z16 buffers.
Fixes: dEQP-GLES3.functional.polygon_offset.fixed16_displacement_with_units dEQP-GLES3.functional.polygon_offset.fixed16_render_with_units
Diffstat (limited to 'src/gallium/drivers/v3d/v3dx_emit.c')
-rw-r--r--src/gallium/drivers/v3d/v3dx_emit.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/v3d/v3dx_emit.c b/src/gallium/drivers/v3d/v3dx_emit.c
index 161ce51b2ff..ac93badfda8 100644
--- a/src/gallium/drivers/v3d/v3dx_emit.c
+++ b/src/gallium/drivers/v3d/v3dx_emit.c
@@ -431,8 +431,14 @@ v3dX(emit_state)(struct pipe_context *pctx)
cl_emit(&job->bcl, DEPTH_OFFSET, depth) {
depth.depth_offset_factor =
v3d->rasterizer->offset_factor;
- depth.depth_offset_units =
- v3d->rasterizer->offset_units;
+ if (job->zsbuf &&
+ job->zsbuf->format == PIPE_FORMAT_Z16_UNORM) {
+ depth.depth_offset_units =
+ v3d->rasterizer->z16_offset_units;
+ } else {
+ depth.depth_offset_units =
+ v3d->rasterizer->offset_units;
+ }
}
}