Skip to content

Commit

Permalink
st/nine: Fix DEPTHBIAS for GW2
Browse files Browse the repository at this point in the history
Fixes issue (3) for issue #224.
TODO: ask imirkin why this patch is necessary.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
  • Loading branch information
siro20 authored and Axel Davy committed Sep 10, 2016
1 parent f737e14 commit 94fe385
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
Expand Up @@ -699,6 +699,20 @@ nvc0_validate_rast_fb(struct nvc0_context *nvc0)
if (!rast)
return;

/* Disable POLYGON_OFFSET in case no depth stencil is bound. */
if (!fb->zsbuf) {
BEGIN_NVC0(push, NVC0_3D(POLYGON_OFFSET_POINT_ENABLE), 3);
PUSH_DATA (push, 0);
PUSH_DATA (push, 0);
PUSH_DATA (push, 0);
return;
} else {
BEGIN_NVC0(push, NVC0_3D(POLYGON_OFFSET_POINT_ENABLE), 3);
PUSH_DATA (push, rast->offset_point);
PUSH_DATA (push, rast->offset_line);
PUSH_DATA (push, rast->offset_tri);
}

if (rast->offset_units_unscaled) {
BEGIN_NVC0(push, NVC0_3D(POLYGON_OFFSET_UNITS), 1);
if (fb->zsbuf && fb->zsbuf->format == PIPE_FORMAT_Z16_UNORM)
Expand Down

0 comments on commit 94fe385

Please sign in to comment.