Implemented POW in GLSL profile. trunk
authorRyan C. Gordon <icculus@icculus.org>
Sun, 06 Apr 2008 09:26:27 -0400
branchtrunk
changeset 112 5ddfb2f7ca4a
parent 111 aeff087f4a32
child 113 8ebf445c5305
Implemented POW in GLSL profile.
mojoshader.c
--- a/mojoshader.c	Sun Apr 06 09:23:40 2008 -0400
+++ b/mojoshader.c	Sun Apr 06 09:26:27 2008 -0400
@@ -2336,7 +2336,10 @@
 
 static void emit_GLSL_POW(Context *ctx)
 {
-    fail(ctx, "unimplemented.");  // !!! FIXME
+    const char *src0 = make_GLSL_sourcearg_string(ctx, 0);
+    const char *src1 = make_GLSL_sourcearg_string(ctx, 1);
+    const char *code = make_GLSL_destarg_assign(ctx, 0, "pow(abs(%s), %s))", src0, src1);
+    output_line(ctx, "%s", code);
 } // emit_GLSL_POW
 
 static void emit_GLSL_CRS(Context *ctx)