summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_state.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-04-09 18:25:29 +0200
committerChristoph Bumiller <[email protected]>2011-04-10 14:06:52 +0200
commit7b4e478496cf45f527f72c39d72efe2e94fe2386 (patch)
treefd67fddaab6acd8c5e2c8882f1136e3d01908c50 /src/gallium/drivers/nv50/nv50_state.c
parentd9ef97696770c8a6b04e4adf9a813614f9b3c741 (diff)
nv50-nvc0: make use of COLOR_MASK,BLEND_ENABLE_COMMON
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_state.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_state.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c
index ef5a1842b11..799f49619d2 100644
--- a/src/gallium/drivers/nv50/nv50_state.c
+++ b/src/gallium/drivers/nv50/nv50_state.c
@@ -97,8 +97,14 @@ nv50_blend_state_create(struct pipe_context *pipe,
so->pipe = *cso;
- SB_BEGIN_3D(so, BLEND_ENABLE(0), 8);
+ SB_BEGIN_3D(so, COLOR_MASK_COMMON, 1);
+ SB_DATA (so, !cso->independent_blend_enable);
+
+ SB_BEGIN_3D(so, BLEND_ENABLE_COMMON, 1);
+ SB_DATA (so, !cso->independent_blend_enable);
+
if (cso->independent_blend_enable) {
+ SB_BEGIN_3D(so, BLEND_ENABLE(0), 8);
for (i = 0; i < 8; ++i) {
SB_DATA(so, cso->rt[i].blend_enable);
if (cso->rt[i].blend_enable)
@@ -121,8 +127,8 @@ nv50_blend_state_create(struct pipe_context *pipe,
}
}
} else {
- for (i = 0; i < 8; ++i)
- SB_DATA(so, cso->rt[0].blend_enable);
+ SB_BEGIN_3D(so, BLEND_ENABLE(0), 1);
+ SB_DATA (so, cso->rt[0].blend_enable);
}
if (emit_common_func) {
@@ -145,14 +151,13 @@ nv50_blend_state_create(struct pipe_context *pipe,
SB_DATA (so, 0);
}
- SB_BEGIN_3D(so, COLOR_MASK(0), 8);
if (cso->independent_blend_enable) {
+ SB_BEGIN_3D(so, COLOR_MASK(0), 8);
for (i = 0; i < 8; ++i)
SB_DATA(so, nv50_colormask(cso->rt[i].colormask));
} else {
- uint32_t cmask = nv50_colormask(cso->rt[0].colormask);
- for (i = 0; i < 8; ++i)
- SB_DATA(so, cmask);
+ SB_BEGIN_3D(so, COLOR_MASK(0), 1);
+ SB_DATA (so, nv50_colormask(cso->rt[0].colormask));
}
assert(so->size <= (sizeof(so->state) / sizeof(so->state[0])));