nv30: add state zsa, based on nv40 one
authorPatrice Mandin <pmandin@caramail.com>
Mon, 23 Jun 2008 19:46:51 +0000 (21:46 +0200)
committerPatrice Mandin <pmandin@caramail.com>
Mon, 23 Jun 2008 19:46:51 +0000 (21:46 +0200)
src/gallium/drivers/nv30/Makefile
src/gallium/drivers/nv30/nv30_context.h
src/gallium/drivers/nv30/nv30_state_zsa.c [new file with mode: 0644]

index a6a8cf1df9c9b067341f72608a924d9e597d5153..69f2790dfe280e920ed2ce5fed9815515d701d9a 100644 (file)
@@ -20,6 +20,7 @@ DRIVER_SOURCES = \
        nv30_state_scissor.c \
        nv30_state_stipple.c \
        nv30_state_viewport.c \
+       nv30_state_zsa.c \
        nv30_surface.c \
        nv30_vbo.c \
        nv30_vertprog.c
index eb7e5a8b124cf9a99bafde44fa2f61b94dbc51b2..dce077b2b4b5d87ec22744a1a0083559312abbdf 100644 (file)
@@ -82,6 +82,11 @@ struct nv30_rasterizer_state_new {
        struct nouveau_stateobj *so;
 };
 
+struct nv30_zsa_state {
+       struct pipe_depth_stencil_alpha_state pipe;
+       struct nouveau_stateobj *so;
+};
+
 /* TODO: rename when removing the old state emitter */
 struct nv30_blend_state_new {
        struct pipe_blend_state pipe;
@@ -124,6 +129,7 @@ struct nv30_context {
        struct pipe_viewport_state viewport;
        struct pipe_framebuffer_state framebuffer;
        struct nv30_rasterizer_state_new *rasterizer;
+       struct nv30_zsa_state *zsa;
        unsigned stipple[32];
 
        uint32_t rt_enable;
diff --git a/src/gallium/drivers/nv30/nv30_state_zsa.c b/src/gallium/drivers/nv30/nv30_state_zsa.c
new file mode 100644 (file)
index 0000000..0940b72
--- /dev/null
@@ -0,0 +1,17 @@
+#include "nv30_context.h"
+
+static boolean
+nv30_state_zsa_validate(struct nv30_context *nv30)
+{
+       so_ref(nv30->zsa->so,
+              &nv30->state.hw[NV30_STATE_ZSA]);
+       return TRUE;
+}
+
+struct nv30_state_entry nv30_state_zsa = {
+       .validate = nv30_state_zsa_validate,
+       .dirty = {
+               .pipe = NV30_NEW_ZSA,
+               .hw = NV30_STATE_ZSA
+       }
+};