r300-gallium: Set up draw rasterizer.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 16 Feb 2009 11:33:56 +0000 (03:33 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 16 Feb 2009 12:12:41 +0000 (04:12 -0800)
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_state.c

index 53e41bf76db05442154dc6a17e7136bd449f329c..a3727c8fb47f563ed5fcebb71fca972a84df51f2 100644 (file)
@@ -59,6 +59,9 @@ struct r300_dsa_state {
 };
 
 struct r300_rs_state {
+    /* XXX icky as fucking hell */
+    struct pipe_rasterizer_state rs;
+
     uint32_t vap_control_status;    /* R300_VAP_CNTL_STATUS: 0x2140 */
     uint32_t point_size;            /* R300_GA_POINT_SIZE: 0x421c */
     uint32_t line_control;          /* R300_GA_LINE_CNTL: 0x4234 */
index 559844f9b47ae527596a5c69804deea49fd3f8c5..eae1a5698d005dfd77f75dd2a0c754906d677666 100644 (file)
@@ -222,7 +222,7 @@ static void
                                              PIPE_BUFFER_USAGE_CPU_READ);
         memcpy(r300->shader_constants[shader].constants,
             map, buffer->buffer->size);
-        pipe->winsys->buffer_unmap(pipe->winsys, map);
+        pipe->winsys->buffer_unmap(pipe->winsys, buffer->buffer);
 
         r300->shader_constants[shader].user_count =
             buffer->buffer->size / (sizeof(float) * 4);
@@ -542,6 +542,8 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
         rs->line_stipple_value = state->line_stipple_pattern;
     }
 
+    rs->rs = *state;
+
     return (void*)rs;
 }
 
@@ -549,8 +551,11 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
 static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
 {
     struct r300_context* r300 = r300_context(pipe);
+    struct r300_rs_state* rs = (struct r300_rs_state*)state;
+
+    draw_set_rasterizer_state(r300->draw, &rs->rs);
 
-    r300->rs_state = (struct r300_rs_state*)state;
+    r300->rs_state = rs;
     r300->dirty_state |= R300_NEW_RASTERIZER;
 }