• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2002 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 // The SeparateArrayInitialization function splits each array initialization into a declaration and
7 // an assignment.
8 // Example:
9 //     type[n] a = initializer;
10 // will effectively become
11 //     type[n] a;
12 //     a = initializer;
13 //
14 // Note that if the array is declared as const, the initialization may still be split, making the
15 // AST technically invalid. Because of that this transformation should only be used when subsequent
16 // stages don't care about const qualifiers. However, the initialization will not be split if the
17 // initializer can be written as a HLSL literal.
18 
19 #ifndef COMPILER_TRANSLATOR_TREEOPS_SEPARATEARRAYINITIALIZATION_H_
20 #define COMPILER_TRANSLATOR_TREEOPS_SEPARATEARRAYINITIALIZATION_H_
21 
22 #include "common/angleutils.h"
23 
24 namespace sh
25 {
26 class TCompiler;
27 class TIntermNode;
28 
29 ANGLE_NO_DISCARD bool SeparateArrayInitialization(TCompiler *compiler, TIntermNode *root);
30 }  // namespace sh
31 
32 #endif  // COMPILER_TRANSLATOR_TREEOPS_SEPARATEARRAYINITIALIZATION_H_
33