summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/nv40/nv40_state_emit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/nv40/nv40_state_emit.c')
-rw-r--r--src/mesa/pipe/nv40/nv40_state_emit.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mesa/pipe/nv40/nv40_state_emit.c b/src/mesa/pipe/nv40/nv40_state_emit.c
new file mode 100644
index 0000000000..c53b5d852a
--- /dev/null
+++ b/src/mesa/pipe/nv40/nv40_state_emit.c
@@ -0,0 +1,29 @@
+#include "nv40_context.h"
+#include "nv40_dma.h"
+#include "nv40_state.h"
+
+void
+nv40_emit_hw_state(struct nv40_context *nv40)
+{
+ if (nv40->dirty & NV40_NEW_FRAGPROG) {
+ nv40_fragprog_bind(nv40, nv40->fragprog.current);
+ /*XXX: clear NV40_NEW_FRAGPROG if no now program uploaded */
+ }
+
+ if (nv40->dirty & NV40_NEW_TEXTURE)
+ nv40_state_tex_update(nv40);
+
+ if (nv40->dirty & (NV40_NEW_TEXTURE | NV40_NEW_FRAGPROG)) {
+ BEGIN_RING(curie, NV40TCL_TEX_CACHE_CTL, 1);
+ OUT_RING (2);
+ BEGIN_RING(curie, NV40TCL_TEX_CACHE_CTL, 1);
+ OUT_RING (1);
+ nv40->dirty &= ~(NV40_NEW_TEXTURE | NV40_NEW_FRAGPROG);
+ }
+
+ if (nv40->dirty & NV40_NEW_VERTPROG) {
+ nv40_vertprog_bind(nv40, nv40->vertprog.current);
+ nv40->dirty &= ~NV40_NEW_VERTPROG;
+ }
+}
+