summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_vs_llvm.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-03-31 14:14:30 -0600
committerBrian <brian.paul@tungstengraphics.com>2008-03-31 14:14:30 -0600
commit594dab4769533afaeb30a588e1731a6753a93f0d (patch)
tree2c18a1956e21208eb739d56775e22c406e3b93e8 /src/gallium/auxiliary/draw/draw_vs_llvm.c
parent9cbd8400433fb27da03f300b36495baef464cc6b (diff)
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_llvm.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_llvm.c42
1 files changed, 27 insertions, 15 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_llvm.c b/src/gallium/auxiliary/draw/draw_vs_llvm.c
index d29cb18efe..8aa8a617bb 100644
--- a/src/gallium/auxiliary/draw/draw_vs_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_vs_llvm.c
@@ -121,31 +121,45 @@ vs_llvm_run( struct draw_vertex_shader *base,
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);
+ }
+
draw->vertex_fetch.fetch_func( draw, machine, elts, count );
- /* run shader */
- gallivm_cpu_vs_exec(shader->llvm_prog,
- machine->Inputs,
- machine->Outputs,
- machine->Consts,
- machine->Temps);
+ if (!draw->rasterizer->bypass_vs) {
+ /* run shader */
+ gallivm_cpu_vs_exec(shader->llvm_prog,
+ machine->Inputs,
+ machine->Outputs,
+ machine->Consts,
+ machine->Temps);
+ }
/* store machine results */
for (j = 0; j < count; j++) {
unsigned slot;
float x, y, z, w;
- if (!draw->rasterizer->bypass_clipping) {
- x = vOut[j]->clip[0] = machine->Outputs[0].xyzw[0].f[j];
- y = vOut[j]->clip[1] = machine->Outputs[0].xyzw[1].f[j];
- z = vOut[j]->clip[2] = machine->Outputs[0].xyzw[2].f[j];
- w = vOut[j]->clip[3] = machine->Outputs[0].xyzw[3].f[j];
+ x = vOut[j]->clip[0] = machine->Outputs[0].xyzw[0].f[j];
+ y = vOut[j]->clip[1] = machine->Outputs[0].xyzw[1].f[j];
+ z = vOut[j]->clip[2] = machine->Outputs[0].xyzw[2].f[j];
+ w = vOut[j]->clip[3] = machine->Outputs[0].xyzw[3].f[j];
+ 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;
@@ -159,8 +173,6 @@ vs_llvm_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;