summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2009-03-07 01:53:42 -0800
committerCorbin Simpson <MostAwesomeDude@gmail.com>2009-03-07 13:28:02 -0800
commit826297462571350b7da7ae88bb4405212991c533 (patch)
treebc24bfa868ca6ac495e9f3a9a8c953af4fea5447
parent460e5b11c98e07d12c655e5bf2f1e993d05bd7a1 (diff)
r300-gallium: Move a few registers.
These shouldn't be written if not on TCL HW.
-rw-r--r--src/gallium/drivers/r300/r300_state_invariant.c12
-rw-r--r--src/gallium/drivers/r300/r300_surface.c20
2 files changed, 17 insertions, 15 deletions
diff --git a/src/gallium/drivers/r300/r300_state_invariant.c b/src/gallium/drivers/r300/r300_state_invariant.c
index c7c20c2de5..5646d22835 100644
--- a/src/gallium/drivers/r300/r300_state_invariant.c
+++ b/src/gallium/drivers/r300/r300_state_invariant.c
@@ -34,9 +34,8 @@ void r300_emit_invariant_state(struct r300_context* r300)
struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps;
CS_LOCALS(r300);
- BEGIN_CS(26);
- /* Amount of time to wait for vertex fetches in PVS */
- OUT_CS_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xffff);
+ BEGIN_CS(24 + (caps->has_tcl ? 2: 0));
+
/* Various GB enables */
OUT_CS_REG(R300_GB_ENABLE, R300_GB_POINT_STUFF_ENABLE |
R300_GB_LINE_STUFF_ENABLE | R300_GB_TRIANGLE_STUFF_ENABLE);
@@ -69,5 +68,12 @@ void r300_emit_invariant_state(struct r300_context* r300)
OUT_CS_REG(R300_FG_FOG_COLOR_G, 0x00000000);
OUT_CS_REG(R300_FG_FOG_COLOR_B, 0x00000000);
OUT_CS_REG(R300_FG_DEPTH_SRC, 0x00000000);
+
+ /* TCL-only stuff */
+ if (caps->has_tcl) {
+ /* Amount of time to wait for vertex fetches in PVS */
+ OUT_CS_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xffff);
+ }
+
END_CS;
}
diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c
index 2040967253..e7ba06fa3c 100644
--- a/src/gallium/drivers/r300/r300_surface.c
+++ b/src/gallium/drivers/r300/r300_surface.c
@@ -72,7 +72,7 @@ static void r300_surface_fill(struct pipe_context* pipe,
r300_emit_rs_block_state(r300, &r300_rs_block_clear_state);
}
- BEGIN_CS(106 + (caps->has_tcl ? 2 : 0));
+ BEGIN_CS(99 + (caps->has_tcl ? 9 : 0));
/* Flush PVS. */
OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0);
@@ -86,6 +86,13 @@ static void r300_surface_fill(struct pipe_context* pipe,
/* XXX endian */
if (caps->has_tcl) {
OUT_CS_REG(R300_VAP_CNTL_STATUS, R300_VC_NO_SWAP);
+ OUT_CS_REG(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE |
+ R300_PS_UCP_MODE_CLIP_AS_TRIFAN);
+ OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4);
+ OUT_CS_32F(1.0);
+ OUT_CS_32F(1.0);
+ OUT_CS_32F(1.0);
+ OUT_CS_32F(1.0);
} else {
OUT_CS_REG(R300_VAP_CNTL_STATUS, R300_VC_NO_SWAP |
R300_VAP_TCL_BYPASS);
@@ -93,12 +100,6 @@ static void r300_surface_fill(struct pipe_context* pipe,
OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x0);
/* XXX magic number not in r300_reg */
OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA);
- OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0);
- OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4);
- OUT_CS_32F(1.0);
- OUT_CS_32F(1.0);
- OUT_CS_32F(1.0);
- OUT_CS_32F(1.0);
/* XXX point tex stuffing */
OUT_CS_REG_SEQ(R300_GA_POINT_S0, 1);
OUT_CS_32F(0.0);
@@ -164,11 +165,6 @@ static void r300_surface_fill(struct pipe_context* pipe,
OUT_CS_32F(1.0);
OUT_CS_32F(0.0);
- if (caps->has_tcl) {
- OUT_CS_REG(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE |
- R300_PS_UCP_MODE_CLIP_AS_TRIFAN);
- }
-
/* XXX */
OUT_CS_REG(R300_SC_CLIP_RULE, 0xaaaa);
END_CS;