nv30: Emit polygon stipple state using state objects
authorPatrice Mandin <pmandin@caramail.com>
Thu, 3 Jul 2008 20:31:23 +0000 (22:31 +0200)
committerPatrice Mandin <pmandin@caramail.com>
Thu, 3 Jul 2008 20:31:23 +0000 (22:31 +0200)
src/gallium/drivers/nv30/nv30_context.h
src/gallium/drivers/nv30/nv30_state.c
src/gallium/drivers/nv30/nv30_state_emit.c

index 2a48903e32a7c470a9fda1bee1321928b9c348cf..ed7b0759ad4fa7915ad4571a061433aff2a3bd50 100644 (file)
@@ -112,9 +112,6 @@ struct nv30_context {
 
        /* HW state derived from pipe states */
        struct nv30_state state;
-       struct pipe_scissor_state scissor;
-
-       uint32_t dirty;
 
        struct nv30_sampler_state *tex_sampler[PIPE_MAX_SAMPLERS];
        struct nv30_miptree *tex_miptree[PIPE_MAX_SAMPLERS];
@@ -123,13 +120,15 @@ struct nv30_context {
        unsigned vp_samplers;
 
        /* Context state */
+       unsigned dirty;
+       struct pipe_scissor_state scissor;
+       unsigned stipple[32];
        struct nv30_rasterizer_state *rasterizer;
+       struct nv30_zsa_state *zsa;
        struct nv30_blend_state *blend;
        struct pipe_blend_color blend_colour;
        struct pipe_viewport_state viewport;
        struct pipe_framebuffer_state framebuffer;
-       struct nv30_zsa_state *zsa;
-       unsigned stipple[32];
 
        uint32_t rt_enable;
        struct pipe_buffer *rt[2];
@@ -212,6 +211,7 @@ extern void nv30_emit_hw_state(struct nv30_context *nv30);
 extern void nv30_state_tex_update(struct nv30_context *nv30);
 extern struct nv30_state_entry nv30_state_rasterizer;
 extern struct nv30_state_entry nv30_state_scissor;
+extern struct nv30_state_entry nv30_state_stipple;
 extern struct nv30_state_entry nv30_state_blend;
 extern struct nv30_state_entry nv30_state_blend_colour;
 extern struct nv30_state_entry nv30_state_zsa;
index f2413a3372c5f9fd08bd5ccdf0eb5909444092b9..7109deae552abeb925749f6afdaa38dc51ac697b 100644 (file)
@@ -597,8 +597,8 @@ nv30_set_polygon_stipple(struct pipe_context *pipe,
 {
        struct nv30_context *nv30 = nv30_context(pipe);
 
-       BEGIN_RING(rankine, NV34TCL_POLYGON_STIPPLE_PATTERN(0), 32);
-       OUT_RINGp ((uint32_t *)stipple->stipple, 32);
+       memcpy(nv30->stipple, stipple->stipple, 4 * 32);
+       nv30->dirty |= NV30_NEW_STIPPLE;
 }
 
 static void
index f45a340b5d6ffff69d774ea9ad44a9e7903a5333..4f9079184d48f475efdf10287f8dad2369d63b00 100644 (file)
@@ -5,6 +5,7 @@ static struct nv30_state_entry *render_states[] = {
        &nv30_state_framebuffer,
        &nv30_state_rasterizer,
        &nv30_state_scissor,
+       &nv30_state_stipple,
        &nv30_state_blend,
        &nv30_state_blend_colour,
        &nv30_state_zsa,