From 1974ded0505f89f6df712156d43391142b29a1e5 Mon Sep 17 00:00:00 2001 From: samcake Date: Wed, 23 Nov 2016 16:37:06 -0800 Subject: [PATCH] Potentially address the crash when no vertex format is specified --- .../gpu-gl/src/gpu/gl45/GL45BackendInput.cpp | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/libraries/gpu-gl/src/gpu/gl45/GL45BackendInput.cpp b/libraries/gpu-gl/src/gpu/gl45/GL45BackendInput.cpp index 25f8c83074..01bd2d7bce 100644 --- a/libraries/gpu-gl/src/gpu/gl45/GL45BackendInput.cpp +++ b/libraries/gpu-gl/src/gpu/gl45/GL45BackendInput.cpp @@ -81,24 +81,23 @@ void GL45Backend::updateInput() { glVertexBindingDivisor(bufferChannelNum, frequency); #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; _stats._ISNumFormatChanges++; }