[Mesa-dev] GLSL swizzle lowering

Ian Romanick idr at freedesktop.org
Tue Aug 31 13:22:30 PDT 2010


-----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 special needed to do it? (some version directive, or special
> syntax?)

Nope.  The following shader is valid in all versions of GLSL and should
generate an index into the vector.  What does the Cg compiler generate
for that?

uniform int i;
uniform vec4 c;

void main()
{
	gl_FragColor = vec4(c[i]);
}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx9ZIQACgkQX1gOwKyEAw864gCfdKoE1iQYdfZk12i9u57pCMGH
JLgAnAxk17y7D+TgIgSTjGdGfpdFJdNM
=Yw3i
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list