ogre-next icon indicating copy to clipboard operation
ogre-next copied to clipboard

There is a bug, that RenderSystem:endRenderPassDescriptor() was called fromed other place, after begin.

Open 36yang opened this issue 1 year ago • 9 comments

System Information

  • Ogre Version: :grey_question: Latest version of ogrenext
  • Operating System / Platform: :grey_question: Win10
  • RenderSystem: :grey_question: DX11
  • GPU: :grey_question: GTX960M

Detailled description

After RenderSystem::beginRenderPassDescriptor() function has been called. The RenderSystem:endRenderPassDescriptor() 

was called by Texture loading from TextureGupManager::checkStagingTextureLimits() -> _clearStateAndFlushCommandBuffer()->RenderSystem:endRenderPassDescriptor() 。 And then RenderSystem::getCurrentPassDescriptor()return a nullptr at Hlms::preparePassHash().

Ogre.log

Callstack

YLY8U X6DNN`SWNRP8FT NM~M@PZOXCS8}BNBEH0OSBO 642_ LMQ8_KIUZZ1ZA~ SJR

36yang avatar Sep 25 '22 08:09 36yang

This is a single threaded program. All stack calls start from the same renderOneFrame

I don't know how to fix this, Need help!

36yang avatar Sep 30 '22 01:09 36yang

Hi! Sorry for taking so long to answer.

This is indeed an Ogre bug.

Unfortunately Overlays are tricky due to them having a very old design.

The best workaround I can offer is that you manually load the font before rendering happens:

Ogre::String fontName = myTextAreaOverlayElement->getFontName()
FontPtr font = Ogre::v1::FontManager::getSingleton().getByName( font );
if( !mFont->isLoaded() )
    mFont->load();

Do that for each font name that you have; and the problem should be solved.

darksylinc avatar Sep 30 '22 02:09 darksylinc

Btw if you need something more advanced for your UI needs you may be interested in Colibri

darksylinc avatar Sep 30 '22 02:09 darksylinc

Thank you for your answer. I will use this solution to solve my problems. However, I don't know whether this may also happen when creating an item to load a texture. Whether repair is required

36yang avatar Sep 30 '22 02:09 36yang

Very nice. I'm looking for a GUI system suitable for ogrenext. The current solution is imgui, but I prefer the object-oriented programming style. Let me study whether this represents our needs

36yang avatar Sep 30 '22 02:09 36yang

Items loading texture should be happening outside begin/end RenderPassDescriptor unless the item or material was created in a listener very close to rendering.

That sounds like a different bug (because the font one is quite specific as Overlays were designed to load textures while rendering)

darksylinc avatar Sep 30 '22 02:09 darksylinc

Thanks, that is OK,

36yang avatar Sep 30 '22 02:09 36yang

The current solution is imgui, but I prefer the object-oriented programming style. Let me study whether this represents our needs

Great. IMHO imgui is the best for developer UI (i.e. debug menus, editor mode, trying stuff out) thanks to its simplicity and immediate mode nature.

While Colibri is better for UIs that you need to present to the user.

darksylinc avatar Sep 30 '22 02:09 darksylinc

OK, I will have a try

36yang avatar Sep 30 '22 02:09 36yang