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:
@@ -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 */
|
||||
{
|
||||
|
Reference in New Issue
Block a user