blob: 038d38a615f9c63ead076f272862dea71abd06e1 [file] [log] [blame]
Olli Etuaho822fa842015-04-16 14:26:10 +03001//
2// Copyright (c) 2002-2015 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 an assignment.
7// Example:
8// type[n] a = initializer;
9// will effectively become
10// type[n] a;
11// a = initializer;
Olli Etuahob1edc4f2015-11-02 17:20:03 +020012//
Olli Etuaho18b9deb2015-11-05 12:14:50 +020013// Note that if the array is declared as const, the initialization may still be split, making the
14// AST technically invalid. Because of that this transformation should only be used when subsequent
15// stages don't care about const qualifiers. However, the initialization will not be split if the
16// initializer can be written as a HLSL literal.
Olli Etuaho822fa842015-04-16 14:26:10 +030017
18#ifndef COMPILER_TRANSLATOR_SEPARATEARRAYINITIALIZATION_H_
19#define COMPILER_TRANSLATOR_SEPARATEARRAYINITIALIZATION_H_
20
Jamie Madill45bcc782016-11-07 13:58:48 -050021namespace sh
22{
Olli Etuaho822fa842015-04-16 14:26:10 +030023class TIntermNode;
24
25void SeparateArrayInitialization(TIntermNode *root);
Jamie Madill45bcc782016-11-07 13:58:48 -050026} // namespace sh
Olli Etuaho822fa842015-04-16 14:26:10 +030027
28#endif // COMPILER_TRANSLATOR_SEPARATEARRAYINITIALIZATION_H_