summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv40/nv40_state_emit.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-02-18 16:26:33 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-02-18 16:26:33 +1100
commit112ba3355a3fa53768efb9a9fb0eeb677bd28d47 (patch)
tree1fc392e27f07491a72e7ea9caefa103b25c2181e /src/gallium/drivers/nv40/nv40_state_emit.c
parentf911235f64d610e57da88487133d0483c7a094e7 (diff)
nv40: until gallium is fixed we'll need a fallback for user clip planes
Diffstat (limited to 'src/gallium/drivers/nv40/nv40_state_emit.c')
-rw-r--r--src/gallium/drivers/nv40/nv40_state_emit.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/gallium/drivers/nv40/nv40_state_emit.c b/src/gallium/drivers/nv40/nv40_state_emit.c
index 244c6838f3..ce52a3863e 100644
--- a/src/gallium/drivers/nv40/nv40_state_emit.c
+++ b/src/gallium/drivers/nv40/nv40_state_emit.c
@@ -79,15 +79,15 @@ nv40_state_stipple_validate(struct nv40_context *nv40)
return TRUE;
}
-struct nv40_state_atom {
- boolean (*validate)(struct nv40_context *nv40);
- struct {
- unsigned pipe;
- unsigned hw;
- } dirty;
-};
+static boolean
+nv40_state_clip_validate(struct nv40_context *nv40)
+{
+ if (nv40->pipe_state.clip.nr)
+ nv40->fallback |= NV40_FALLBACK_TNL;
+ return FALSE;
+}
-static struct nv40_state_atom states[] = {
+static struct nv40_state_entry states[] = {
{
.validate = nv40_state_scissor_validate,
.dirty = {
@@ -101,13 +101,23 @@ static struct nv40_state_atom states[] = {
.pipe = NV40_NEW_STIPPLE | NV40_NEW_RAST,
.hw = NV40_NEW_STIPPLE,
}
+ },
+ {
+ .validate = nv40_state_clip_validate,
+ .dirty = {
+ .pipe = NV40_NEW_UCP,
+ .hw = 0,
+ }
}
};
static void
nv40_state_validate(struct nv40_context *nv40)
{
- unsigned i;
+ unsigned i, last_fallback;
+
+ last_fallback = nv40->fallback;
+ nv40->fallback = 0;
for (i = 0; i < sizeof(states) / sizeof(states[0]); i++) {
if (nv40->dirty & states[i].dirty.pipe) {
@@ -115,6 +125,15 @@ nv40_state_validate(struct nv40_context *nv40)
nv40->hw_dirty |= states[i].dirty.hw;
}
}
+
+ if (nv40->fallback & NV40_FALLBACK_TNL &&
+ !(last_fallback & NV40_FALLBACK_TNL)) {
+ NOUVEAU_ERR("XXX: hwtnl->swtnl\n");
+ } else
+ if (last_fallback & NV40_FALLBACK_TNL &&
+ !(nv40->fallback & NV40_FALLBACK_TNL)) {
+ NOUVEAU_ERR("XXX: swtnl->hwtnl\n");
+ }
}
void