Change-Id: I75b61a9dd9bfa3c69b6fbe8f8dbd947b3c031d89
GLuint mBoundElementArrayBufferId{0}; ///< The ID passed to glBindBuffer(GL_ELEMENT_ARRAY_BUFFER)
// glBindTexture() state
- GLenum mActiveTextureUnit{MAX_TEXTURE_UNITS};
+ GLenum mActiveTextureUnit{0};
GLuint mBoundTextureId[MAX_TEXTURE_UNITS][MAX_TEXTURE_TARGET]; ///< The ID passed to glBindTexture()
// glBlendFuncSeparate() state
void Context::ActiveTexture(uint32_t textureBindingIndex)
{
- if(mImpl->mGlStateCache.mActiveTextureUnit != textureBindingIndex)
+ if(mImpl->mGlStateCache.mActiveTextureUnit != textureBindingIndex && textureBindingIndex < MAX_TEXTURE_UNITS)
{
mImpl->mGlStateCache.mActiveTextureUnit = textureBindingIndex;
if(mImpl->mGlStateCache.mActiveTextureUnit >= MAX_TEXTURE_UNITS || typeId >= MAX_TEXTURE_TARGET)
{
DALI_LOG_ERROR("Invalid index (%d, %d)\n", mImpl->mGlStateCache.mActiveTextureUnit, typeId);
- std::abort();
+ return;
}
if(mImpl->mGlStateCache.mBoundTextureId[mImpl->mGlStateCache.mActiveTextureUnit][typeId] != textureId)