summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-03-14 11:24:28 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-03-14 11:24:28 -0600
commit9de9e1fe8c3f87fe672aed074348f07107fa3cec (patch)
tree2a8bec99a3300b4d4b7c5083daa46a916e001a29 /src/gallium
parent3088eb59497ec8621e003ce3bc87025f257c0a92 (diff)
gallium: print warning rather than assert(0) for LOG/EXP opcodes
Glean vertProg1 runs all the way through, rather than aborting.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/tgsi/exec/tgsi_exec.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c b/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c
index f2ed9e0353..ad871d2bdf 100644
--- a/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c
@@ -1516,11 +1516,41 @@ exec_instruction(
break;
case TGSI_OPCODE_EXP:
- assert (0);
+ printf("TGSI: EXP opcode not implemented\n");
+ /* from ARB_v_p:
+ tmp = ScalarLoad(op0);
+ result.x = 2^floor(tmp);
+ result.y = tmp - floor(tmp);
+ result.z = RoughApprox2ToX(tmp);
+ result.w = 1.0;
+ */
+#if 0
+ /* something like this: */
+ FETCH( &r[0], 0, CHAN_X );
+ micro_exp2( &r[0], &r[0] );
+ FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
+ STORE( &r[0], 0, chan_index );
+ }
+#endif
break;
case TGSI_OPCODE_LOG:
- assert (0);
+ printf("TGSI: LOG opcode not implemented\n");
+ /* from ARB_v_p:
+ tmp = fabs(ScalarLoad(op0));
+ result.x = floor(log2(tmp));
+ result.y = tmp / 2^(floor(log2(tmp)));
+ result.z = RoughApproxLog2(tmp);
+ result.w = 1.0;
+ */
+#if 0
+ /* something like this: */
+ FETCH( &r[0], 0, CHAN_X );
+ micro_lg2( &r[0], &r[0] );
+ FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) {
+ STORE( &r[0], 0, chan_index );
+ }
+#endif
break;
case TGSI_OPCODE_MUL: