Bug 125546 - [WebGL] Check for global variable precision mismatch between vertex and fragment shaders
Summary: [WebGL] Check for global variable precision mismatch between vertex and fragm...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Roger Fong
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-10 14:57 PST by Roger Fong
Modified: 2013-12-13 15:42 PST (History)
10 users (show)

See Also:


Attachments
Patch (1.63 KB, patch)
2013-12-10 15:47 PST, Roger Fong
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-cq-01 for mac-mountainlion (469.68 KB, application/zip)
2013-12-10 16:37 PST, WebKit Commit Bot
no flags Details
Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2 (454.64 KB, application/zip)
2013-12-10 16:48 PST, Build Bot
no flags Details
Patch (5.97 KB, patch)
2013-12-10 16:54 PST, Roger Fong
bfulgham: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Fong 2013-12-10 14:57:09 PST
We can now check the precisions of global variables (uniforms) between vertex and fragment shaders and make sure that they match up.
Comment 1 Roger Fong 2013-12-10 15:47:40 PST
<rdar://problem/15203364>
Comment 2 Roger Fong 2013-12-10 15:47:57 PST
Created attachment 218915 [details]
Patch
Comment 3 Brent Fulgham 2013-12-10 15:50:54 PST
Comment on attachment 218915 [details]
Patch

r=me
Comment 4 WebKit Commit Bot 2013-12-10 16:37:46 PST
Comment on attachment 218915 [details]
Patch

Rejecting attachment 218915 [details] from commit-queue.

New failing tests:
webgl/1.0.2/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html
Full output: http://webkit-queues.appspot.com/results/47568065
Comment 5 WebKit Commit Bot 2013-12-10 16:37:47 PST
Created attachment 218920 [details]
Archive of layout-test-results from webkit-cq-01 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the commit-queue.
Bot: webkit-cq-01  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 6 Build Bot 2013-12-10 16:48:18 PST
Comment on attachment 218915 [details]
Patch

Attachment 218915 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/45898391

New failing tests:
webgl/1.0.2/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html
Comment 7 Build Bot 2013-12-10 16:48:20 PST
Created attachment 218921 [details]
Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-11  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 8 Roger Fong 2013-12-10 16:54:05 PST
Whoops, my bad. webkit-patch uploaded from the wrong directory :(
Comment 9 Roger Fong 2013-12-10 16:54:30 PST
Created attachment 218923 [details]
Patch
Comment 10 Roger Fong 2013-12-10 16:54:56 PST
Okay, the change is a little less trivial now.
Comment 11 WebKit Commit Bot 2013-12-10 16:56:37 PST
Attachment 218923 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/platform/mac/TestExpectations', u'Source/WebCore/ChangeLog', u'Source/WebCore/html/canvas/WebGLRenderingContext.cpp', u'Source/WebCore/platform/graphics/GraphicsContext3D.h', u'Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp', '--commit-queue']" exit_code: 1
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:330:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:339:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 17 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Roger Fong 2013-12-10 17:06:40 PST
> ERROR: Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:339:  One line control clauses should not use braces.  [whitespace/braces] [4]

Only the last error is accurate. Not sure what the deal with the others are.
Comment 13 Brent Fulgham 2013-12-13 12:39:40 PST
Comment on attachment 218923 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=218923&action=review

r=me, but consider using "auto" and revising the loop to use prefix ++.

> Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:337
> +    for (ShaderSymbolMap::iterator it = vertexEntry.uniformMap.begin(); it != vertexEntry.uniformMap.end(); it.operator++()) {

This could be "auto it = ..."

Also, why do you need to write it.operator++? Does ++it not work?

We prefer "++it" because it has a performance benefit (at least in older compilers).

> Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:341
> +    for (ShaderSymbolMap::iterator it = fragmentEntry.uniformMap.begin(); it != fragmentEntry.uniformMap.end(); it.operator++()) {

Ditto about "auto it = ..." and operator++
Comment 14 Roger Fong 2013-12-13 15:42:22 PST
committed: http://trac.webkit.org/changeset/160567 with bfulgham's comments applied