DescriptionAdd 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 : #
MessagesTotal messages: 9
|