xref: /aosp_15_r20/external/angle/src/compiler/translator/tree_ops/glsl/UseInterfaceBlockFields.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2016 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 
7 // UseInterfaceBlockFields.h: insert statements to reference all members in InterfaceBlock list at
8 // the beginning of main. This is to work around a Mac driver that treats unused standard/shared
9 // uniform blocks as inactive.
10 
11 #ifndef COMPILER_TRANSLATOR_TREEOPS_GLSL_USEINTERFACEBLOCKFIELDS_H_
12 #define COMPILER_TRANSLATOR_TREEOPS_GLSL_USEINTERFACEBLOCKFIELDS_H_
13 
14 #include <GLSLANG/ShaderLang.h>
15 #include "common/angleutils.h"
16 #include "common/debug.h"
17 
18 namespace sh
19 {
20 
21 class TCompiler;
22 class TIntermBlock;
23 class TSymbolTable;
24 
25 using InterfaceBlockList = std::vector<sh::InterfaceBlock>;
26 
27 #ifdef ANGLE_ENABLE_GLSL
28 [[nodiscard]] bool UseInterfaceBlockFields(TCompiler *compiler,
29                                            TIntermBlock *root,
30                                            const InterfaceBlockList &blocks,
31                                            const TSymbolTable &symbolTable);
32 #else
UseInterfaceBlockFields(TCompiler * compiler,TIntermBlock * root,const InterfaceBlockList & blocks,const TSymbolTable & symbolTable)33 [[nodiscard]] ANGLE_INLINE bool UseInterfaceBlockFields(TCompiler *compiler,
34                                                         TIntermBlock *root,
35                                                         const InterfaceBlockList &blocks,
36                                                         const TSymbolTable &symbolTable)
37 {
38     UNREACHABLE();
39     return false;
40 }
41 #endif
42 
43 }  // namespace sh
44 
45 #endif  // COMPILER_TRANSLATOR_TREEOPS_GLSL_USEINTERFACEBLOCKFIELDS_H_
46