r300g: move GA_POINT_MINMAX back to rs_state
authorMarek Olšák <maraeo@gmail.com>
Sat, 8 May 2010 18:52:24 +0000 (20:52 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sat, 8 May 2010 21:03:45 +0000 (23:03 +0200)
This basically reverts commit 74f94e8fdfe035fa68acdc19e6b0afc2957a4264.

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

index b3c54595941155e9cf124f59b27e5172aa51d292..dd16565c5628bb6f00c3a47e9c792acabaa04f9d 100644 (file)
@@ -94,6 +94,7 @@ struct r300_rs_state {
     uint32_t vap_control_status;    /* R300_VAP_CNTL_STATUS: 0x2140 */
     uint32_t antialiasing_config;   /* R300_GB_AA_CONFIG: 0x4020 */
     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 */
     float depth_scale;            /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */
                                   /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */
index f3be274d76cb6748d84bde8a63639d0c1c7e8d18..9344b53324508bf3ac6e2f3dcf52a3b176e61543 100644 (file)
@@ -525,8 +525,6 @@ void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state)
         OUT_CS(((fb->width  + 1440-1) << R300_SCISSORS_X_SHIFT) |
                ((fb->height + 1440-1) << R300_SCISSORS_Y_SHIFT));
     }
-    OUT_CS_REG(R300_GA_POINT_MINMAX,
-        (MAX2(fb->width, fb->height) * 6) << R300_GA_POINT_MINMAX_MAX_SHIFT);
     END_CS;
 }
 
@@ -667,7 +665,9 @@ void r300_emit_rs_state(struct r300_context* r300, unsigned size, void* state)
     OUT_CS_REG(R300_GB_AA_CONFIG, rs->antialiasing_config);
 
     OUT_CS_REG(R300_GA_POINT_SIZE, rs->point_size);
-    OUT_CS_REG(R300_GA_LINE_CNTL, rs->line_control);
+    OUT_CS_REG_SEQ(R300_GA_POINT_MINMAX, 2);
+    OUT_CS(rs->point_minmax);
+    OUT_CS(rs->line_control);
 
     if (rs->polygon_offset_enable) {
         scale = rs->depth_scale * 12;
index af5bf445849e4a4987991016ddbe69ca1981a086..5a65f0ccfbd286c49acaa641e24cbd0bb47a0970 100644 (file)
@@ -616,7 +616,7 @@ static void
     memcpy(r300->fb_state.state, state, sizeof(struct pipe_framebuffer_state));
 
     r300->fb_state.size = (10 * state->nr_cbufs) + (2 * (4 - state->nr_cbufs)) +
-                          (state->zsbuf ? 10 : 0) + 11;
+                          (state->zsbuf ? 10 : 0) + 9;
 
     /* Polygon offset depends on the zbuffer bit depth. */
     if (state->zsbuf && r300->polygon_offset_enabled) {
@@ -722,6 +722,7 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
 {
     struct r300_rs_state* rs = CALLOC_STRUCT(r300_rs_state);
     int i;
+    float psiz;
 
     /* Copy rasterizer state for Draw. */
     rs->rs = *state;
@@ -737,9 +738,18 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
         rs->vap_control_status |= R300_VAP_TCL_BYPASS;
     }
 
-    rs->point_size = pack_float_16_6x(state->point_size) |
+    /* Point size width and height. */
+    rs->point_size =
+        pack_float_16_6x(state->point_size) |
         (pack_float_16_6x(state->point_size) << R300_POINTSIZE_X_SHIFT);
 
+    /* Point size clamping. */
+    psiz = pipe->screen->get_paramf(pipe->screen,
+                                    PIPE_CAP_MAX_POINT_WIDTH);
+    rs->point_minmax =
+        (pack_float_16_6x(psiz)) << R300_GA_POINT_MINMAX_MAX_SHIFT;
+
+    /* Line control. */
     rs->line_control = pack_float_16_6x(state->line_width) |
         R300_GA_LINE_CNTL_END_TYPE_COMP;
 
@@ -864,7 +874,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
     }
 
     UPDATE_STATE(state, r300->rs_state);
-    r300->rs_state.size = 26 + (r300->polygon_offset_enabled ? 5 : 0);
+    r300->rs_state.size = 27 + (r300->polygon_offset_enabled ? 5 : 0);
 
     if (last_sprite_coord_enable != r300->sprite_coord_enable) {
         r300->rs_block_state.dirty = TRUE;