Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | // |
michael@0 | 2 | // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. |
michael@0 | 3 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 4 | // found in the LICENSE file. |
michael@0 | 5 | // |
michael@0 | 6 | |
michael@0 | 7 | #ifndef COMPILER_VERSIONGLSL_H_ |
michael@0 | 8 | #define COMPILER_VERSIONGLSL_H_ |
michael@0 | 9 | |
michael@0 | 10 | #include "GLSLANG/ShaderLang.h" |
michael@0 | 11 | #include "compiler/intermediate.h" |
michael@0 | 12 | |
michael@0 | 13 | // Traverses the intermediate tree to return the minimum GLSL version |
michael@0 | 14 | // required to legally access all built-in features used in the shader. |
michael@0 | 15 | // GLSL 1.1 which is mandated by OpenGL 2.0 provides: |
michael@0 | 16 | // - #version and #extension to declare version and extensions. |
michael@0 | 17 | // - built-in functions refract, exp, and log. |
michael@0 | 18 | // - updated step() to compare x < edge instead of x <= edge. |
michael@0 | 19 | // GLSL 1.2 which is mandated by OpenGL 2.1 provides: |
michael@0 | 20 | // - many changes to reduce differences when compared to the ES specification. |
michael@0 | 21 | // - invariant keyword and its support. |
michael@0 | 22 | // - c++ style name hiding rules. |
michael@0 | 23 | // - built-in variable gl_PointCoord for fragment shaders. |
michael@0 | 24 | // - matrix constructors taking matrix as argument. |
michael@0 | 25 | // - array as "out" function parameters |
michael@0 | 26 | // |
michael@0 | 27 | class TVersionGLSL : public TIntermTraverser { |
michael@0 | 28 | public: |
michael@0 | 29 | TVersionGLSL(ShShaderType type); |
michael@0 | 30 | |
michael@0 | 31 | // Returns 120 if the following is used the shader: |
michael@0 | 32 | // - "invariant", |
michael@0 | 33 | // - "gl_PointCoord", |
michael@0 | 34 | // - matrix/matrix constructors |
michael@0 | 35 | // - array "out" parameters |
michael@0 | 36 | // Else 110 is returned. |
michael@0 | 37 | int getVersion() { return mVersion; } |
michael@0 | 38 | |
michael@0 | 39 | virtual void visitSymbol(TIntermSymbol*); |
michael@0 | 40 | virtual void visitConstantUnion(TIntermConstantUnion*); |
michael@0 | 41 | virtual bool visitBinary(Visit, TIntermBinary*); |
michael@0 | 42 | virtual bool visitUnary(Visit, TIntermUnary*); |
michael@0 | 43 | virtual bool visitSelection(Visit, TIntermSelection*); |
michael@0 | 44 | virtual bool visitAggregate(Visit, TIntermAggregate*); |
michael@0 | 45 | virtual bool visitLoop(Visit, TIntermLoop*); |
michael@0 | 46 | virtual bool visitBranch(Visit, TIntermBranch*); |
michael@0 | 47 | |
michael@0 | 48 | protected: |
michael@0 | 49 | void updateVersion(int version); |
michael@0 | 50 | |
michael@0 | 51 | private: |
michael@0 | 52 | ShShaderType mShaderType; |
michael@0 | 53 | int mVersion; |
michael@0 | 54 | }; |
michael@0 | 55 | |
michael@0 | 56 | #endif // COMPILER_VERSIONGLSL_H_ |