• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2020 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 #ifndef COMPILER_TRANSLATOR_TRANSLATORMETALDIRECT_REDUCEINTERFACEBLOCKS_H_
8 #define COMPILER_TRANSLATOR_TRANSLATORMETALDIRECT_REDUCEINTERFACEBLOCKS_H_
9 
10 #include "common/angleutils.h"
11 #include "compiler/translator/Compiler.h"
12 
13 namespace sh
14 {
15 class TSymbolTable;
16 
17 // This rewrites interface block declarations only.
18 //
19 // Access of interface blocks is not rewritten (e.g. TOperator::EOpIndexDirectInterfaceBlock). //
20 // XXX: ^ Still true?
21 //
22 // Example:
23 //  uniform Foo { int x; };
24 // Becomes:
25 //  uniform int x;
26 //
27 // Example:
28 //  uniform Foo { int x; } foo;
29 // Becomes:
30 //  struct Foo { int x; }; uniform Foo x;
31 //
32 
33 ANGLE_NO_DISCARD bool ReduceInterfaceBlocks(TCompiler &compiler,
34                                             TIntermBlock &root,
35                                             IdGen &idGen,
36                                             TSymbolTable *symbolTable);
37 
38 }  // namespace sh
39 
40 #endif  // COMPILER_TRANSLATOR_TRANSLATORMETALDIRECT_REDUCEINTERFACEBLOCKS_H_
41