Search Issue Tracker
By Design
Votes
0
Found in
5.5.1f1
Issue ID
885599
Regression
No
[OpenGL] VAOs are not reused, causing a GL_INVALID_OPERATION when binding them
VAOs are not reused, but instead generated, binded, and deleted every frame, instead of being reused.
Steps to reproduce:
1) Open the attached project (VAOBugReport/UnityProject_VAOBug) on a Windows machine.
2) Open 'VAOBug' scene.
3) Enter play mode.
- A Command Prompt window, logging the GL_INVALID_OPERATION message appears, Unity crashes after a couple seconds.
The code that triggers the crash is as follows (in main.cpp attached in ~/VAOBugReport/src):
oglBindVertexArray(_vertex_array_id);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
oglBindVertexArray(0);
Replacing it with the following code and recompiling the .dll prevents it from crashing:
oglBindBuffer(GL_ARRAY_BUFFER, locations[loc_vert_pos].id);
oglEnableVertexAttribArray(loc_vert_pos);
oglVertexAttribPointer(loc_vert_pos, 3, GL_FLOAT, GL_FALSE, 0, reinterpret_cast<void*>(0));
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
oglDisableVertexAttribArray(loc_vert_pos);
Reproduced on:
2017.1.0a5, 5.5.3f1, 5.2.4f1
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Add comment