Re: [Mesa-dev] GLSL swizzle lowering

2010-08-31 Thread Luca Barbieri
With Cg toolkit 2.1, it prints this: test.glsl(6) : error C1011: cannot index a non-array value With Cg toolkit 3.0, it works, but produces a mess in any profile, which seems among the worst ways you could imagine of doing this. Perhaps the feature is infrequently used, so they didn't bother to op

Re: [Mesa-dev] GLSL swizzle lowering

2010-08-31 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Marek Olšák wrote: > On Tue, Aug 31, 2010 at 7:20 PM, Ian Romanick > wrote: > Marek Ol?ák wrote: >> a D3D10 feature), which kind of makes this optimization a no-go. I >> suggest using SEQ instead: > >> bvec4 selector = eq

Re: [Mesa-dev] GLSL swizzle lowering

2010-08-31 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Luca Barbieri wrote: > nv30 and nv40 support SEQ everywhere, and Marek's SEQ/DP4 seems optimal. > > BTW, the nVidia Cg compiler (which can tell us what nVidia does) > doesn't seem to accept my naive attempts to index a vector in GLSL: is > something s

Re: [Mesa-dev] GLSL swizzle lowering

2010-08-31 Thread Luca Barbieri
nv30 and nv40 support SEQ everywhere, and Marek's SEQ/DP4 seems optimal. BTW, the nVidia Cg compiler (which can tell us what nVidia does) doesn't seem to accept my naive attempts to index a vector in GLSL: is something special needed to do it? (some version directive, or special syntax?) _

Re: [Mesa-dev] GLSL swizzle lowering

2010-08-31 Thread Marek Olšák
On Tue, Aug 31, 2010 at 7:20 PM, Ian Romanick wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Marek Ol?ák wrote: > > On Tue, Aug 31, 2010 at 2:14 AM, Ian Romanick > > wrote: > > > > While I was trying to get one of the Humus demos working today, it >

Re: [Mesa-dev] GLSL swizzle lowering

2010-08-31 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Marek Ol?ák wrote: > On Tue, Aug 31, 2010 at 2:14 AM, Ian Romanick > wrote: > > While I was trying to get one of the Humus demos working today, it > occurred to me that we can possibly do better than > ir_vec_

Re: [Mesa-dev] GLSL swizzle lowering

2010-08-30 Thread Marek Olšák
On Tue, Aug 31, 2010 at 2:14 AM, Ian Romanick wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > While I was trying to get one of the Humus demos working today, it > occurred to me that we can possibly do better than > ir_vec_index_to_cond_assign to lower variable indexing of vectors.

[Mesa-dev] GLSL swizzle lowering

2010-08-30 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 While I was trying to get one of the Humus demos working today, it occurred to me that we can possibly do better than ir_vec_index_to_cond_assign to lower variable indexing of vectors. In addition to using conditional assignment, we can also use a dot