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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Add comment