Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2279)

Issue 6270050: Add the SH_CSS_SHADERS_SPEC flag. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 6 months ago by mvujovic
Modified:
12 years, 5 months ago
Reviewers:
kbr1, dgkoch, nicolas
CC:
angleproject-review_googlegroups.com
Base URL:
http://angleproject.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Add the SH_CSS_SHADERS_SPEC flag. The only change to the ANGLE API is the new SH_CSS_SHADERS_SPEC flag. Background: This patch implements the shader validation and rewriting that is required for CSS Shaders on the ANGLE end. Basically, CSS Shaders will not allow direct access to the DOM element texture in order to prevent timing attacks. Instead, the result of a CSS fragment shader will be blended and composited with the DOM element texture. The browser will insert shader code that does this blending and compositing operation. CSS Shaders needs ANGLE to prepare the shader for code insertion by the browser. The comment above the SH_CSS_SHADERS_SPEC flag in ShaderLang.h gives you the details: // The CSS Shaders spec is a subset of the WebGL spec. // // In both CSS vertex and fragment shaders, ANGLE reserves the "css_" prefix // and renames the main function to css_main. // // In CSS fragment shaders, ANGLE disables the gl_FragColor built-in and // enables the css_MixColor and css_ColorMatrix built-ins. // // After passing a CSS shader through ANGLE, the browser is expected to append // a new main function to it. // This new main function will call the css_main function. // It may also perform additional operations like varying assignment, texture // access, and gl_FragColor assignment in order to implement the CSS Shaders // blend modes. // I'm working closely with one of the CSS Shaders spec editors, Vincent Hardy. He is in the process of updating the CSS Shaders spec to reflect this implementation. BUG=NONE TEST=Run the translator with "-s=c" on a shader to use the SH_CSS_SHADERS_SPEC flag.

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -14 lines) Patch
M include/GLSLANG/ShaderLang.h View 1 2 2 chunks +24 lines, -2 lines 0 comments Download
M samples/translator/translator.cpp View 1 2 2 chunks +4 lines, -0 lines 0 comments Download
M src/build_angle.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/compiler/Compiler.cpp View 1 2 5 chunks +16 lines, -1 line 0 comments Download
M src/compiler/Initialize.cpp View 1 2 5 chunks +23 lines, -9 lines 0 comments Download
M src/compiler/ParseHelper.cpp View 1 2 3 chunks +6 lines, -2 lines 0 comments Download
A src/compiler/RenameFunction.h View 1 chunk +36 lines, -0 lines 0 comments Download
M src/compiler/ShHandle.h View 1 2 2 chunks +8 lines, -0 lines 0 comments Download
M src/compiler/translator_common.vcproj View 1 2 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 9
mvujovic
Nicolas, Ken, or Daniel, Could you take a look at this when you have a ...
12 years, 5 months ago (2012-06-07 16:42:37 UTC) #1
kbr1
This looks good to me but Nicolas should sign off on it. One comment. https://codereview.appspot.com/6270050/diff/2001/src/compiler/Initialize.cpp ...
12 years, 5 months ago (2012-06-07 20:50:29 UTC) #2
nicolas
If I understand correctly, for CSS shaders to work you need to bind a texture ...
12 years, 5 months ago (2012-06-07 21:16:55 UTC) #3
mvujovic
On 2012/06/07 20:50:29, kbr1 wrote: > This looks good to me but Nicolas should sign ...
12 years, 5 months ago (2012-06-07 22:29:46 UTC) #4
mvujovic
On 2012/06/07 21:16:55, nicolas wrote: > If I understand correctly, for CSS shaders to work ...
12 years, 5 months ago (2012-06-07 22:48:28 UTC) #5
dgkoch
LGTM Just one question, but it's probably more about the CSS spec than anything else. ...
12 years, 5 months ago (2012-06-08 00:35:41 UTC) #6
mvujovic
On 2012/06/08 00:35:41, dgkoch wrote: > LGTM > > Just one question, but it's probably ...
12 years, 5 months ago (2012-06-08 16:40:55 UTC) #7
dgkoch
Yeah the changes look fine to me.
12 years, 5 months ago (2012-06-08 17:32:28 UTC) #8
mvujovic
12 years, 5 months ago (2012-06-08 17:49:10 UTC) #9
On 2012/06/08 17:32:28, dgkoch wrote:
> Yeah the changes look fine to me.

Great, thanks Daniel. Committed in r1145.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b