Hello,
I've recently upgraded from Ogre 1.7.4 to 1.8 (latest RC) and I'm deploying to an iPad3 with OpenGLES2 as the render system.
Since the upgrade OGRE has been throwing, sometimes, a BAD ACCESS when calling Ogre::GLSLESProgramCommon::isAttributeValid. With it being inconsistent it seems that something is getting lost on occasion but I'm not sure what.
Has anyone else experienced this? or does anyone know why this would be happening?
Carl
Bad Access in Ogre::GLSLESProgramCommon::isAttributeValid
-
- Kobold
- Posts: 38
- Joined: Thu Jul 05, 2012 3:51 pm
- x 4
-
- OGRE Retired Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: Bad Access in Ogre::GLSLESProgramCommon::isAttributeVali
Most likely there is a null program object. Check for a missing or incorrectly referenced shader and/or any shader compile errors.
-
- Kobold
- Posts: 38
- Joined: Thu Jul 05, 2012 3:51 pm
- x 4
Re: Bad Access in Ogre::GLSLESProgramCommon::isAttributeVali
Thank you for the prompt response.
There doesn't seem to be any errors popping up when it doesn't fail, little bit obvious. I'll try and get it to break again but so far it's behaving this morning. Pasted the error free trace below incase I'm being blind:
There doesn't seem to be any errors popping up when it doesn't fail, little bit obvious. I'll try and get it to break again but so far it's behaving this morning. Pasted the error free trace below incase I'm being blind:
Code: Select all
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/models' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/scripts' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/gorilla' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/gorilla/shaderBasedMaterials' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/fonts' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures/basketball' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures/binaryHouse' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures/grass' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures/mailbox' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures/moneybox' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures/neighbourhood' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures/porsche' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures/roadstraight' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures/swings' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures/wheeliebin' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/materials/textures/woodenhouse' of type 'FileSystem' to resource group 'General'
Creating resource group RTShader
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/RTShaderLib' of type 'FileSystem' to resource group 'RTShader'
Added resource location '/var/mobile/Applications/C3D25A16-F51D-4CFD-BAD3-C495544CEB01/Thundera.app/media/RTShaderLib/materials' of type 'FileSystem' to resource group 'RTShader'
Thundera Initialised
Parsing scripts for resource group Autodetect
Finished parsing scripts for resource group Autodetect
Creating resources for group Autodetect
All done
Parsing scripts for resource group General
Parsing script basketball.material
Parsing script binaryHouse.material
Parsing script binaryHouse2.material
Parsing script driveway.material
Parsing script fence.material
Parsing script grass.material
Parsing script hydrant.material
Parsing script mailbox.material
Parsing script moneybox.material
Parsing script neighbourhood.material
Parsing script porsche.material
Parsing script recbin.material
Parsing script roadstraight.material
Parsing script streetlight.material
Parsing script swings.material
Parsing script test.material
Parsing script testhouse.material
Parsing script wheeliebin.material
Parsing script woodenHouse.material
Parsing script Gorilla2D.material
Parsing script Gorilla3D.material
Parsing script DroidSansSerif.fontdef
Finished parsing scripts for resource group General
Creating resources for group General
All done
Parsing scripts for resource group Internal
Finished parsing scripts for resource group Internal
Creating resources for group Internal
All done
Parsing scripts for resource group RTShader
Parsing script HardwareSkinningShadow.material
Parsing script RTShaderSystem.material
Finished parsing scripts for resource group RTShader
Creating resources for group RTShader
All done
-
- OGRE Retired Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: Bad Access in Ogre::GLSLESProgramCommon::isAttributeVali
No, you're not blind. The log looks fine. You may need to do a little debugging. A little ways up the stack when it crashes you'll be able to see some objects that will give you the name of the program or material that is currently bound. That should help figure out what's going on.
-
- Kobold
- Posts: 38
- Joined: Thu Jul 05, 2012 3:51 pm
- x 4
Re: Bad Access in Ogre::GLSLESProgramCommon::isAttributeVali
After much testing I found the error went away by including the lines:
I added this to every material in the .material scripts.
Haven't had it error on me since.
Is there a way of having those lines inserted into the shader system, inline or otherwise by default. I'm going to be doing a bit of on the fly model conversion and don't want to manually put it in every time.
Even a way of NULL checking would allow me to handle it.
Carl
Code: Select all
rtshader_system{
// Override lighting stage with per pixel lighting.
lighting_stage per_pixel
}
Haven't had it error on me since.
Is there a way of having those lines inserted into the shader system, inline or otherwise by default. I'm going to be doing a bit of on the fly model conversion and don't want to manually put it in every time.
Even a way of NULL checking would allow me to handle it.
Carl
-
- Gremlin
- Posts: 155
- Joined: Wed Jul 11, 2007 2:43 am
- x 7
Re: Bad Access in Ogre::GLSLESProgramCommon::isAttributeVali
I'm having this error to - I've also upgraded from 1.7.2 to 1.8.
However my code is much developed from the 1.7.3 template project it was built on so I've been trying to merge the 1.8 template with my project to get it to work.
So far it builds with no errors, loads all my resources and parses my material scripts without any issues, but then crashes with the same error as above. Except mine is constant - Happens every time.
The above poster's solution has lead me to suspect that it's something to do with the RTShader system - Do I HAVE to use it? I tried removing the "#define USE_RTSHADER_SYSTEM" tag but I still get the error.
If the RTShader system is required for GLES2, what do I need to implement from the 1.8 template project in order to support it?
However my code is much developed from the 1.7.3 template project it was built on so I've been trying to merge the 1.8 template with my project to get it to work.
So far it builds with no errors, loads all my resources and parses my material scripts without any issues, but then crashes with the same error as above. Except mine is constant - Happens every time.
The above poster's solution has lead me to suspect that it's something to do with the RTShader system - Do I HAVE to use it? I tried removing the "#define USE_RTSHADER_SYSTEM" tag but I still get the error.
If the RTShader system is required for GLES2, what do I need to implement from the 1.8 template project in order to support it?
-
- OGRE Retired Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: Bad Access in Ogre::GLSLESProgramCommon::isAttributeVali
No, you do not have to use the RTShader system. However, if you don't then you need to define a vertex and fragment program for every material.
-
- Gnoblar
- Posts: 3
- Joined: Wed Sep 05, 2012 1:53 pm
Re: Bad Access in Ogre::GLSLESProgramCommon::isAttributeVali
Sorry to bump this up, but I'm getting the same error if I use MyGui combined with GLES2 for iOS development... Tried disabling RTSS system, but that does not help!
The strange thing is that everything works fine with GLES1. Do you know if there is any compatibility issue between Ogre GLES2 Renderer and MyGUI for iOS ?
The strange thing is that everything works fine with GLES1. Do you know if there is any compatibility issue between Ogre GLES2 Renderer and MyGUI for iOS ?
-
- Kobold
- Posts: 38
- Joined: Thu Jul 05, 2012 3:51 pm
- x 4
Re: Bad Access in Ogre::GLSLESProgramCommon::isAttributeVali
Hi,
Massive delay on this but if the problem still persists I found my problems were related to the class that made the RTShaderSystem
To quote an issue related to shadows I was having:
Massive delay on this but if the problem still persists I found my problems were related to the class that made the RTShaderSystem
To quote an issue related to shadows I was having:
Not sure if this helps anyone but I've not had the isAttributeValid error for some months now. (Unless I actually miss textures / shaders etc)I think I've found the main cause of the isAttributeValid() error I've been having for a couple of months now. It was due to the fact I didn't have the OgreDemo class (or equivalent, the one that starts the ogre framework) in an Objective C class and also that the OgreDemo class should just be "OgreDemo demo" and not "OgreDemo* demo"