I am using Ogre-Next 4.0.0 and in my try-out application if I switch from D3D11 render system to GL3Plus, I am getting a strange OpenGL error already before rendering of the 1st geometry:
OpenGL:error(high) 1282: GL_INVALID_OPERATION error generated. VAO names must be generated with glGenVertexArrays before they can be bound or used.
It is coming from GL3PlusRenderSystem::_startLegacyV1Rendering() where mGlobalVao is trying to bind. I see in the debugger, that the GL contexts are switched - I am not sure whether this could be a problem. My application initializes the Ogre and its render system by creating a 1x1 pixel hidden window and then I create my real window(s). The error pops by trying to redraw my very first visible window.
The D3D11 render system works without any problems.
Note that I have made some changes to my Ogre, but this kind of error sounds like some core issue (just for an overview and completeness, the changes are on this branch: https://github.com/bishopnator/ogre-nex ... or/hlmsext). I tried to debug ogre and understand this behavior, but I am running out of ideas. In several discussions, it was stated that VAO shouldn't be (or cannot be) shared between the contexts. The context with creates the VAO should be used also to bind the VAO - but this just sounds like the whole idea with mGlobalVao is wrong, or all windows should use same context. Not sure about the indented design in ogre.
The callstack of the reported OpenGL error:
Code: Select all
OgreNextMain_d.dll!Ogre::Log::logMessage(const std::string & message={...}, Ogre::LogMessageLevel lml=LML_NORMAL, bool maskDebug=false) Line 76 C++
OgreNextMain_d.dll!Ogre::Log::Stream::~Stream() Line 189 C++
RenderSystem_GL3Plus_d.dll!GLDebugCallback(unsigned int source=33350, unsigned int type=33356, unsigned int id=1282, unsigned int severity=37190, int length=122, const char * message=0x00007ffc1d15e3d0, const void * userParam=0x0000000000000000) Line 143 C++
nvoglv64.dll!00007ffc1b3806e5() Unknown
nvoglv64.dll!00007ffc1b380795() Unknown
RenderSystem_GL3Plus_d.dll!Ogre::GL3PlusRenderSystem::_startLegacyV1Rendering() Line 2970 C++
OgreNextMain_d.dll!Ogre::SceneManager::_renderPhase02(Ogre::Camera * camera=0x0000022df2880dc0, const Ogre::Camera * lodCamera=0x0000022df2880dc0, unsigned char firstRq='2', unsigned char lastRq='3', bool includeOverlays=true) Line 1518 C++
OgreNextMain_d.dll!Ogre::Camera::_renderScenePhase02(const Ogre::Camera * lodCamera=0x0000022df2880dc0, unsigned char firstRq='2', unsigned char lastRq='3', bool includeOverlays=true) Line 389 C++
OgreNextMain_d.dll!Ogre::Viewport::_updateRenderPhase02(Ogre::Camera * camera=0x0000022df2880dc0, const Ogre::Camera * lodCamera=0x0000022df2880dc0, unsigned char firstRq='2', unsigned char lastRq='3') Line 207 C++
OgreNextMain_d.dll!Ogre::CompositorPassScene::execute(const Ogre::Camera * lodCamera=0x0000000000000000) Line 316 C++
OgreNextMain_d.dll!Ogre::CompositorNode::_update(const Ogre::Camera * lodCamera=0x0000000000000000, Ogre::SceneManager * sceneManager=0x0000022df260ebc0) Line 836 C++
OgreNextMain_d.dll!Ogre::CompositorWorkspace::_update(const bool bInsideAutoreleasePool=true) Line 907 C++
OgreNextMain_d.dll!Ogre::CompositorManager2::_updateImplementation() Line 791 C++
OgreNextMain_d.dll!Ogre::RenderSystem::updateCompositorManager(Ogre::CompositorManager2 * compositorManager=0x0000022dd09d2f40) Line 1326 C++
OgreNextMain_d.dll!Ogre::CompositorManager2::_update() Line 713 C++
OgreNextMain_d.dll!Ogre::Root::_updateAllRenderTargets() Line 1582 C++
OgreNextMain_d.dll!Ogre::Root::renderOneFrame() Line 1113 C++
I debugged e.g. Sample_Tutorial_Distortion and there is only a single window hence single OpenGL context and this method _startLegacyV1Rendering is called with the value of mCurrentContext as used during the initialization of the mGlobalVao. But this is not in my case.
Any ideas? Even some suggestions where to look in Ogre would be great.


