diff options
author | Brian <brian.paul@tungstengraphics.com> | 2008-03-31 14:14:30 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2008-03-31 14:14:30 -0600 |
commit | 594dab4769533afaeb30a588e1731a6753a93f0d (patch) | |
tree | 2c18a1956e21208eb739d56775e22c406e3b93e8 /src/gallium/auxiliary/draw/draw_vs_sse.c | |
parent | 9cbd8400433fb27da03f300b36495baef464cc6b (diff) | |
download | external_mesa3d-594dab4769533afaeb30a588e1731a6753a93f0d.zip external_mesa3d-594dab4769533afaeb30a588e1731a6753a93f0d.tar.gz external_mesa3d-594dab4769533afaeb30a588e1731a6753a93f0d.tar.bz2 |
gallium: move the test for bypass_vs into the vs_XXX_run() functions
Also:
1. Added an identity_viewport flag to skip viewport transformation when it
has no effect. Might also add an explicit bypass_viewport flag someday.
2. Separate the code for computing clip codes and doing the viewport transform.
Predicate them separately.
Note: even if bypass_vs is set, we still look at the shader to determine the
number of inputs and outputs.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs_sse.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_vs_sse.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_sse.c b/src/gallium/auxiliary/draw/draw_vs_sse.c index bc910dc..701137f 100644 --- a/src/gallium/auxiliary/draw/draw_vs_sse.c +++ b/src/gallium/auxiliary/draw/draw_vs_sse.c @@ -126,7 +126,13 @@ vs_sse_run( struct draw_vertex_shader *base, /* Consts does not require 16 byte alignment. */ machine->Consts = (float (*)[4]) draw->user.constants; machine->Inputs = ALIGN16_ASSIGN(inputs); - machine->Outputs = ALIGN16_ASSIGN(outputs); + if (draw->rasterizer->bypass_vs) { + /* outputs are just the inputs */ + machine->Outputs = machine->Inputs; + } + else { + machine->Outputs = ALIGN16_ASSIGN(outputs); + } /* Fetch vertices. This may at some point be integrated into the @@ -137,13 +143,14 @@ vs_sse_run( struct draw_vertex_shader *base, draw->vertex_fetch.fetch_func( draw, machine, elts, count ); - /* run compiled shader - */ - shader->func( - machine->Inputs, - machine->Outputs, - machine->Consts, - machine->Temps ); + if (!draw->rasterizer->bypass_vs) { + /* run compiled shader + */ + shader->func(machine->Inputs, + machine->Outputs, + machine->Consts, + machine->Temps ); + } /* XXX: Computing the clipmask and emitting results should be done @@ -161,8 +168,13 @@ vs_sse_run( struct draw_vertex_shader *base, if (!draw->rasterizer->bypass_clipping) { vOut[j]->clipmask = compute_clipmask(vOut[j]->clip, draw->plane, draw->nr_planes); - vOut[j]->edgeflag = 1; + } + else { + vOut[j]->clipmask = 0; + } + vOut[j]->edgeflag = 1; + if (!draw->identity_viewport) { /* divide by w */ w = 1.0f / w; x *= w; @@ -176,8 +188,6 @@ vs_sse_run( struct draw_vertex_shader *base, vOut[j]->data[0][3] = w; } else { - vOut[j]->clipmask = 0; - vOut[j]->edgeflag = 1; vOut[j]->data[0][0] = x; vOut[j]->data[0][1] = y; vOut[j]->data[0][2] = z; |