I have an application created with LibGDX. I can run the application on the desktop and it runs at 90 fps @1080p.
On Firefox it runs at 40-50 fps @1080p (maximized window).
On Chrome it runs at 30 fps @1080p (maximized window).
However on Chrome, if I lower the resolution, the performance doubles (to 60fps). On Firefox this does not happen. What can be the cause of this?
I am using webkitRequestAnimationFrame.
As shown, I know my PC can handle the resolution fine.
Edit
I'm trying to apply the tips below, although they seem aimed at mobile GPUs mostly.
Source: https://wiki.mozilla.org/Platform/GFX/MobileGPUs#Memory_Bandwidth
Always call glClear immediately after glBindFramebuffer
See the Adreno 200 document, section 3.2.1: "it is imperative to (a) use clears when switching Frame Buffer Objects (FBOs) to avoid having the driver tries to save/restore GMEM contents, and (b) always clear the depth-buffer at the start of a frame."
That makes sense, so we should always do it. Concretely, this means that we should do a glClear after every glBindFramebuffer call, ideally right after it, or at least before any draw-call.
Framebuffer bindings are expensive
Changing the framebuffer binding forces immediately resolving the rendering of the current framebuffer. Therefore it is important to sort rendering to minimize framebuffer bindings. The Adreno 200 document, Section 3.2.4, has a useful explanation.
Edit
The above did not make a notable difference.
Edit
I have a feeling this problem arises due to the GLSL compiler. I don't have a lot of knowledge on the subject, but I believe GLSL for OpenGL ES is compiled to regular GLSL, with some browser specific code. It could be that Chrome compiles less than optimal and causes fragment shading to slow the program down at higher resolutions.
If someone has some tips on how to make sure that this compilation is optimalized, I could try that out and see if it fixes the problem.
Edit
The problem doesn't seem prevalent in Chrome on Windows with a Intel HD graphics 4000+ chipset. Chrome version: 40.0.2214.111 m. Low resolution: 45fps~. High resolution: 30 fps steady.
My original test case was with Chrome on Ubuntu with a GTX 650. Chrome version will be added later.
Edit
Version of Chrome which displays this problem: 40.0.2214.111 (64-bit) on Ubuntu on a GTX 650 graphics card.
Edit
On the same PC with GTX 650, under Windows 7, the same application runs at 60fps steady under Chrome. Since under Ubuntu the application compiled to Java runs fine at 90fps, I believe it can't be a Linux driver issue, but rather is an issue with the Linux version of Chrome.
Edit
I've sent a bugreport to Chrome about this.