[ANDROID] glDrawElementsInstanced generates kernel error
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: [ANDROID] glDrawElementsInstanced generates kernel error
That's excellent! It's a major issue fixed. Now I think GLES3 is suddenly much more attractive.
PS. And indeed next time I see him (dunno when that will be) I'll buy him a beer!
PS. And indeed next time I see him (dunno when that will be) I'll buy him a beer!
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: [ANDROID] glDrawElementsInstanced generates kernel error
I'm reviving this old thread because after lots of swearing, reflashing the stock rom to my Nexus 7 2013 (just don't ask) I finally managed to run the sample.
Kudos on getting it to run!!!
A few things though:
Update: I was able to run GLES3 on X11 (Linux). The blueish tint on the spheres is actually the cubemap being loaded as BGRA instead of RGBA (a common problem with GLES because it supports only one of the swizzled formats, instead of both).
Update 2: Problem seems to be surrounding PSSM, because after disabling PSSM; shadows begin to work (but multiple lights still deadlocks inside the driver).
Kudos on getting it to run!!!
A few things though:
- The sample got stuck on a deadlock inside the driver while compiling a shader. (I'm a bit puzzled, because Nexus 7 & 5 both use Adreno 330 so it should work the same for you and me). My latest Nexus 7 is rom mob30x (Android 6.0.1). Maybe your Nexus 5 has an older version that runs better? Did you install the Adreno user-space drivers?
- Disabling the shadows fixed the problem, and I was able to see the PbsMaterials sample. However comparing with the PC version, it didn't look the same.
The spheres were considerably blueish (I suspect a problem with the ambient lighting) - Removing the two spot lights and ambient light while enabling shadows again didn't deadlock the driver, however shadows were missing, which is clearly wrong.
Update: I was able to run GLES3 on X11 (Linux). The blueish tint on the spheres is actually the cubemap being loaded as BGRA instead of RGBA (a common problem with GLES because it supports only one of the swizzled formats, instead of both).
Update 2: Problem seems to be surrounding PSSM, because after disabling PSSM; shadows begin to work (but multiple lights still deadlocks inside the driver).
-
- OGRE Contributor
- Posts: 226
- Joined: Thu Oct 14, 2010 12:30 pm
- x 56
Re: [ANDROID] glDrawElementsInstanced generates kernel error
Congrats! Yes it was a PITA getting it to run, almost gave up at 2 points. I also had to disable PSSM from what I remember (or reduce their number from 3 to 2 and reduce the resolution... can't remember if this also worked). I noticed the bluish tint but I had bigger problems. How did you solve this?
If you have some Linux specific code, please make a pull request. I didn't test on Linux since I don't have a distro installed.
If you have some Linux specific code, please make a pull request. I didn't test on Linux since I don't have a distro installed.
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: [ANDROID] glDrawElementsInstanced generates kernel error
Aha! Thanks! I thought I was going crazy.Hotshot5000 wrote:Congrats! Yes it was a PITA getting it to run, almost gave up at 2 points. I also had to disable PSSM from what I remember (or reduce their number from 3 to 2 and reduce the resolution... can't remember if this also worked).
I didn't yet, but I did fix it in the past (back when 2.1 was WIP and the Hlms worked first on GLES2... oh the irony).Hotshot5000 wrote:I noticed the bluish tint but I had bigger problems. How did you solve this?
It was a matter of first detecting if the GPU supported the extension to have GL_ABGR_EXT or something like that.
Or else swapping red and blue channel by hand. Also I think GLES2 RenderSystem didn't properly account for this.
The explanation is simple, just swap Red with Blue channel. The tricky part is ensuring you don't unnecessarily swap R & B too often or in an inefficient way (i.e. doing it on the whole texture when you could tell the API to use ABGR if supported)
Yes, there's fixes and when I tidy up I'll submit PR. These fixes are minor. Mostly you didn't rename GLES2 -> GLES3 in the X11 specific files.Hotshot5000 wrote:If you have some Linux specific code, please make a pull request. I didn't test on Linux since I don't have a distro installed.