Closed Bug 934796 Opened 11 years ago Closed 11 years ago

Gallery: border should be drawn by separate draw operations, not branching in fragment shader

Categories

(Firefox OS Graveyard :: Gaia::Gallery, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 932919

People

(Reporter: bjacob, Unassigned)

References

Details

Before someone says "but I tested on my device, and it didn't make a speed difference":

  1) there is considerable variation between different GPUs, of how much this matters. Basically, this is going to matter very little on desktop GPUs, a little bit on Adrenos, and hugely on PowerVR. See e.g. this branching-in-fragment-shader benchmark
http://people.mozilla.org/~bjacob/webglbranchingbenchmark/webglbranchingbenchmark.html
and some results here on various devices:
http://people.mozilla.org/~bjacob/webglbranchingbenchmark/webglbranchingbenchmarkresults.txt
See how some mild branching, even based on just uniforms, made a fragment shaders run dozens of times slower on PowerVR. (And we do care about performance specifically on PowerVR, for 1.3).

  2) There is other low-hanging fruit in this fragment shader, and on a given GPU we might have to fix that too before we reap the real benefits.

So, instead of drawing the border by branching in this fragment shader, you want to have a separate simple fragment shader for the border, and render the border with separate WebGL draw operations.
Summary: Gallery: border should be drawn by separate draw operations, not branching on fragment shader → Gallery: border should be drawn by separate draw operations, not branching in fragment shader
Bug 932919 already exists to remove the border feature altogether, and I hear that it is being planned for 1.3. Duping.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.