summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-05-28 01:39:27 +0200
committerMarek Olšák <[email protected]>2010-05-28 03:30:11 +0200
commit3262554bb375230a39e155ad712740bdcd657d4c (patch)
tree8bff03732c3f1baec13e663399c168d1d2e32277 /src
parent49244df5a87f0e6fbf49c8bba6bd42e2852fe957 (diff)
r300g/swtcl: fix WPOS
There you are! r300->viewport_state is undefined when using SW TCL. Piglit score (r300g.tests): HW TCL: 231/275 SW TCL: 233/275
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r300/r300_emit.c13
-rw-r--r--src/gallium/drivers/r300/r300_vs_draw.c4
2 files changed, 8 insertions, 9 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 123b084b2b4..a55a545e1c9 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -134,7 +134,6 @@ static const float * get_rc_constant_state(
struct r300_context * r300,
struct rc_constant * constant)
{
- struct r300_viewport_state* viewport = r300->viewport_state.state;
struct r300_textures_state* texstate = r300->textures_state.state;
static float vec[4] = { 0.0, 0.0, 0.0, 1.0 };
struct pipe_resource *tex;
@@ -151,15 +150,15 @@ static const float * get_rc_constant_state(
break;
case RC_STATE_R300_VIEWPORT_SCALE:
- vec[0] = viewport->xscale;
- vec[1] = viewport->yscale;
- vec[2] = viewport->zscale;
+ vec[0] = r300->viewport.scale[0];
+ vec[1] = r300->viewport.scale[1];
+ vec[2] = r300->viewport.scale[2];
break;
case RC_STATE_R300_VIEWPORT_OFFSET:
- vec[0] = viewport->xoffset;
- vec[1] = viewport->yoffset;
- vec[2] = viewport->zoffset;
+ vec[0] = r300->viewport.translate[0];
+ vec[1] = r300->viewport.translate[1];
+ vec[2] = r300->viewport.translate[2];
break;
default:
diff --git a/src/gallium/drivers/r300/r300_vs_draw.c b/src/gallium/drivers/r300/r300_vs_draw.c
index 5858492a0a8..d64040b8911 100644
--- a/src/gallium/drivers/r300/r300_vs_draw.c
+++ b/src/gallium/drivers/r300/r300_vs_draw.c
@@ -352,7 +352,7 @@ void r300_draw_init_vertex_shader(struct draw_context *draw,
/* Init the VS output table for the rasterizer. */
r300_init_vs_outputs(vs);
- /**/
+ /* Make the last generic be WPOS. */
+ vs->outputs.wpos = vs->outputs.generic[transform.last_generic + 1];
vs->outputs.generic[transform.last_generic + 1] = ATTR_UNUSED;
- vs->outputs.wpos -= 1;
}