From 5c58618406bd5b4ee0bc5121f562560702ebbf98 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 25 May 2010 21:45:38 -0700 Subject: [PATCH] r300g: Old MSAA code from before gallium-msaa. --- src/gallium/drivers/r300/r300_context.h | 2 ++ src/gallium/drivers/r300/r300_emit.c | 7 +++++++ src/gallium/drivers/r300/r300_state.c | 7 ++++++- src/gallium/drivers/r300/r300_state_invariant.c | 8 -------- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 90de53e2df3..0d7ff2e061c 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -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 */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 64d66e421f2..aae2e49dca8 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -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); diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 0772c1fa537..815f969e5ec 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -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) { diff --git a/src/gallium/drivers/r300/r300_state_invariant.c b/src/gallium/drivers/r300/r300_state_invariant.c index b3181a37ea1..e67a0ae2444 100644 --- a/src/gallium/drivers/r300/r300_state_invariant.c +++ b/src/gallium/drivers/r300/r300_state_invariant.c @@ -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) ***/ -- 2.30.2