Page 1 of 1

Crash in OpenGL renders in latest pull from repository

Posted: Tue Nov 13, 2012 07:30
by rtk6
I'm trying to get the latest version of CEGUI currently checked in to work since I need an OpenGL3 rendermodule (OS X is one of the supported platforms and it doesn't support the compatibility profile). It's looking like there's a bug in both the old OpenGL RenderModule and the OpenGL3 RenderModule as they are both crashing (Access Violtion) on my machine when running the Sample Framework.

The call stack is:

Code: Select all

   atioglxx.dll!05363af7()   Unknown
>   CEGUIOpenGL3Renderer_d.dll!CEGUI::OpenGL3FBOTextureTarget::clear() Line 114   C++
    CEGUIOpenGL3Renderer_d.dll!CEGUI::OpenGL3FBOTextureTarget::resizeRenderTexture() Line 179   C++
    CEGUIOpenGL3Renderer_d.dll!CEGUI::OpenGL3FBOTextureTarget::declareRenderSize(const CEGUI::Size<float> & sz) Line 73   C++
    CEGUIBase_d.dll!CEGUI::RenderingWindow::setSize(const CEGUI::Size<float> & size) Line 104   C++
    CEGUIBase_d.dll!CEGUI::Window::allocateRenderingWindow() Line 3259   C++
    CEGUIBase_d.dll!CEGUI::Window::setUsingAutoRenderingSurface(bool setting) Line 3218   C++
    CEGUIBase_d.dll!CEGUI::TplWindowProperty<CEGUI::Window,bool>::setNative_impl(CEGUI::PropertyReceiver * receiver, const bool value) Line 62   C++
    CEGUIBase_d.dll!CEGUI::TypedProperty<bool>::setNative(CEGUI::PropertyReceiver * receiver, const bool value) Line 84   C++
    CEGUIBase_d.dll!CEGUI::TypedProperty<bool>::set(CEGUI::PropertyReceiver * receiver, const CEGUI::String & value) Line 73   C++
    CEGUIBase_d.dll!CEGUI::PropertySet::setProperty(const CEGUI::String & name, const CEGUI::String & value) Line 142   C++
    CEGUIBase_d.dll!CEGUI::PropertyInitialiser::apply(CEGUI::PropertySet & target) Line 45   C++
    CEGUIBase_d.dll!CEGUI::WidgetLookFeel::initialiseWidget(CEGUI::Window & widget) Line 275   C++
    CEGUIBase_d.dll!CEGUI::Window::setLookNFeel(const CEGUI::String & look) Line 1903   C++
    CEGUIBase_d.dll!CEGUI::WindowManager::createWindow(const CEGUI::String & type, const CEGUI::String & name) Line 124   C++
    CEGUIBase_d.dll!CEGUI::GUILayout_xmlHandler::elementWindowStart(const CEGUI::XMLAttributes & attributes) Line 221   C++
    CEGUIBase_d.dll!CEGUI::GUILayout_xmlHandler::elementStart(const CEGUI::String & element, const CEGUI::XMLAttributes & attributes) Line 74   C++
    CEGUIExpatParser_d.dll!CEGUI::ExpatParser::startElement(void * data, const char * element, const char * * attr) Line 96   C++
    CEGUIExpatParser_d.dll!_XML_GetFeatureList()   Unknown
    CEGUIExpatParser_d.dll!_XML_GetFeatureList()   Unknown
    CEGUIExpatParser_d.dll!_XML_GetFeatureList()   Unknown
    CEGUIExpatParser_d.dll!_XML_GetFeatureList()   Unknown
    CEGUIExpatParser_d.dll!_XML_GetFeatureList()   Unknown
    CEGUIExpatParser_d.dll!_XML_ParseBuffer()   Unknown
    CEGUIExpatParser_d.dll!_XML_Parse()   Unknown
    CEGUIExpatParser_d.dll!CEGUI::ExpatParser::parseXML(CEGUI::XMLHandler & handler, const CEGUI::RawDataContainer & source, const CEGUI::String & __formal) Line 65   C++
    CEGUIBase_d.dll!CEGUI::XMLParser::parseXMLFile(CEGUI::XMLHandler & handler, const CEGUI::String & filename, const CEGUI::String & schemaName, const CEGUI::String & resourceGroup) Line 66   C++
    CEGUIBase_d.dll!CEGUI::WindowManager::loadLayoutFromFile(const CEGUI::String & filename, const CEGUI::String & resourceGroup, bool (CEGUI::Window *, CEGUI::String &, CEGUI::String &, void *) * callback, void * userdata) Line 290   C++
    CEGUISampleFramework_d.exe!SamplesFramework::initialiseSampleBrowserLayout() Line 462   C++
    CEGUISampleFramework_d.exe!SamplesFramework::updateInitialisationStep() Line 503   C++
    CEGUISampleFramework_d.exe!SamplesFramework::update(float passedTime) Line 297   C++
    CEGUISampleFramework_d.exe!CEGuiBaseApplication::renderSingleFrame(const float elapsed) Line 91   C++
    CEGUISampleFramework_d.exe!CEGuiGLFWSharedBase::drawFrame() Line 127   C++
    CEGUISampleFramework_d.exe!CEGuiGLFWSharedBase::run() Line 96   C++
    CEGUISampleFramework_d.exe!CEGuiBaseApplication::execute(SamplesFrameworkBase * sampleApp) Line 160   C++
    CEGUISampleFramework_d.exe!SamplesFrameworkBase::runApplication() Line 273   C++
    CEGUISampleFramework_d.exe!SamplesFrameworkBase::run() Line 130   C++
    CEGUISampleFramework_d.exe!main(int __formal, char * * __formal) Line 62   C++
    CEGUISampleFramework_d.exe!__tmainCRTStartup() Line 536   C
    CEGUISampleFramework_d.exe!mainCRTStartup() Line 377   C


The crash occurs in this call:

Code: Select all

    glClear(GL_COLOR_BUFFER_BIT);


The sample_framework app also crashes on OS X with the OpenGL render modules though I didn't have a debugger attached to see the call stack.

Re: Crash in OpenGL renders in latest pull from repository

Posted: Tue Nov 13, 2012 22:58
by rtk6
Fixed this locally (on Windows) - the crash was caused by attempting to clear a TextureTarget after setting its size to 0x0. While according to the OpenGL spec requesting this size is supposed to be valid but have no effect it seems that ATI drivers attempt to act upon it.

Fix is to add to OpenGL3/FBOTextureTarget.cpp:

Code: Select all

void OpenGL3FBOTextureTarget::declareRenderSize(const Sizef& sz)
{
    // THIS CHECK HERE FIXES THE ISSUE
    if ((d_area.getWidth() >= sz.d_width) && (d_area.getHeight() >=sz.d_height))
        return;
...