I am porting my impostors code from Windows to Oculus Quest (Android), and I am just having very weird performance issues.
The way I implement impostors is by rendering several views of an object or character into different textures, which I then put into different texture atlases that I assemble into one texture2D array.
On Windows everything works fine and it’s amazing how fast it can go when combining this with DrawMeshInstancedIndirect.
Obviously, since we are just rendering one quad per instance.
The problem is when I build my application for Oculus Quest.
I know that the GPU is not going to be as powerfull as a Desktop one, but the performance is really low and bad.
While debugging a lot and going to the most simple case and the most simple shader, I have noticed that the performance drops because of accessing to the texture 2D array.
I am using texture atlasing and putting it into texture arrays and have noticed some performance degredation (quick test scene took 4.2ms with Texture2D, then 4.5ms with Texture2DArray). Also it’s better to blend rather than discard fragments on Quest IIRC.
Thanks for your answer.
Why is it better to blend than to discard fragments?
In any case I’ve found an increase in performance by completely disably the Graphics Jobs (which I think are experimental).
I have also found that accessing to structured buffers from the fragment shaders is extremely slow, so I am trying to move any access to the vertex shader.
Although all these improvements and optimizations, I’m still finding very slow to access the texture arrays.
What it says in the Adreno OpenGL dev guide about discard is is:
Some developers believe that manually discarding, also known as killing, pixels in the fragment
shader boosts performance. The rules are not that simple for two reasons:
If some pixels in a thread are killed and others are not, the shader still executes.
It depends on how the shader compiler generates microcode.
In theory, if all pixels in a thread are killed, the GPU will stop processing that thread as soon as
possible. In practice, discard operations can disable hardware optimizations.
If a shader cannot avoid discard operations, attempt to render geometry, which depends on them
after opaque draw calls.
discard vs blend will depend on your scene. In isolation discard will generally be slower than alpha blend. In a real scene with a some overdraw I’ve found discard to be way faster.
Hello:
I am having also problems with texture arrays and oculus quest. I have a pretty complex shader, so initially I tried to strip it little by little of every possible offender.
The fps impact was trivial every time, until I arrived to a single TextureArray2D access I had at the end. The fps jumped from 50-60 to solid 72.
I have not saw any comments on this issue besides this post. It’s a documented thing?