Hopefully fixed ARB1 profile's output to work on Nvidia's OpenGL. trunk
authorRyan C. Gordon <icculus@icculus.org>
Mon, 02 Jun 2008 14:00:30 -0400
branchtrunk
changeset 348 dbb278bdba57
parent 347 f8d9d0ae6ba8
child 349 78d4cf1ecf0c
Hopefully fixed ARB1 profile's output to work on Nvidia's OpenGL. It doesn't seem to like ALIASing of single elements of PARAM arrays.
mojoshader.c
--- a/mojoshader.c	Mon Jun 02 00:14:02 2008 -0400
+++ b/mojoshader.c	Mon Jun 02 14:00:30 2008 -0400
@@ -3812,8 +3812,13 @@
 
     if ((regtype == REG_TYPE_CONST) && (ctx->uniform_array))
     {
-        const char *constarray = get_ARB1_const_array_varname(ctx);
-        output_line(ctx, "ALIAS %s = %s[%d];", varname, constarray, regnum);
+        // The ALIAS version works on Apple's OpenGL, but not Nvidia's.
+        //const char *constarray = get_ARB1_const_array_varname(ctx);
+        //output_line(ctx, "ALIAS %s = %s[%d];", varname, constarray, regnum);
+
+        // This works everywhere.
+        // !!! FIXME: does this eat more resources?
+        output_line(ctx, "PARAM %s = program.env[%d];", varname, regnum);
     } // if
     else
     {