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) 2012 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 | // Contains analysis utilities for dealing with HLSL's lack of support for |
michael@0 | 7 | // the use of intrinsic functions which (implicitly or explicitly) compute |
michael@0 | 8 | // gradients of functions with discontinuities. |
michael@0 | 9 | // |
michael@0 | 10 | |
michael@0 | 11 | #ifndef COMPILER_DETECTDISCONTINUITY_H_ |
michael@0 | 12 | #define COMPILER_DETECTDISCONTINUITY_H_ |
michael@0 | 13 | |
michael@0 | 14 | #include "compiler/intermediate.h" |
michael@0 | 15 | |
michael@0 | 16 | namespace sh |
michael@0 | 17 | { |
michael@0 | 18 | // Checks whether a loop can run for a variable number of iterations |
michael@0 | 19 | class DetectLoopDiscontinuity : public TIntermTraverser |
michael@0 | 20 | { |
michael@0 | 21 | public: |
michael@0 | 22 | bool traverse(TIntermNode *node); |
michael@0 | 23 | |
michael@0 | 24 | protected: |
michael@0 | 25 | bool visitBranch(Visit visit, TIntermBranch *node); |
michael@0 | 26 | bool visitLoop(Visit visit, TIntermLoop *loop); |
michael@0 | 27 | bool visitAggregate(Visit visit, TIntermAggregate *node); |
michael@0 | 28 | |
michael@0 | 29 | int mLoopDepth; |
michael@0 | 30 | bool mLoopDiscontinuity; |
michael@0 | 31 | }; |
michael@0 | 32 | |
michael@0 | 33 | bool containsLoopDiscontinuity(TIntermNode *node); |
michael@0 | 34 | |
michael@0 | 35 | // Checks for intrinsic functions which compute gradients |
michael@0 | 36 | class DetectGradientOperation : public TIntermTraverser |
michael@0 | 37 | { |
michael@0 | 38 | public: |
michael@0 | 39 | bool traverse(TIntermNode *node); |
michael@0 | 40 | |
michael@0 | 41 | protected: |
michael@0 | 42 | bool visitUnary(Visit visit, TIntermUnary *node); |
michael@0 | 43 | bool visitAggregate(Visit visit, TIntermAggregate *node); |
michael@0 | 44 | |
michael@0 | 45 | bool mGradientOperation; |
michael@0 | 46 | }; |
michael@0 | 47 | |
michael@0 | 48 | bool containsGradientOperation(TIntermNode *node); |
michael@0 | 49 | |
michael@0 | 50 | } |
michael@0 | 51 | |
michael@0 | 52 | #endif // COMPILER_DETECTDISCONTINUITY_H_ |