On 12/27/06, Jerome Glisse <[EMAIL PROTECTED]> wrote: > On 12/27/06, Tilman Sauerbeck <[EMAIL PROTECTED]> wrote: > > Jerome Glisse [2006-12-26 18:21]: > > > Since modification in vertex program handling in r300 there is > > > a segfault occuring while trying to access Parameters ptr in > > > gl_program struct, thus i am wondering if Parameters ptr shouldn't > > > be initialized to NULL in > > > _mesa_init_program_struct (shader/program.c line 201), but i still > > > > I don't think that would help: > > r300 only calls _mesa_init_vertex_program() on CALLOC'ed memory > > (r300_shader.c:114), which in turn calls _mesa_init_program_struct(). > > Ditto for fragment programs. > > > > There's no other way _mesa_init_program_struct() could be called in r300 > > either, AFAICS. > > > > Still something like the attached patch might be good to actually > > initialize all of the gl_program struct. > > > > Regards, > > Tilman > > > > Yes, after real investigation this doesn't change anythings but, we should > definitly zero structure. Anyway my issue is related with > VertexProgram._Current i am wondering if when a program is unbind (or > a new program is bind) the VertexProgram._Current field should be updated > if not than driver should never rely on _Current because you can end up > with _Current still pointing to a deleted program. > > I attach a patch which update ._Current along with Current but this might > be the wrong things to do. Comment on this are more then welcome :) > > Btw in the patch i also add a check for NULL ptr in DeletePrograms i think > this is a good thing to test. > > best, > Jerome Glisse >
I thinked a bit more about this and the attached patch might be better. Updating _Current only when Current and _Current are equal. best, Jerome Glisse ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev