blob: 85e55d9c609c3ddac33af2660d36f348a2d63467 [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
Olli Etuaho6d40bbd2016-09-30 13:49:38 +010016class TIntermBlock;
Olli Etuaho3d932d82016-04-12 11:10:30 +030017
Olli Etuaho6d40bbd2016-09-30 13:49:38 +010018void DeferGlobalInitializers(TIntermBlock *root);
Olli Etuaho3d932d82016-04-12 11:10:30 +030019
20#endif // COMPILER_TRANSLATOR_DEFERGLOBALINITIALIZERS_H_