summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2010-01-10 22:32:58 -0800
committerCorbin Simpson <[email protected]>2010-01-10 23:15:05 -0800
commit8ca491386d0fb9e675e7dfbdd05bc09af74d75d3 (patch)
tree8a1149b71c2ca4e359435e4c38f6151ff9554a32 /src/gallium
parent47f59cfc8eba6574c9ca0ae8799e8fbd9b393fb7 (diff)
r300g: Move TCL bypass switch to main context.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r300/r300_context.h7
-rw-r--r--src/gallium/drivers/r300/r300_emit.c44
-rw-r--r--src/gallium/drivers/r300/r300_state.c7
-rw-r--r--src/gallium/drivers/r300/r300_state_derived.c9
4 files changed, 31 insertions, 36 deletions
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 70b381fe74b..05ea7ad0f90 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -71,11 +71,6 @@ struct r300_rs_state {
/* Draw-specific rasterizer state */
struct pipe_rasterizer_state rs;
- /* Whether or not to enable the VTE. This is referenced at the very
- * last moment during emission of VTE state, to decide whether or not
- * the VTE should be used for transformation. */
- boolean enable_vte;
-
uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */
uint32_t point_size; /* R300_GA_POINT_SIZE: 0x421c */
uint32_t point_minmax; /* R300_GA_POINT_MINMAX: 0x4230 */
@@ -322,6 +317,8 @@ struct r300_context {
uint32_t dirty_state;
/* Flag indicating whether or not the HW is dirty. */
uint32_t dirty_hw;
+ /* Whether the TCL engine should be in bypass mode. */
+ boolean tcl_bypass;
/** Combination of DBG_xxx flags */
unsigned debug;
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index aa21682e4b3..86d4000d086 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -147,7 +147,6 @@ static const float * get_shader_constant(
{
struct r300_viewport_state* viewport =
(struct r300_viewport_state*)r300->viewport_state.state;
- boolean vte_enabled = viewport->vte_control & ~R300_VTX_W0_FMT;
static float vec[4] = { 0.0, 0.0, 0.0, 1.0 };
struct pipe_texture *tex;
@@ -176,25 +175,22 @@ static const float * get_shader_constant(
break;
case RC_STATE_R300_VIEWPORT_SCALE:
- /* XXX argfl stop crossing state */
- if (vte_enabled) {
- vec[0] = viewport->xscale;
- vec[1] = viewport->yscale;
- vec[2] = viewport->zscale;
- } else {
+ if (r300->tcl_bypass) {
vec[0] = 1;
vec[1] = 1;
vec[2] = 1;
+ } else {
+ vec[0] = viewport->xscale;
+ vec[1] = viewport->yscale;
+ vec[2] = viewport->zscale;
}
break;
case RC_STATE_R300_VIEWPORT_OFFSET:
- if (vte_enabled) {
+ if (!r300->tcl_bypass) {
vec[0] = viewport->xoffset;
vec[1] = viewport->yoffset;
vec[2] = viewport->zoffset;
- } else {
- /* Zeros. */
}
break;
@@ -923,22 +919,22 @@ void r300_emit_viewport_state(struct r300_context* r300, void* state)
struct r300_viewport_state* viewport = (struct r300_viewport_state*)state;
CS_LOCALS(r300);
- BEGIN_CS(9);
- OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6);
- OUT_CS_32F(viewport->xscale);
- OUT_CS_32F(viewport->xoffset);
- OUT_CS_32F(viewport->yscale);
- OUT_CS_32F(viewport->yoffset);
- OUT_CS_32F(viewport->zscale);
- OUT_CS_32F(viewport->zoffset);
-
- /* XXX words still fail me. */
- if (((struct r300_rs_state*)r300->rs_state.state)->enable_vte) {
- OUT_CS_REG(R300_VAP_VTE_CNTL, viewport->vte_control);
- } else {
+ if (r300->tcl_bypass) {
+ BEGIN_CS(2);
OUT_CS_REG(R300_VAP_VTE_CNTL, 0);
+ END_CS;
+ } else {
+ BEGIN_CS(9);
+ OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6);
+ OUT_CS_32F(viewport->xscale);
+ OUT_CS_32F(viewport->xoffset);
+ OUT_CS_32F(viewport->yscale);
+ OUT_CS_32F(viewport->yoffset);
+ OUT_CS_32F(viewport->zscale);
+ OUT_CS_32F(viewport->zoffset);
+ OUT_CS_REG(R300_VAP_VTE_CNTL, viewport->vte_control);
+ END_CS;
}
- END_CS;
}
void r300_emit_texture_count(struct r300_context* r300)
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 4c0b307ea88..da1f40c8ef6 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -605,8 +605,6 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
/* Copy rasterizer state for Draw. */
rs->rs = *state;
- rs->enable_vte = !state->bypass_vs_clip_and_viewport;
-
#ifdef PIPE_ARCH_LITTLE_ENDIAN
rs->vap_control_status = R300_VC_NO_SWAP;
#else
@@ -722,9 +720,12 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
draw_set_rasterizer_state(r300->draw, &rs->rs);
}
+ r300->tcl_bypass = rs->rs.bypass_vs_clip_and_viewport;
+
r300->rs_state.state = rs;
r300->rs_state.dirty = TRUE;
- r300->viewport_state.dirty = TRUE; /* XXX */
+ /* XXX Why is this still needed, dammit!? */
+ r300->viewport_state.dirty = TRUE;
/* XXX Clean these up when we move to atom emits */
r300->dirty_state |= R300_NEW_RS_BLOCK;
diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
index 4396978fd14..192846411ba 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -139,10 +139,10 @@ static void r300_vertex_psc(struct r300_context* r300)
/* If TCL is bypassed, map vertex streams to equivalent VS output
* locations. */
- if (((struct r300_rs_state*)r300->rs_state.state)->enable_vte) {
- stream_tab = identity;
- } else {
+ if (r300->tcl_bypass) {
stream_tab = r300->vs->stream_loc_notcl;
+ } else {
+ stream_tab = identity;
}
/* Vertex shaders have no semantics on their inputs,
@@ -556,9 +556,10 @@ static void r300_update_ztop(struct r300_context* r300)
void r300_update_derived_state(struct r300_context* r300)
{
+ /* XXX */
if (r300->dirty_state &
(R300_NEW_FRAGMENT_SHADER | R300_NEW_VERTEX_SHADER |
- R300_NEW_VERTEX_FORMAT)) {
+ R300_NEW_VERTEX_FORMAT) || r300->rs_state.dirty) {
r300_update_derived_shader_state(r300);
}