[GEM-dev] [glsl_program] getVariables() prob

IOhannes m zmoelnig zmoelnig at iem.at
Tue Feb 28 18:40:21 CET 2006


james tittle wrote:
> ...just throwing this out to anyone:  I've come across a problem that 
> has me stumped...it occurs when I'm working on a shader and change  the
> number of uniform variables between loadings, such that re- linking
> causes a crash at:
> 
> m_symname[i]=gensym(m_name[i]);
> 
> ...this is in a loop that grabs results of active uniform variables, 
> and it seems we're not cleaning up correctly either m_name[i] or 
> m_symname[i]...I've also noticed that sometimes m_name[0] will not 

you should never ever "clean up" a pd-symbol (like m_symname[i]);
however, deallocating the m_symname-table (which only holds references
to symbols) is fine.

> correctly be filled in, and therefore it doesn't show up in printInfo ()...
> 

> ...also, in getVariables() I've rearranged the order of free-ing 
> variables so that it occurs before we query the gl object parameters 
> (ie. before we reset m_uniformCount to it's new value), but this  wasn't
> the full answer...any other ideas?

wow. that greyed some of my hair...
took me till now to find it and it turned out to be a tiny "<=" instead
of "<" in line-101.


i did a lot of other changes which shouldn't affect the behaviour.
now it works for me (i just committed it)


one last question:
when loading the "Toon"-shader (dunno who sent it, i guess jamie), i get
active uniform variables like "gl_ModelViewProjectionMatrix" (apart from
the valid "Phong"); i have no idea where this comes from; anyone...?


happy glsling

mfg,asdr
IOhannes




More information about the GEM-dev mailing list