On Sun, 7 Mar 2004 02:12:54 +0100
Felix K�hling <[EMAIL PROTECTED]> wrote:
> On Sat, 06 Mar 2004 20:16:38 +0100
> Michel D�nzer <[EMAIL PROTECTED]> wrote:
>
> > On Sat, 2004-03-06 at 17:08, S�rgio Monteiro Basto wrote:
> [snip]
> >
> > [...]
> >
> > > Program received signal SIGSEGV, Segmentation fault.
> > > 0x40757507 in generic_interp (ctx=0x0, t=0.918080449, edst=96,
> > > eout=21, ein=22, force_boundary=0 '\0')
> > > at t_vertex.c:736
> > > 736 a[0].insert[4-1]( &a[0], vdst, pos );
> >
> > This may be enough for the savage developers, but a backtrace might
> > still be good.
>
> This is in Keith's new vertex code. I'm not too familiar with the
> internals. I'd really need more info in order to find the cause of
> trouble. Maybe Keith would be the better person to fix this.
>
> First thing I noticed is that ctx is 0x0, which is probably a debugger
> problem because it would have crashed earlier if ctx was really 0. It
> would be helpful to see the values of all the symbols in the offending
> line.
>
> I'm downloading foobillard 2.9 now. Maybe I can reproduce the problem
> here and get all the info needed.
Found it. I had already fixed this problem yesterday, but not committed
it yet, because it didn't fix the problem I was actually hunting. ;-)
I've committed it now. A patch is attached for your convenience. Apply
it in mesa/src/mesa/drivers/dri/savage.
Regards,
Felix
--- ./savagetris.c.~1.5.~ 2004-03-03 00:46:07.000000000 +0100
+++ ./savagetris.c 2004-03-07 02:27:46.000000000 +0100
@@ -760,7 +760,7 @@
/* EMIT_ATTR's must be in order as they tell t_vertex.c how to
* build up a hardware vertex.
*/
- if (index & _TNL_BITS_TEX_ANY) {
+ if ((index & _TNL_BITS_TEX_ANY) || !(ctx->_TriangleCaps & DD_FLATSHADE)) {
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, SAVAGE_HW_NO_W );
}
else {
@@ -797,9 +797,12 @@
}
/* Only need to change the vertex emit code if there has been a
- * statechange to a new hardware vertex format:
+ * statechange to a new hardware vertex format and also when the
+ * vertex format is set for the first time. This is indicated by
+ * imesa->vertex_size == 0.
*/
- if (drawCmd != (imesa->DrawPrimitiveCmd & SAVAGE_HW_SKIPFLAGS)) {
+ if (drawCmd != (imesa->DrawPrimitiveCmd & SAVAGE_HW_SKIPFLAGS) ||
+ imesa->vertex_size == 0) {
imesa->vertex_size =
_tnl_install_attrs( ctx,
imesa->vertex_attrs,
--- ./savage_xmesa.c.~1.5.~ 2004-03-03 02:02:56.000000000 +0100
+++ ./savage_xmesa.c 2004-03-05 21:31:12.000000000 +0100
@@ -408,6 +408,11 @@
imesa->depth_scale = (imesa->savageScreen->zpp == 2) ?
(1.0F/0x10000):(1.0F/0x1000000);
+ /* Uninitialized vertex format. Force setting the vertex state in
+ * savageRenderStart.
+ */
+ imesa->vertex_size = 0;
+
/* Utah stuff
*/
imesa->new_state = ~0;