diff options
author | Christoph Bumiller <[email protected]> | 2011-03-02 19:41:08 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-03-02 20:59:53 +0100 |
commit | ddcb90248fb491a3a9e2ada8c595f94b0bd95515 (patch) | |
tree | b8ec8a04d79dc45145d65df9c9d55b4ed570c550 /src/gallium/drivers/nv50/nv50_state.c | |
parent | 669de7016ce3e95c6d1e4ee8e41b5bfe95f32105 (diff) |
nv50: implement independent blend functions for nva3+ and fix cap
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_state.c')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_state.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 17f272bb3bf..2f6fdb4c48c 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -88,7 +88,14 @@ nv50_blend_state_create(struct pipe_context *pipe, { struct nv50_blend_stateobj *so = CALLOC_STRUCT(nv50_blend_stateobj); int i; - boolean blend_enabled = cso->rt[0].blend_enable; + boolean emit_common_func = cso->rt[0].blend_enable; + + const uint32_t chipset = nv50_context(pipe)->screen->base.device->chipset; + + if (chipset >= 0xa3) { + SB_BEGIN_3D(so, BLEND_INDEPENDENT, 1); + SB_DATA (so, cso->independent_blend_enable); + } so->pipe = *cso; @@ -97,14 +104,30 @@ nv50_blend_state_create(struct pipe_context *pipe, for (i = 0; i < 8; ++i) { SB_DATA(so, cso->rt[i].blend_enable); if (cso->rt[i].blend_enable) - blend_enabled = TRUE; + emit_common_func = TRUE; + } + + if (chipset >= 0xa3) { + emit_common_func = FALSE; + + for (i = 0; i < 8; ++i) { + if (!cso->rt[i].blend_enable) + continue; + SB_BEGIN_3D_(so, NVA3_3D_IBLEND_EQUATION_RGB(i), 6); + SB_DATA (so, nvgl_blend_eqn(cso->rt[i].rgb_func)); + SB_DATA (so, nv50_blend_fac(cso->rt[i].rgb_src_factor)); + SB_DATA (so, nv50_blend_fac(cso->rt[i].rgb_dst_factor)); + SB_DATA (so, nvgl_blend_eqn(cso->rt[i].alpha_func)); + SB_DATA (so, nv50_blend_fac(cso->rt[i].alpha_src_factor)); + SB_DATA (so, nv50_blend_fac(cso->rt[i].alpha_dst_factor)); + } } } else { for (i = 0; i < 8; ++i) - SB_DATA(so, blend_enabled); + SB_DATA(so, cso->rt[0].blend_enable); } - if (blend_enabled) { + if (emit_common_func) { SB_BEGIN_3D(so, BLEND_EQUATION_RGB, 5); SB_DATA (so, nvgl_blend_eqn(cso->rt[0].rgb_func)); SB_DATA (so, nv50_blend_fac(cso->rt[0].rgb_src_factor)); |