Use tcc and the emitted C code from s_fragprog_to_c.c to dynamically compile

and execute fragment programs.  Very limited and experimental, but works
well enough to run arbfplight.c.

	http://fabrice.bellard.free.fr/tcc/

Compile with 'make linux-tcc', being sure to make clean first.
This commit is contained in:
Keith Whitwell
2004-04-14 21:19:34 +00:00
parent e3b0dde49c
commit 6fb235661a
10 changed files with 269 additions and 18 deletions

View File

@@ -1357,10 +1357,18 @@ _swrast_exec_fragment_program( GLcontext *ctx, struct sw_span *span )
init_machine(ctx, &ctx->FragmentProgram.Machine,
ctx->FragmentProgram.Current, span, i);
#ifdef USE_TCC
if (!_swrast_execute_codegen_program(ctx, program, ~0,
&ctx->FragmentProgram.Machine,
span, i)) {
span->array->mask[i] = GL_FALSE; /* killed fragment */
}
#else
if (!execute_program(ctx, program, ~0,
&ctx->FragmentProgram.Machine, span, i)) {
span->array->mask[i] = GL_FALSE; /* killed fragment */
}
#endif
/* Store output registers */
{