summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_vs_sse.c
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@tungstengraphics.com>2008-05-28 12:42:42 +0200
committerJakob Bornecrantz <jakob@tungstengraphics.com>2008-05-28 12:42:42 +0200
commit938d9d596324e411fde5312f2bb65b444c502c37 (patch)
treef32087f7c61f0827980278a5dae2b32edf534b72 /src/gallium/auxiliary/draw/draw_vs_sse.c
parent5d90f97f48f8ba231d52bb1a4758dd37f81ec8d6 (diff)
parent7b85ea19de09d4e7e077ca147528e90e52683690 (diff)
Merge branch 'gallium-vertex-linear' into gallium-0.1
Conflicts: src/gallium/auxiliary/draw/draw_pt_varray.c
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs_sse.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_sse.c55
1 files changed, 5 insertions, 50 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_sse.c b/src/gallium/auxiliary/draw/draw_vs_sse.c
index c88bc137ee..2dc9352c6f 100644
--- a/src/gallium/auxiliary/draw/draw_vs_sse.c
+++ b/src/gallium/auxiliary/draw/draw_vs_sse.c
@@ -49,9 +49,7 @@
#include "tgsi/util/tgsi_parse.h"
#define SSE_MAX_VERTICES 4
-#define SSE_SWIZZLES 1
-#if SSE_SWIZZLES
typedef void (XSTDCALL *codegen_function) (
const struct tgsi_exec_vector *input, /* 1 */
struct tgsi_exec_vector *output, /* 2 */
@@ -64,14 +62,6 @@ typedef void (XSTDCALL *codegen_function) (
float (*aos_output)[4], /* 9 */
uint num_outputs, /* 10 */
uint output_stride ); /* 11 */
-#else
-typedef void (XSTDCALL *codegen_function) (
- const struct tgsi_exec_vector *input,
- struct tgsi_exec_vector *output,
- float (*constant)[4],
- struct tgsi_exec_vector *temporary,
- float (*immediates)[4] );
-#endif
struct draw_sse_vertex_shader {
struct draw_vertex_shader base;
@@ -113,7 +103,6 @@ vs_sse_run_linear( struct draw_vertex_shader *base,
for (i = 0; i < count; i += MAX_TGSI_VERTICES) {
unsigned int max_vertices = MIN2(MAX_TGSI_VERTICES, count - i);
-#if SSE_SWIZZLES
/* run compiled shader
*/
shader->func(machine->Inputs,
@@ -130,43 +119,6 @@ vs_sse_run_linear( struct draw_vertex_shader *base,
input = (const float (*)[4])((const char *)input + input_stride * max_vertices);
output = (float (*)[4])((char *)output + output_stride * max_vertices);
-#else
- unsigned int j, slot;
-
- /* Swizzle inputs.
- */
- for (j = 0; j < max_vertices; j++) {
- for (slot = 0; slot < base->info.num_inputs; slot++) {
- machine->Inputs[slot].xyzw[0].f[j] = input[slot][0];
- machine->Inputs[slot].xyzw[1].f[j] = input[slot][1];
- machine->Inputs[slot].xyzw[2].f[j] = input[slot][2];
- machine->Inputs[slot].xyzw[3].f[j] = input[slot][3];
- }
-
- input = (const float (*)[4])((const char *)input + input_stride);
- }
-
- /* run compiled shader
- */
- shader->func(machine->Inputs,
- machine->Outputs,
- (float (*)[4])constants,
- machine->Temps,
- shader->immediates);
-
- /* Unswizzle all output results.
- */
- for (j = 0; j < max_vertices; j++) {
- for (slot = 0; slot < base->info.num_outputs; slot++) {
- output[slot][0] = machine->Outputs[slot].xyzw[0].f[j];
- output[slot][1] = machine->Outputs[slot].xyzw[1].f[j];
- output[slot][2] = machine->Outputs[slot].xyzw[2].f[j];
- output[slot][3] = machine->Outputs[slot].xyzw[3].f[j];
- }
-
- output = (float (*)[4])((char *)output + output_stride);
- }
-#endif
}
}
@@ -205,15 +157,18 @@ draw_create_vs_sse(struct draw_context *draw,
tgsi_scan_shader(templ->tokens, &vs->base.info);
+ vs->base.draw = draw;
+ vs->base.create_varient = draw_vs_varient_aos_sse;
+// vs->base.create_varient = draw_vs_varient_generic;
vs->base.prepare = vs_sse_prepare;
vs->base.run_linear = vs_sse_run_linear;
vs->base.delete = vs_sse_delete;
- vs->machine = &draw->machine;
+ vs->machine = &draw->vs.machine;
x86_init_func( &vs->sse2_program );
if (!tgsi_emit_sse2( (struct tgsi_token *) vs->base.state.tokens,
- &vs->sse2_program, vs->immediates, SSE_SWIZZLES ))
+ &vs->sse2_program, vs->immediates, TRUE ))
goto fail;
vs->func = (codegen_function) x86_get_func( &vs->sse2_program );