Bug 112298

Summary: [WebGL] array-bounds-clamping should use less dramatic numbers
Product: WebKit Reporter: Dean Jackson <dino>
Component: WebGLAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: gman, kbr, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch kbr: review+

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>