nv30: add state rasterizer, based on nv40 one
authorPatrice Mandin <pmandin@caramail.com>
Mon, 23 Jun 2008 18:37:27 +0000 (20:37 +0200)
committerPatrice Mandin <pmandin@caramail.com>
Mon, 23 Jun 2008 18:37:27 +0000 (20:37 +0200)
src/gallium/drivers/nv30/Makefile
src/gallium/drivers/nv30/nv30_context.h
src/gallium/drivers/nv30/nv30_state_rasterizer.c [new file with mode: 0644]

index 04f53ee4565f38285709e9e05db5801996b3c1dc..c5208fabf5ed3d53c02d80dcd4cfa77c4dda2dd4 100644 (file)
@@ -16,6 +16,7 @@ DRIVER_SOURCES = \
        nv30_state_blend.c \
        nv30_state_emit.c \
        nv30_state_fb.c \
+       nv30_state_rasterizer.c \
        nv30_surface.c \
        nv30_vbo.c \
        nv30_vertprog.c
index 1695ba5a01732e223ec15cf801ede6c113a64e95..43ee8d13a0c7529a8d739a061e1eb1d0615e2ec3 100644 (file)
@@ -76,6 +76,12 @@ enum nv30_state_index {
 #define NV30_NEW_ARRAYS                (1 << 11)
 #define NV30_NEW_UCP           (1 << 12)
 
+/* TODO: rename when removing the old state emitter */
+struct nv30_rasterizer_state_new {
+       struct pipe_rasterizer_state pipe;
+       struct nouveau_stateobj *so;
+};
+
 /* TODO: rename when removing the old state emitter */
 struct nv30_blend_state_new {
        struct pipe_blend_state pipe;
@@ -111,6 +117,7 @@ struct nv30_context {
        struct nv30_blend_state_new *blend;
        struct pipe_blend_color blend_colour;
        struct pipe_framebuffer_state framebuffer;
+       struct nv30_rasterizer_state_new *rasterizer;
 
        uint32_t rt_enable;
        struct pipe_buffer *rt[2];
diff --git a/src/gallium/drivers/nv30/nv30_state_rasterizer.c b/src/gallium/drivers/nv30/nv30_state_rasterizer.c
new file mode 100644 (file)
index 0000000..6d1b60e
--- /dev/null
@@ -0,0 +1,17 @@
+#include "nv30_context.h"
+
+static boolean
+nv30_state_rasterizer_validate(struct nv30_context *nv30)
+{
+       so_ref(nv30->rasterizer->so,
+              &nv30->state.hw[NV30_STATE_RAST]);
+       return TRUE;
+}
+
+struct nv30_state_entry nv30_state_rasterizer = {
+       .validate = nv30_state_rasterizer_validate,
+       .dirty = {
+               .pipe = NV30_NEW_RAST,
+               .hw = NV30_STATE_RAST
+       }
+};