r300-gallium: Pick up a few more bits of rs_state.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Fri, 6 Mar 2009 17:44:21 +0000 (09:44 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Fri, 6 Mar 2009 18:30:15 +0000 (10:30 -0800)
Including two registers that already should have been covered...huh...

src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r300/r300_surface.c
src/gallium/drivers/r300/r300_surface.h

index 2be9e2eb33375495f43b1889aab4ed7dd16eabdb..c2329b430c547ae6eb75f12dcb8083294220eb4f 100644 (file)
@@ -64,6 +64,7 @@ struct r300_rs_state {
 
     uint32_t vap_control_status;    /* R300_VAP_CNTL_STATUS: 0x2140 */
     uint32_t point_size;            /* R300_GA_POINT_SIZE: 0x421c */
+    uint32_t point_minmax;          /* R300_GA_POINT_MINMAX: 0x4230 */
     uint32_t line_control;          /* R300_GA_LINE_CNTL: 0x4234 */
     uint32_t depth_scale_front;  /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */
     uint32_t depth_offset_front;/* R300_SU_POLY_OFFSET_FRONT_OFFSET: 0x42a8 */
index e910e9c827168ff6cf818cd2864a3938e4a5e7e7..6c84b562d03fe8f0ba516aaa9d0f711a0f65e211 100644 (file)
@@ -196,8 +196,12 @@ void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs)
     struct r300_screen* r300screen = r300_screen(r300->context.screen);
     CS_LOCALS(r300);
 
-    BEGIN_CS(13);
+    BEGIN_CS(18);
     OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
+    OUT_CS_REG(R300_GA_POINT_SIZE, rs->point_size);
+    OUT_CS_REG_SEQ(R300_GA_POINT_MINMAX, 2);
+    OUT_CS(rs->point_minmax);
+    OUT_CS(rs->line_control);
     OUT_CS_REG_SEQ(R300_SU_POLY_OFFSET_FRONT_SCALE, 6);
     OUT_CS(rs->depth_scale_front);
     OUT_CS(rs->depth_offset_front);
index 6e64ad2dc354b4e10e207fa6130620a082cda1ae..a909ad0341bb370149266e3bbffbc27a8989c63f 100644 (file)
@@ -337,6 +337,12 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
     rs->point_size = pack_float_16_6x(state->point_size) |
         (pack_float_16_6x(state->point_size) << R300_POINTSIZE_X_SHIFT);
 
+    rs->point_minmax =
+        ((int)(state->point_size_min * 6.0) <<
+         R300_GA_POINT_MINMAX_MIN_SHIFT) |
+        ((int)(state->point_size_max * 6.0) <<
+         R300_GA_POINT_MINMAX_MAX_SHIFT);
+
     rs->line_control = pack_float_16_6x(state->line_width) |
         R300_GA_LINE_CNTL_END_TYPE_COMP;
 
index 9968fe0de0e9c2f8f17a745341d3ae4bcf554e26..eafcc12b7d650e0ea0d954fb68a5759ac50d716f 100644 (file)
@@ -63,7 +63,16 @@ static void r300_surface_fill(struct pipe_context* pipe,
     r300_emit_dsa_state(r300, &dsa_clear_state);
     r300_emit_rs_state(r300, &rs_clear_state);
 
-    BEGIN_CS(128 + (caps->has_tcl ? 2 : 0));
+    /* Fragment shader setup */
+    if (caps->is_r500) {
+        r500_emit_fragment_shader(r300, &r500_passthrough_fragment_shader);
+        r300_emit_rs_block_state(r300, &r500_rs_block_clear_state);
+    } else {
+        r300_emit_fragment_shader(r300, &r300_passthrough_fragment_shader);
+        r300_emit_rs_block_state(r300, &r300_rs_block_clear_state);
+    }
+
+    BEGIN_CS(126 + (caps->has_tcl ? 2 : 0));
     /* Flush PVS. */
     OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0);
 
@@ -99,9 +108,6 @@ static void r300_surface_fill(struct pipe_context* pipe,
     OUT_CS_32F(1.0);
     OUT_CS_REG(R300_GA_TRIANGLE_STIPPLE, 0x5 |
         (0x5 << R300_GA_TRIANGLE_STIPPLE_Y_SHIFT_SHIFT));
-    /* XXX should this be related to the actual point size? */
-    OUT_CS_REG(R300_GA_POINT_MINMAX, 0x6 |
-        (0x1800 << R300_GA_POINT_MINMAX_MAX_SHIFT));
     /* XXX this big chunk should be refactored into rs_state */
     OUT_CS_REG(R300_GA_LINE_S0, 0x00000000);
     OUT_CS_REG(R300_GA_LINE_S1, 0x3F800000);
@@ -186,15 +192,6 @@ static void r300_surface_fill(struct pipe_context* pipe,
     OUT_CS_REG(R300_SC_CLIP_RULE, 0xaaaa);
     END_CS;
 
-    /* Fragment shader setup */
-    if (caps->is_r500) {
-        r500_emit_fragment_shader(r300, &r500_passthrough_fragment_shader);
-        r300_emit_rs_block_state(r300, &r500_rs_block_clear_state);
-    } else {
-        r300_emit_fragment_shader(r300, &r300_passthrough_fragment_shader);
-        r300_emit_rs_block_state(r300, &r300_rs_block_clear_state);
-    }
-
     BEGIN_CS(7 + (caps->has_tcl ? 21 : 2));
     OUT_CS_REG_SEQ(R300_US_OUT_FMT_0, 4);
     OUT_CS(R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A);
index 616d56dd04bbee0d430dbf6f46f343e2e826570c..be3105f8ce40d4904fa8a462333f6391a19fb4dc 100644 (file)
@@ -58,6 +58,7 @@ const struct r300_dsa_state dsa_clear_state = {
 };
 
 const struct r300_rs_state rs_clear_state = {
+    .point_minmax = 0x36000006,
     .line_control = 0x00030006,
     .depth_scale_front = 0x0,
     .depth_offset_front = 0x0,