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_TREEOPS_MSL_REDUCEINTERFACEBLOCKS_H_ 8 #define COMPILER_TRANSLATOR_TREEOPS_MSL_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 [[nodiscard]] bool ReduceInterfaceBlocks(TCompiler &compiler, TIntermBlock &root, IdGen &idGen); 34 35 } // namespace sh 36 37 #endif // COMPILER_TRANSLATOR_TREEOPS_MSL_REDUCEINTERFACEBLOCKS_H_ 38