mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 15:58:35 +02:00
Potentially address the crash when no vertex format is specified
This commit is contained in:
parent
9f689b1b69
commit
1974ded050
1 changed files with 15 additions and 16 deletions
|
@ -81,24 +81,23 @@ void GL45Backend::updateInput() {
|
||||||
glVertexBindingDivisor(bufferChannelNum, frequency);
|
glVertexBindingDivisor(bufferChannelNum, frequency);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Manage Activation what was and what is expected now
|
|
||||||
// This should only disable VertexAttribs since the one in use have been disabled above
|
|
||||||
for (GLuint i = 0; i < (GLuint)newActivation.size(); i++) {
|
|
||||||
bool newState = newActivation[i];
|
|
||||||
if (newState != _input._attributeActivation[i]) {
|
|
||||||
if (newState) {
|
|
||||||
glEnableVertexAttribArray(i);
|
|
||||||
} else {
|
|
||||||
glDisableVertexAttribArray(i);
|
|
||||||
}
|
|
||||||
_input._attributeActivation.flip(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(void)CHECK_GL_ERROR();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Manage Activation what was and what is expected now
|
||||||
|
// This should only disable VertexAttribs since the one needed by the vertex format (if it exists) have been enabled above
|
||||||
|
for (GLuint i = 0; i < (GLuint)newActivation.size(); i++) {
|
||||||
|
bool newState = newActivation[i];
|
||||||
|
if (newState != _input._attributeActivation[i]) {
|
||||||
|
if (newState) {
|
||||||
|
glEnableVertexAttribArray(i);
|
||||||
|
} else {
|
||||||
|
glDisableVertexAttribArray(i);
|
||||||
|
}
|
||||||
|
_input._attributeActivation.flip(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(void)CHECK_GL_ERROR();
|
||||||
|
|
||||||
_input._invalidFormat = false;
|
_input._invalidFormat = false;
|
||||||
_stats._ISNumFormatChanges++;
|
_stats._ISNumFormatChanges++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue