summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-01-30 01:24:03 -0800
committerCorbin Simpson <[email protected]>2009-02-01 23:30:32 -0800
commit70b508bffba723b58817e375447c1695d9d5602b (patch)
tree85cda435364d479d5f684b92b42df91c73c78b5b
parent7ccc9a92ce83d5e38549a6f6c5f22b358a90e578 (diff)
r300: Split rs_state emit into its own function.
-rw-r--r--src/gallium/drivers/r300/r300_emit.c29
-rw-r--r--src/gallium/drivers/r300/r300_emit.h4
2 files changed, 23 insertions, 10 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 001aa02f41c..de5719db8d2 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -79,6 +79,25 @@ void r300_emit_dsa_state(struct r300_context* r300,
END_CS;
}
+void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs)
+{
+ struct r300_screen* r300screen =
+ (struct r300_screen*)r300->context.screen;
+ CS_LOCALS(r300);
+ BEGIN_CS(14);
+ OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
+ OUT_CS_REG_SEQ(R300_SU_POLY_OFFSET_FRONT_SCALE, 6);
+ OUT_CS(rs->depth_scale_front);
+ OUT_CS(rs->depth_offset_front);
+ OUT_CS(rs->depth_scale_back);
+ OUT_CS(rs->depth_offset_back);
+ OUT_CS(rs->polygon_offset_enable);
+ OUT_CS(rs->cull_mode);
+ OUT_CS_REG(R300_GA_LINE_STIPPLE_CONFIG, rs->line_stipple_config);
+ OUT_CS_REG(R300_GA_LINE_STIPPLE_VALUE, rs->line_stipple_value);
+ END_CS;
+}
+
static void r300_emit_dirty_state(struct r300_context* r300)
{
struct r300_screen* r300screen =
@@ -104,15 +123,7 @@ static void r300_emit_dirty_state(struct r300_context* r300)
}
if (r300->dirty_state & R300_NEW_RASTERIZER) {
- struct r300_rs_state* rs = r300->rs_state;
- OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
- /* XXX next six are contiguous regs */
- OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_SCALE, rs->depth_scale_front);
- OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_OFFSET, rs->depth_offset_front);
- OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_SCALE, rs->depth_scale_back);
- OUT_CS_REG(R300_SU_POLY_OFFSET_BACK_OFFSET, rs->depth_offset_back);
- OUT_CS_REG(R300_SU_POLY_OFFSET_ENABLE, rs->polygon_offset_enable);
- OUT_CS_REG(R300_SU_CULL_MODE, rs->cull_mode);
+ r300_emit_rs_state(r300, r300->rs_state);
}
if (r300->dirty_state & R300_NEW_SCISSOR) {
diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h
index 98287bc1f3a..b6e69386f95 100644
--- a/src/gallium/drivers/r300/r300_emit.h
+++ b/src/gallium/drivers/r300/r300_emit.h
@@ -31,4 +31,6 @@ void r300_emit_blend_color_state(struct r300_context* r300,
struct r300_blend_color_state* bc);
void r300_emit_dsa_state(struct r300_context* r300,
- struct r300_dsa_state* dsa);
+ struct r300_dsa_state* dsa);
+
+void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs);