• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 The ANGLE Project Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // VectorizeVectorScalarArithmetic.h: Turn some arithmetic operations that operate on a float
6 // vector-scalar pair into vector-vector operations. This is done recursively. Some scalar binary
7 // operations inside vector constructors are also turned into vector operations.
8 //
9 // This is targeted to work around a bug in NVIDIA OpenGL drivers that was reproducible on NVIDIA
10 // driver version 387.92. It works around the most common occurrences of the bug.
11 
12 #ifndef COMPILER_TRANSLATOR_TREEOPS_GL_VECTORIZEVECTORSCALARARITHMETIC_H_
13 #define COMPILER_TRANSLATOR_TREEOPS_GL_VECTORIZEVECTORSCALARARITHMETIC_H_
14 
15 #include "common/angleutils.h"
16 
17 namespace sh
18 {
19 
20 class TCompiler;
21 class TIntermBlock;
22 class TSymbolTable;
23 
24 #ifdef ANGLE_ENABLE_GLSL
25 ANGLE_NO_DISCARD bool VectorizeVectorScalarArithmetic(TCompiler *compiler,
26                                                       TIntermBlock *root,
27                                                       TSymbolTable *symbolTable);
28 #else
VectorizeVectorScalarArithmetic(TCompiler * compiler,TIntermBlock * root,TSymbolTable * symbolTable)29 ANGLE_NO_DISCARD ANGLE_INLINE bool VectorizeVectorScalarArithmetic(TCompiler *compiler,
30                                                                    TIntermBlock *root,
31                                                                    TSymbolTable *symbolTable)
32 {
33     UNREACHABLE();
34     return false;
35 }
36 #endif
37 
38 }  // namespace sh
39 
40 #endif  // COMPILER_TRANSLATOR_TREEOPS_GL_VECTORIZEVECTORSCALARARITHMETIC_H_
41