summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_nvfragprog.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2004-04-14 21:19:34 +0000
committerKeith Whitwell <[email protected]>2004-04-14 21:19:34 +0000
commit6fb235661a3a78174e7554b292332a1dbb24f171 (patch)
treea7eafade7171277a5120581c825e26df867c51b4 /src/mesa/swrast/s_nvfragprog.c
parente3b0dde49c8f14d7e5de440e9e914612868078f5 (diff)
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.
Diffstat (limited to 'src/mesa/swrast/s_nvfragprog.c')
-rw-r--r--src/mesa/swrast/s_nvfragprog.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c
index 036c1870d1f..f7510bf3ddf 100644
--- a/src/mesa/swrast/s_nvfragprog.c
+++ b/src/mesa/swrast/s_nvfragprog.c
@@ -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 */
{