Ian Romanick wrote:
> On Wed, Dec 10, 2008 at 08:05:46AM -0700, Brian Paul wrote:
>> Ian Romanick wrote:
>>> I did an
>>> implementation of Marc Olano's noise function[1].  It was quite fast on
>>> a Geforce 8, but it choked Mesa's GLSL compiler.
>> I'd be interested in seeing the shader, Ian, and fixing the compiler.  I  
>> know we'll transition to a new compiler, but I want to fix bugs in the  
>> current one too.
> 
> Unfortunately (or fortunately, depending on your point of view) the
> current version seems to work just fine with Mesa's compiler.  I
> haven't touched this code in months, so my memory is a bit fuzzy.  I
> seem to recall that an earlier version used a small look-up table in
> the grad function, and that was the source of the errors in Mesa.
> 
> There were two problems, IIRC.  The first was that GLSL 1.20
> array initializers were not supported (such as below).  I think there
> was also some problem with variable indexing into an array.
> 
> uniform vec2 grad_table[4] = vec2 [4] (vec2( 1.0,  1.0),
>                                        vec2(-1.0,  1.0),
>                                      vec2( 1.0, -1.0),
>                                      vec2(-1.0, -1.0));

I'm working on the GLSL 1.20 array constructor syntax now.  Is there a 
reason why you declared that array as a uniform?

It'd be best to declare an array like that as ordinary, const-qualified 
variable.  Const so that it can be stored in constant buffer memory 
instead of in temporary registers.

-Brain

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to