tg->attrib[attr].fetch( src, data );
- debug_printf("vert %d/%d attr %d: %f %f %f %f\n",
- i, elt, attr, data[0], data[1], data[2], data[3]);
-
+ if (0) debug_printf("vert %d/%d attr %d: %f %f %f %f\n",
+ i, elt, attr, data[0], data[1], data[2], data[3]);
tg->attrib[attr].emit( data, dst );
}
- debug_printf("\n");
vert += tg->translate.key.output_stride;
}
tg->attrib[attr].fetch( src, data );
- debug_printf("vert %d attr %d: %f %f %f %f\n",
- i, attr, data[0], data[1], data[2], data[3]);
+ if (0) debug_printf("vert %d attr %d: %f %f %f %f\n",
+ i, attr, data[0], data[1], data[2], data[3]);
tg->attrib[attr].emit( data, dst );
}
- debug_printf("\n");
vert += tg->translate.key.output_stride;
}
#define W 3
-typedef void (*run_func)( struct translate *translate,
- unsigned start,
- unsigned count,
- void *output_buffer );
+#ifdef WIN32
+#define RTASM __cdecl
+#else
+#define RTASM
+#endif
+
+typedef void (RTASM *run_func)( struct translate *translate,
+ unsigned start,
+ unsigned count,
+ void *output_buffer );
-typedef void (*run_elts_func)( struct translate *translate,
- const unsigned *elts,
- unsigned count,
- void *output_buffer );
+typedef void (RTASM *run_elts_func)( struct translate *translate,
+ const unsigned *elts,
+ unsigned count,
+ void *output_buffer );
/* Load and unpack twice:
*/
sse_movss(p->func, data, src);
- sse2_punpcklbw(p->func, src, get_identity(p));
- sse2_punpcklbw(p->func, src, get_identity(p));
+ sse2_punpcklbw(p->func, data, get_identity(p));
+ sse2_punpcklbw(p->func, data, get_identity(p));
/* Convert to float:
*/
- sse2_cvtdq2ps(p->func, src, src);
+ sse2_cvtdq2ps(p->func, data, data);
/* Scale by 1/255.0
*/
- sse_mulps(p->func, src, get_inv_255(p));
+ sse_mulps(p->func, data, get_inv_255(p));
}
elts,
count,
output_buffer );
-
}
static void translate_sse_run( struct translate *translate,
struct translate *translate_sse2_create( const struct translate_key *key )
{
- struct translate_sse *p = CALLOC_STRUCT( translate_sse );
+ struct translate_sse *p = NULL;
+
+ if (!rtasm_cpu_has_sse() || !rtasm_cpu_has_sse2())
+ goto fail;
+ p = CALLOC_STRUCT( translate_sse );
if (p == NULL)
goto fail;
+ p->translate.key = *key;
p->translate.release = translate_sse_release;
p->translate.set_buffer = translate_sse_set_buffer;
p->translate.run_elts = translate_sse_run_elts;
p->translate.run = translate_sse_run;
- if (!rtasm_cpu_has_sse() || !rtasm_cpu_has_sse2())
- goto fail;
-
if (!build_vertex_emit(p, &p->linear_func, TRUE))
goto fail;
if (!build_vertex_emit(p, &p->elt_func, FALSE))
goto fail;
- p->translate.key = *key;
p->gen_run = (run_func)x86_get_func(&p->linear_func);
p->gen_run_elts = (run_elts_func)x86_get_func(&p->elt_func);