Last Comment Bug 691354 - GL layers on Android: Most reftest failures are caused by pixels values being 'slightly' off
: GL layers on Android: Most reftest failures are caused by pixels values being...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: mozilla10
Assigned To: Benoit Girard (:BenWa)
:
Mentors:
Depends on: 692194
Blocks: opengl-mobile
  Show dependency treegraph
 
Reported: 2011-10-03 08:42 PDT by Ali Juma [:ajuma]
Modified: 2011-10-18 05:44 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Always use nearest filtering (2.17 KB, patch)
2011-10-03 08:42 PDT, Ali Juma [:ajuma]
no flags Details | Diff | Splinter Review
Log for reftest analyzer (26.48 KB, text/plain)
2011-10-04 14:08 PDT, Benoit Girard (:BenWa)
no flags Details
Log with 512 max TiledTextureImage (21.26 KB, text/plain)
2011-10-05 15:22 PDT, Benoit Girard (:BenWa)
no flags Details
ShaderHacking (13.53 KB, patch)
2011-10-06 14:18 PDT, Benoit Girard (:BenWa)
no flags Details | Diff | Splinter Review
patch (5.91 KB, patch)
2011-10-06 16:23 PDT, Benoit Girard (:BenWa)
jmuizelaar: review+
Details | Diff | Splinter Review
Enable test fix by patch (40.90 KB, patch)
2011-10-11 15:51 PDT, Benoit Girard (:BenWa)
jmuizelaar: review+
Details | Diff | Splinter Review
patch v2 (handle 3d transforms) (6.87 KB, patch)
2011-10-14 13:13 PDT, Benoit Girard (:BenWa)
no flags Details | Diff | Splinter Review
patch v3 (handle 3d transforms) (6.87 KB, patch)
2011-10-14 13:17 PDT, Benoit Girard (:BenWa)
jmuizelaar: review+
Details | Diff | Splinter Review

Description Ali Juma [:ajuma] 2011-10-03 08:42:26 PDT
Created attachment 564201 [details] [diff] [review]
Always use nearest filtering

With GL layers enabled on Android, several reftests are failing (Bug 676831 flagged many such tests). It turns out that virtually all of these failures are caused by pixel values having one or more channels off by 4 or 8 (e.g., instead of (255,255,255), we get (247,255,247)).

Interestingly, if we require GL to always use nearest (rather than linear) filtering, all but one of the reftest failures are resolved. We wouldn't want to land such a change since, among other things, it makes zooming look ugly, but this might help point us in the direction of the real problem.
Comment 1 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2011-10-04 11:14:54 PDT
What happens if you turn off the MOZ_GFX_OPTIMIZE_MOBILE => nearest hacks in bug 688104?
Comment 2 Ali Juma [:ajuma] 2011-10-04 13:35:00 PDT
(In reply to Chris Jones [:cjones] [:warhammer] from comment #1)
> What happens if you turn off the MOZ_GFX_OPTIMIZE_MOBILE => nearest hacks in
> bug 688104?

Even with those hacks turned off, we get the same problem.
Comment 3 Benoit Girard (:BenWa) 2011-10-04 14:08:24 PDT
Created attachment 564666 [details]
Log for reftest analyzer
Comment 4 Benoit Girard (:BenWa) 2011-10-05 15:21:42 PDT
The problem seems to be caused by the use of LINEAR filter with TiledTextureImage with large textures. The following patch changes the leakage to a clear pattern on the right edge of the rectangle.

-    mTileSize = mGL->GetMaxTextureSize();
+    mTileSize = 512;//mGL->GetMaxTextureSize();
Comment 5 Benoit Girard (:BenWa) 2011-10-05 15:22:14 PDT
Created attachment 565033 [details]
Log with 512 max TiledTextureImage
Comment 6 Benoit Girard (:BenWa) 2011-10-05 15:32:10 PDT
And the test passes with a 256 tile size.
Comment 7 Benoit Girard (:BenWa) 2011-10-06 14:18:51 PDT
Created attachment 565349 [details] [diff] [review]
ShaderHacking

Posting some shader hacking that I worked on with Jeff to get an idea of what is going on. Our general belief is that it is related to precision but we don't understand the problem.
Comment 8 Benoit Girard (:BenWa) 2011-10-06 16:23:58 PDT
Created attachment 565391 [details] [diff] [review]
patch

More of a work around then a fix unfortunately.
Comment 9 Benoit Girard (:BenWa) 2011-10-11 15:51:30 PDT
Created attachment 566380 [details] [diff] [review]
Enable test fix by patch

With these two patch applied we fail 3 tests and pass 3 test that !layerOpenGL fails.

~/mozilla/mozilla-central/tree> find . -name "reftest.list" | xargs grep "Android&&"
./layout/reftests/text-overflow/reftest.list:fails-if(Android&&layersOpenGL) HTTP(..) == block-padding.html block-padding-ref.html
./layout/reftests/canvas/reftest.list:fails-if(Android&&layersOpenGL) == image-rendering-test.html image-rendering-ref.html
./layout/reftests/canvas/reftest.list:fails-if(Android&&layersOpenGL) == image-shadow.html image-shadow-ref.html
./layout/reftests/svg/reftest.list:fails-if(Android&&!layersOpenGL) == dynamic-conditions-01.svg pass.svg # bug 652050
./layout/reftests/svg/reftest.list:fails-if(Android&&!layersOpenGL) == dynamic-switch-01.svg pass.svg # bug 652050
./layout/reftests/svg/reftest.list:fails-if(Android&&!layersOpenGL) == switch-01.svg pass.svg # bug 652050
Comment 10 Benoit Girard (:BenWa) 2011-10-14 13:13:43 PDT
Created attachment 567165 [details] [diff] [review]
patch v2 (handle 3d transforms)
Comment 11 Benoit Girard (:BenWa) 2011-10-14 13:17:17 PDT
Created attachment 567168 [details] [diff] [review]
patch v3 (handle 3d transforms)
Comment 14 Benoit Girard (:BenWa) 2011-10-17 08:44:13 PDT
Still need to land test changes. I was waiting on TBPL results to compare my local results with tinderbox, currently the tree is closed.
Comment 16 Marco Bonardo [::mak] 2011-10-18 05:40:46 PDT
https://hg.mozilla.org/mozilla-central/rev/a456c129a2c3
Comment 17 Marco Bonardo [::mak] 2011-10-18 05:44:09 PDT
merged follow-up as well https://hg.mozilla.org/mozilla-central/rev/6688e7c9cd8f

Note You need to log in before you can comment on or make changes to this bug.