glClear(mask) is sometimes crashing

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
IrrlichtForiOS
Posts: 61
Joined: Mon Oct 08, 2012 1:46 pm

glClear(mask) is sometimes crashing

Post by IrrlichtForiOS »

The following Code in COGLESDriver.cpp is crashing sometimes randomly.

Code: Select all

//! clears the zbuffer
bool COGLES1Driver::beginScene(bool backBuffer, bool zBuffer, SColor color,
        const SExposedVideoData& videoData,
        core::rect<s32>* sourceRect)
{
    CNullDriver::beginScene(backBuffer, zBuffer, color);
 
#if defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_)
    Device->displayBegin();
    glBindFramebufferOES(GL_FRAMEBUFFER_OES, ViewFramebuffer);
#endif
 
    GLbitfield mask = 0;
 
    if (backBuffer)
    {
        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
        Material.ColorMask = ECP_ALL;
 
        const f32 inv = 1.0f / 255.0f;
        glClearColor(color.getRed() * inv, color.getGreen() * inv,
                color.getBlue() * inv, color.getAlpha() * inv);
 
        mask |= GL_COLOR_BUFFER_BIT;
    }
 
    if (zBuffer)
    {
        glDepthMask(GL_TRUE);
        Material.ZWriteEnable = true;
 
        mask |= GL_DEPTH_BUFFER_BIT;
    }
 
    glClear(mask); // EXC_BAD_ACCESS
    return true;
}
Does someone know, how to solve this issue?
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: glClear(mask) is sometimes crashing

Post by mongoose7 »

The problem is unlikely to be in this code. Trying putting a printfs before and after the glClear: printf("calling glClear\n"); fflush(stdout); glClear(mask); printf("glClear called\n"); fflush(stdout);
IrrlichtForiOS
Posts: 61
Joined: Mon Oct 08, 2012 1:46 pm

Re: glClear(mask) is sometimes crashing

Post by IrrlichtForiOS »

mongoose7 wrote:The problem is unlikely to be in this code. Trying putting a printfs before and after the glClear: printf("calling glClear\n"); fflush(stdout); glClear(mask); printf("glClear called\n"); fflush(stdout);
What will this do to solve the problem?
CuteAlien
Admin
Posts: 9643
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: glClear(mask) is sometimes crashing

Post by CuteAlien »

If this is a new problem (since last week) it might be because of the recent merge from trunk. Nadro is working on this and the priority was on ES2. If it's been a while longer then we need an example to reproduce the crash.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
IrrlichtForiOS
Posts: 61
Joined: Mon Oct 08, 2012 1:46 pm

Re: glClear(mask) is sometimes crashing

Post by IrrlichtForiOS »

CuteAlien wrote:If this is a new problem (since last week) it might be because of the recent merge from trunk. Nadro is working on this and the priority was on ES2. If it's been a while longer then we need an example to reproduce the crash.
Hey, it's occuring since years.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: glClear(mask) is sometimes crashing

Post by Nadro »

Hi,

Thanks for a report, I'll try to check that during fixing ES1 driver in ogl-es branch (probably near next week).
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
IrrlichtForiOS
Posts: 61
Joined: Mon Oct 08, 2012 1:46 pm

Re: glClear(mask) is sometimes crashing

Post by IrrlichtForiOS »

Nadro wrote:Hi,

Thanks for a report, I'll try to check that during fixing ES1 driver in ogl-es branch (probably near next week).
Hi ndro, thanks for giving it a try! Looking forward to hear from you :-)
Post Reply