From dc8c0959bd2b0fb9927f365d3e75e6a9e3c9cf14 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 11 Feb 2010 22:48:31 +0100 Subject: nv40: adapt to stencil ref changes --- src/gallium/drivers/nv40/nv40_state_zsa.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/gallium/drivers/nv40/nv40_state_zsa.c') diff --git a/src/gallium/drivers/nv40/nv40_state_zsa.c b/src/gallium/drivers/nv40/nv40_state_zsa.c index fb760677c8..4c734f4864 100644 --- a/src/gallium/drivers/nv40/nv40_state_zsa.c +++ b/src/gallium/drivers/nv40/nv40_state_zsa.c @@ -15,3 +15,27 @@ struct nv40_state_entry nv40_state_zsa = { .hw = NV40_STATE_ZSA } }; + +static boolean +nv40_state_sr_validate(struct nv40_context *nv40) +{ + struct nouveau_stateobj *so = so_new(2, 2, 0); + struct pipe_stencil_ref *sr = &nv40->stencil_ref; + + so_method(so, nv40->screen->rankine, NV40TCL_STENCIL_FRONT_FUNC_REF, 1); + so_data (so, sr->ref_value[0]; + so_method(so, nv40->screen->rankine, NV40TCL_STENCIL_BACK_FUNC_REF, 1); + so_data (so, sr->ref_value[1]; + + so_ref(so, &nv40->state.hw[NV40_STATE_SR]); + so_ref(NULL, &so); + return TRUE; +} + +struct nv40_state_entry nv40_state_sr = { + .validate = nv40_state_sr_validate, + .dirty = { + .pipe = NV40_NEW_SR, + .hw = NV40_STATE_SR + } +}; -- cgit v1.2.3