summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_emit.c
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-02-23 04:48:42 -0800
committerCorbin Simpson <[email protected]>2009-02-23 05:59:58 -0800
commit65b79383fb0ad7e14d097f6fdd7227605df4c7cb (patch)
tree6f2fd59d83657c65019bff425a2414b8994d8b9a /src/gallium/drivers/r300/r300_emit.c
parent67387bf33fb7e92d4fcab1fe7f26b6a0b17048a6 (diff)
r300-gallium: Cleanup some state emit, move vertex format state to r300_emit.
No need to explicitly update derived state, as it will be done automatically.
Diffstat (limited to 'src/gallium/drivers/r300/r300_emit.c')
-rw-r--r--src/gallium/drivers/r300/r300_emit.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index d57ccffcb05..960f45f651f 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -219,6 +219,32 @@ void r300_emit_scissor_state(struct r300_context* r300,
END_CS;
}
+void r300_emit_vertex_format_state(struct r300_context* r300)
+{
+ CS_LOCALS(r300);
+ int i;
+
+ BEGIN_CS(6);
+ OUT_CS_REG_SEQ(R300_VAP_VTX_STATE_CNTL, 2);
+ OUT_CS(r300->vertex_info.vinfo.hwfmt[0]);
+ OUT_CS(r300->vertex_info.vinfo.hwfmt[1]);
+ OUT_CS_REG_SEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2);
+ OUT_CS(r300->vertex_info.vinfo.hwfmt[2]);
+ OUT_CS(r300->vertex_info.vinfo.hwfmt[3]);
+ END_CS;
+
+ BEGIN_CS(18);
+ OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_0, 8);
+ for (i = 0; i < 8; i++) {
+ OUT_CS(r300->vertex_info.vap_prog_stream_cntl[i]);
+ }
+ OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_EXT_0, 8);
+ for (i = 0; i < 8; i++) {
+ OUT_CS(r300->vertex_info.vap_prog_stream_cntl_ext[i]);
+ }
+ END_CS;
+}
+
/* Emit all dirty state. */
void r300_emit_dirty_state(struct r300_context* r300)
{
@@ -269,4 +295,9 @@ void r300_emit_dirty_state(struct r300_context* r300)
r300_emit_scissor_state(r300, r300->scissor_state);
r300->dirty_state &= ~R300_NEW_SCISSOR;
}
+
+ if (r300->dirty_state & R300_NEW_VERTEX_FORMAT) {
+ r300_emit_vertex_format_state(r300);
+ r300->dirty_state &= ~R300_NEW_VERTEX_FORMAT;
+ }
}