Bug 112298 - [WebGL] array-bounds-clamping should use less dramatic numbers
Summary: [WebGL] array-bounds-clamping should use less dramatic numbers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-03-13 16:24 PDT by Dean Jackson
Modified: 2013-03-13 19:17 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.53 KB, patch)
2013-03-13 16:29 PDT, Dean Jackson
kbr: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2013-03-13 16:24:27 PDT
Some architectures seem unable to handle the cast int(infinity) (where infinity is a float) in GLSL, which causes array-bounds-clamping to fail. From what I've seen, they always return 0 in this case, so we're still doing acceptable clamping. Unfortunately we can't use the isinf() function to test for this because it isn't in GLSLES 1.0.

I suggest replacing the MAX_NUMBER (infinity) values in the test with some large but not huge numbers, although maybe we should also be explicitly testing our casts from infinity as well?
Comment 1 Radar WebKit Bug Importer 2013-03-13 16:25:05 PDT
<rdar://problem/13415829>
Comment 2 Dean Jackson 2013-03-13 16:29:28 PDT
Created attachment 193021 [details]
Patch
Comment 3 Kenneth Russell 2013-03-13 17:13:07 PDT
I noticed this too on Windows platforms using ANGLE. It looks like Direct3D doesn't specify the result of HLSL intrinsics like clamp when the inputs are +/-infinity.
Comment 4 Kenneth Russell 2013-03-13 17:25:20 PDT
Comment on attachment 193021 [details]
Patch

Seems fine for this layout test. It would be good to add more tests verifying out-of-range access behavior works according to spec. Currently conformance/uniforms/out-of-bounds-uniform-array-access.html is the only conformance test in this area. r=me
Comment 5 Dean Jackson 2013-03-13 17:46:54 PDT
It's pretty disappointing how small a number can trigger this :(
Comment 6 Dean Jackson 2013-03-13 19:17:29 PDT
Committed r145780: <http://trac.webkit.org/changeset/145780>