View Full Version : Sampler2D in a uniform struct

05-31-2007, 08:06 AM
Hello, I am working on a driver for windows, I would like to know if GLSL needs to support structs of samplers.

I went through the specs and couldn't find evidence pointing either way.

Basically, would this be OK glsl code or something that only CG would compile.

struct HappyTexture{
Sampler2D myTexture;
char myTextureName[16];

uniform HappyTextures myTex[3];

// do shader voodoo to myTex[n].myTexture


05-31-2007, 09:51 AM
Did you run this code with GLSL Validate ? :


05-31-2007, 12:58 PM
It passed, I also see now the frontend already made by 3dlabs... CURSE MY HOME PROJECTS WHERE I DON'T RESEARCH BEFORE I CODE! :)

ps. Be on the watchout for an avr32 opengl2.0 driver that may work in 128x128 :)

05-31-2007, 03:38 PM
avr32 ? isn't it way too slow for anything 3D ?
How does this compares to a Pentium II 500Mhz for example ?

interesting project...

06-01-2007, 06:58 AM
It's not quite as fast, but it's faster than a GBA... don't forget that it's connected to an LCD that will probably be 128x128 pixels. Anyway, I already got some wireframes/quads/GL_SMOOTH working.