blob: 14f25539c3b573f4357c4b3c23ba19dd614be135 [file] [log] [blame]
Olli Etuaho3d932d82016-04-12 11:10:30 +03001//
2// Copyright (c) 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// DeferGlobalInitializers is an AST traverser that moves global initializers into a function, and
7// adds a function call to that function in the beginning of main().
8// This enables initialization of globals with uniforms or non-constant globals, as allowed by
9// the WebGL spec. Some initializers referencing non-constants may need to be unfolded into if
10// statements in HLSL - this kind of steps should be done after DeferGlobalInitializers is run.
11//
12
13#ifndef COMPILER_TRANSLATOR_DEFERGLOBALINITIALIZERS_H_
14#define COMPILER_TRANSLATOR_DEFERGLOBALINITIALIZERS_H_
15
16class TIntermNode;
17
18void DeferGlobalInitializers(TIntermNode *root);
19
20#endif // COMPILER_TRANSLATOR_DEFERGLOBALINITIALIZERS_H_