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 -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index ddfad47..1f87855 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -203,6 +203,8 @@ _mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog, { (void) ctx; if (prog) { + MEMSET(prog, 0, sizeof (struct gl_program)); + prog->Id = id; prog->Target = target; prog->Resident = GL_TRUE;
pgpprDUBR8Axb.pgp
Description: PGP signature
------------------------------------------------------------------------- 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