Mesh drawing optimization and fixes:
- Pass MFace, MTface and OrigIndex arrays via userData to compareDrawParams callback rather than looking up for this layers for each face - This allowed to avoid massing DM to compare callback which seems like a bad-level pass - Fixed crashes on some video cards when assigning different materials to different faces in edit mode. Both of intel and nvidia cards in my laptop were affected by this error
This commit is contained in:
@@ -273,7 +273,7 @@ static void emDM_drawMappedFaces(
|
||||
{
|
||||
EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm;
|
||||
EditFace *efa;
|
||||
int i, draw;
|
||||
int i, draw, flush;
|
||||
const int skip_normals= !glIsEnabled(GL_LIGHTING); /* could be passed as an arg */
|
||||
|
||||
/* GL_ZERO is used to detect if drawing has started or not */
|
||||
@@ -352,7 +352,11 @@ static void emDM_drawMappedFaces(
|
||||
}
|
||||
}
|
||||
|
||||
if (draw==2) {
|
||||
flush= (draw==2);
|
||||
if (!skip_normals && !flush && efa->next)
|
||||
flush|= efa->mat_nr != efa->next->mat_nr;
|
||||
|
||||
if (flush) {
|
||||
glEnd();
|
||||
poly_prev= GL_ZERO; /* force glBegin */
|
||||
|
||||
@@ -419,8 +423,11 @@ static void emDM_drawMappedFaces(
|
||||
}
|
||||
}
|
||||
|
||||
flush= (draw==2);
|
||||
if (!skip_normals && !flush && efa->next)
|
||||
flush|= efa->mat_nr != efa->next->mat_nr;
|
||||
|
||||
if (draw==2) {
|
||||
if (flush) {
|
||||
glEnd();
|
||||
poly_prev= GL_ZERO; /* force glBegin */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user