attrfv_func tabfv[_TNL_ATTRIB_MAX][4];
struct tnl_eval eval;
GLboolean *edgeflag_tmp;
+ GLboolean have_materials;
};
GLfloat *buffer;
GLuint count;
GLuint wrap_count; /* number of copied vertices at start */
- GLuint dangling_attr_ref; /* current attr implicitly referenced
+ GLboolean have_materials; /* bit of a hack - quick check for materials */
+ GLboolean dangling_attr_ref; /* current attr implicitly referenced
outside the list */
GLfloat *normal_lengths;
GLfloat vertex[_TNL_ATTRIB_MAX*4]; /* current values */
GLfloat *attrptr[_TNL_ATTRIB_MAX];
GLuint counter, initial_counter;
- GLuint dangling_attr_ref;
+ GLboolean dangling_attr_ref;
+ GLboolean have_materials;
GLuint opcode_vertex_list;
*/
if (tnl->save.currentsz[attr] == 0) {
assert(oldsz == 0);
- tnl->save.dangling_attr_ref = attr;
+ tnl->save.dangling_attr_ref = GL_TRUE;
_mesa_debug(0, "_save_upgrade_vertex: dangling reference attr %d\n",
attr);
save_init_13( tnl );
save_init_14( tnl );
save_init_15( tnl );
-
+
for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++)
tnl->save.attrsz[i] = 0;
-
+
tnl->save.vertex_size = 0;
+ tnl->save.have_materials = 0;
_save_reset_counters( ctx );
}
do { \
if (tnl->save.attrsz[A] < N) { \
_save_upgrade_vertex( ctx, A, N ); \
+ tnl->save.have_materials = GL_TRUE; \
} \
\
{ \
if (ctx->Light.ColorMaterialEnabled) {
_mesa_update_color_material(ctx, ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
}
-
+
+ if (tnl->vtx.have_materials) {
+ tnl->Driver.NotifyMaterialChange( ctx );
+ }
+
ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT;
}
/* Heuristic: Attempt to isolate attributes received outside
* begin/end so that they don't bloat the vertices.
*/
-#if 1
if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END &&
tnl->vtx.attrsz[attr] == 0
&& lastcount > 8
) {
init_attrfv( tnl );
}
-#endif
-
/* Fix up sizes:
*/
ATTRS( 15 )
static void init_attrfv( TNLcontext *tnl )
-{
-#if defined( WIN32 ) || defined( __VMS )
- if (0) fprintf(stderr, "%s %d\n", "init_attrfv", tnl->vtx.vertex_size);
-#else
- if (0) fprintf(stderr, "%s %d\n", __FUNCTION__, tnl->vtx.vertex_size);
-#endif
-
+{
if (tnl->vtx.vertex_size) {
GLuint i;
tnl->vtx.attrsz[i] = 0;
tnl->vtx.vertex_size = 0;
+ tnl->vtx.have_materials = 0;
}
}
do { \
if (tnl->vtx.attrsz[A] != N) { \
_tnl_fixup_vertex( ctx, A, N ); \
+ tnl->vtx.have_materials = GL_TRUE; \
} \
\
{ \
return;
}
-#if 1
/* Heuristic: attempt to isolate attributes occuring outside
* begin/end pairs.
*/
if (tnl->vtx.vertex_size && !tnl->vtx.attrsz[0])
_tnl_FlushVertices( ctx, ~0 );
-#endif
i = tnl->vtx.prim_count++;
tnl->vtx.prim[i].mode = mode | PRIM_BEGIN;
if (tnl->vtx.counter != tnl->vtx.initial_counter) {
_tnl_flush_vtx( ctx );
-#if 0
- init_0(tnl);
-#endif
}
-#if 0
- if (flags & FLUSH_UPDATE_CURRENT)
-#endif
{
_tnl_copy_to_current( ctx );