From 25d5a9f29ec90d62e5492daf32b0dbde98b42d19 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 2 Jun 2008 14:00:30 -0400 Subject: [PATCH] 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. --HG-- branch : trunk --- mojoshader.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mojoshader.c b/mojoshader.c index 2b237672..376ae582 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -3812,8 +3812,13 @@ static void emit_ARB1_uniform(Context *ctx, RegisterType regtype, int regnum) 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 {