Fixed my braindead MOD_SATURATE code in GLSL profile. trunk
authorRyan C. Gordon <icculus@icculus.org>
Tue, 22 Apr 2008 05:31:04 -0400
branchtrunk
changeset 184 5d196ad56b25
parent 183 2aacea2477f6
child 185 ea719ad60d81
Fixed my braindead MOD_SATURATE code in GLSL profile.
mojoshader.c
--- a/mojoshader.c	Tue Apr 22 05:17:08 2008 -0400
+++ b/mojoshader.c	Tue Apr 22 05:31:04 2008 -0400
@@ -1643,7 +1643,7 @@
     if (arg->writemask == 0x0)
         fail(ctx, "BUG: empty writemask");  // !!! FIXME: make this a no-op?
 
-    char clampbuf[16] = { '\0' };
+    char clampbuf[32] = { '\0' };
     const char *clampleft = "";
     const char *clampright = "";
     if (arg->result_mod & MOD_SATURATE)
@@ -1656,6 +1656,7 @@
         {
             snprintf(clampbuf, sizeof (clampbuf),
                      ", vec%d(0.0), vec%d(1.0))", vecsize, vecsize);
+            clampright = clampbuf;
         } // else
     } // if