summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50
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
parentd9ef97696770c8a6b04e4adf9a813614f9b3c741 (diff)
nv50-nvc0: make use of COLOR_MASK,BLEND_ENABLE_COMMON
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r--src/gallium/drivers/nv50/nv50_3d.xml.h6
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.c2
-rw-r--r--src/gallium/drivers/nv50/nv50_state.c19
-rw-r--r--src/gallium/drivers/nv50/nv50_stateobj.h2
4 files changed, 18 insertions, 11 deletions
diff --git a/src/gallium/drivers/nv50/nv50_3d.xml.h b/src/gallium/drivers/nv50/nv50_3d.xml.h
index e3177e0b8bd..41a380ec2ec 100644
--- a/src/gallium/drivers/nv50/nv50_3d.xml.h
+++ b/src/gallium/drivers/nv50/nv50_3d.xml.h
@@ -558,7 +558,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NV50_3D_UNK0F8C 0x00000f8c
-#define NV50_3D_UNK0F90 0x00000f90
+#define NV50_3D_COLOR_MASK_COMMON 0x00000f90
#define NV50_3D_UNK0F94 0x00000f94
@@ -1007,7 +1007,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NV50_3D_TEX_CACHE_CTL_UNK1__MASK 0x00000030
#define NV50_3D_TEX_CACHE_CTL_UNK1__SHIFT 4
-#define NV50_3D_UNK133C 0x0000133c
+#define NV50_3D_BLEND_SEPARATE_ALPHA 0x0000133c
#define NV50_3D_BLEND_EQUATION_RGB 0x00001340
#define NV50_3D_BLEND_EQUATION_RGB_FUNC_ADD 0x00008006
@@ -1033,7 +1033,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NV50_3D_BLEND_FUNC_DST_ALPHA 0x00001358
-#define NV50_3D_UNK135C 0x0000135c
+#define NV50_3D_BLEND_ENABLE_COMMON 0x0000135c
#define NV50_3D_BLEND_ENABLE(i0) (0x00001360 + 0x4*(i0))
#define NV50_3D_BLEND_ENABLE__ESIZE 0x00000004
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
index 439202dfe97..46622b4be76 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -422,6 +422,8 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
OUT_RING (chan, 0);
BEGIN_RING(chan, RING_3D(LINE_LAST_PIXEL), 1);
OUT_RING (chan, 0);
+ BEGIN_RING(chan, RING_3D(BLEND_SEPARATE_ALPHA), 1);
+ OUT_RING (chan, 1);
BEGIN_RING(chan, RING_3D(SCREEN_Y_CONTROL), 1);
OUT_RING (chan, 0);
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])));
diff --git a/src/gallium/drivers/nv50/nv50_stateobj.h b/src/gallium/drivers/nv50/nv50_stateobj.h
index cd55ad83f84..4c98c7e46fc 100644
--- a/src/gallium/drivers/nv50/nv50_stateobj.h
+++ b/src/gallium/drivers/nv50/nv50_stateobj.h
@@ -21,7 +21,7 @@
struct nv50_blend_stateobj {
struct pipe_blend_state pipe;
int size;
- uint32_t state[78];
+ uint32_t state[82]; // TODO: allocate less if !independent_blend_enable
};
struct nv50_rasterizer_stateobj {