Browse Source

nv50: fix stencil state

It's the front stencil methods that have contiguous offsets,
not the back ones.
Unfortunately the names in the header still have FRONT/BACK
reversed, so I'm using hex values until it gets updated.
tags/mesa_7_6_rc1
Christoph Bumiller 16 years ago
parent
commit
0204c7d8d7
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      src/gallium/drivers/nv50/nv50_state.c

+ 6
- 6
src/gallium/drivers/nv50/nv50_state.c View File

@@ -409,35 +409,35 @@ nv50_depth_stencil_alpha_state_create(struct pipe_context *pipe,
so_data (so, 0);
}

/*XXX: yes, I know they're backwards.. header needs fixing */
/* XXX: keep hex values until header is updated (names reversed) */
if (cso->stencil[0].enabled) {
so_method(so, tesla, NV50TCL_STENCIL_BACK_ENABLE, 5);
so_method(so, tesla, 0x1380, 8);
so_data (so, 1);
so_data (so, nvgl_stencil_op(cso->stencil[0].fail_op));
so_data (so, nvgl_stencil_op(cso->stencil[0].zfail_op));
so_data (so, nvgl_stencil_op(cso->stencil[0].zpass_op));
so_data (so, nvgl_comparison_op(cso->stencil[0].func));
so_method(so, tesla, NV50TCL_STENCIL_BACK_FUNC_REF, 3);
so_data (so, cso->stencil[0].ref_value);
so_data (so, cso->stencil[0].writemask);
so_data (so, cso->stencil[0].valuemask);
} else {
so_method(so, tesla, NV50TCL_STENCIL_BACK_ENABLE, 1);
so_method(so, tesla, 0x1380, 1);
so_data (so, 0);
}

if (cso->stencil[1].enabled) {
so_method(so, tesla, NV50TCL_STENCIL_FRONT_ENABLE, 8);
so_method(so, tesla, 0x1594, 5);
so_data (so, 1);
so_data (so, nvgl_stencil_op(cso->stencil[1].fail_op));
so_data (so, nvgl_stencil_op(cso->stencil[1].zfail_op));
so_data (so, nvgl_stencil_op(cso->stencil[1].zpass_op));
so_data (so, nvgl_comparison_op(cso->stencil[1].func));
so_method(so, tesla, 0x0f54, 3);
so_data (so, cso->stencil[1].ref_value);
so_data (so, cso->stencil[1].writemask);
so_data (so, cso->stencil[1].valuemask);
} else {
so_method(so, tesla, NV50TCL_STENCIL_FRONT_ENABLE, 1);
so_method(so, tesla, 0x1594, 1);
so_data (so, 0);
}


Loading…
Cancel
Save