1 //
2 // Copyright 2019 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // This mutating tree traversal flips the output of dFdy() to account for framebuffer flipping.
7 //
8 // From: dFdy(p)
9 // To:   (dFdy(p) * viewportYScale)
10 //
11 // See http://anglebug.com/3487
12 
13 #ifndef COMPILER_TRANSLATOR_TREEOPS_REWRITEDFDY_H_
14 #define COMPILER_TRANSLATOR_TREEOPS_REWRITEDFDY_H_
15 
16 #include "common/angleutils.h"
17 #include "compiler/translator/Compiler.h"
18 
19 namespace sh
20 {
21 
22 class TCompiler;
23 class TIntermNode;
24 class TIntermSymbol;
25 class TIntermBinary;
26 class TIntermTyped;
27 class TSymbolTable;
28 class TVariable;
29 class SpecConst;
30 class DriverUniform;
31 
32 // If fragRotation = nullptr, no rotation will be applied.
33 ANGLE_NO_DISCARD bool RewriteDfdy(TCompiler *compiler,
34                                   ShCompileOptions compileOptions,
35                                   TIntermNode *root,
36                                   const TSymbolTable &symbolTable,
37                                   int shaderVersion,
38                                   SpecConst *specConst,
39                                   const DriverUniform *driverUniforms);
40 
41 }  // namespace sh
42 
43 #endif  // COMPILER_TRANSLATOR_TREEOPS_REWRITEDFDY_H_
44