r300g: Old MSAA code from before gallium-msaa.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 26 May 2010 04:45:38 +0000 (21:45 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 16 Jun 2010 17:54:06 +0000 (10:54 -0700)
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_state_invariant.c

index 90de53e2df392ecc5ca4d27c4da26a542660442d..0d7ff2e061c66a332105b4fc985b5b5b4d67dbb6 100644 (file)
@@ -103,6 +103,8 @@ struct r300_rs_state {
     struct pipe_rasterizer_state rs_draw;
 
     uint32_t vap_control_status;    /* R300_VAP_CNTL_STATUS: 0x2140 */
+    uint32_t multisample_position_0;/* R300_GB_MSPOS0: 0x4010 */
+    uint32_t multisample_position_1;/* R300_GB_MSPOS1: 0x4014 */
     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 */
index 64d66e421f25a102349d6491eadd84311c46b608..aae2e49dca8934549051d9333e2d5d991fea4080 100644 (file)
@@ -484,6 +484,13 @@ 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_VAP_CNTL_STATUS, rs->vap_control_status);
+    if (r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0)) {
+        OUT_CS_REG_SEQ(R300_GB_MSPOS0, 2);
+        OUT_CS(rs->multisample_position_0);
+        OUT_CS(rs->multisample_position_1);
+    }
+    OUT_CS_REG(R300_GB_AA_CONFIG, rs->antialiasing_config);
     OUT_CS_REG(R300_GA_POINT_SIZE, rs->point_size);
     OUT_CS_REG_SEQ(R300_GA_POINT_MINMAX, 2);
     OUT_CS(rs->point_minmax);
index 0772c1fa53775b5ba19f81dc9d6a76802d65711c..815f969e5ecc13fc7587e89da9b0045723bcb48b 100644 (file)
@@ -950,6 +950,11 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
         }
     }
 
+    if (state->gl_rasterization_rules) {
+        rs->multisample_position_0 = 0x66666666;
+        rs->multisample_position_1 = 0x6666666;
+    }
+
     return (void*)rs;
 }
 
@@ -979,7 +984,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
     }
 
     UPDATE_STATE(state, r300->rs_state);
-    r300->rs_state.size = 27 + (r300->polygon_offset_enabled ? 5 : 0);
+    r300->rs_state.size = 31 + (r300->polygon_offset_enabled ? 5 : 0);
 
     if (last_sprite_coord_enable != r300->sprite_coord_enable ||
         last_two_sided_color != r300->two_sided_color) {
index b3181a37ea14da1a11d784a3f8752c6a89d827ef..e67a0ae2444910056002586fed13d8d557185cb0 100644 (file)
@@ -38,14 +38,6 @@ void r300_emit_invariant_state(struct r300_context* r300,
 {
     CS_LOCALS(r300);
 
-    if (r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0)) {
-        /* Subpixel multisampling for AA. */
-        BEGIN_CS(4);
-        OUT_CS_REG(R300_GB_MSPOS0, 0x66666666);
-        OUT_CS_REG(R300_GB_MSPOS1, 0x6666666);
-        END_CS;
-    }
-
     BEGIN_CS(12 + (r300->screen->caps.has_tcl ? 2 : 0));
 
     /*** Graphics Backend (GB) ***/