blob: 9a34245a53c888157489a126bfc25084f906be1c [file] [log] [blame]
Zhenyao Mo4a667fe2014-02-11 12:35:01 -08001//
2// Copyright (c) 2002-2013 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
Geoff Lang0a73dd82014-11-19 16:18:08 -05007#ifndef COMPILER_TRANSLATOR_INITIALIZEVARIABLES_H_
8#define COMPILER_TRANSLATOR_INITIALIZEVARIABLES_H_
Zhenyao Mo4a667fe2014-02-11 12:35:01 -08009
Zhenyao Mo72111912016-07-20 17:45:56 -070010#include <GLSLANG/ShaderLang.h>
Zhenyao Mo4a667fe2014-02-11 12:35:01 -080011
Jamie Madill45bcc782016-11-07 13:58:48 -050012namespace sh
13{
Zhenyao Mo72111912016-07-20 17:45:56 -070014class TIntermNode;
Zhenyao Mod7490962016-11-09 15:49:51 -080015class TSymbolTable;
Zhenyao Mo4a667fe2014-02-11 12:35:01 -080016
Zhenyao Mo72111912016-07-20 17:45:56 -070017typedef std::vector<sh::ShaderVariable> InitVariableList;
Zhenyao Mo4a667fe2014-02-11 12:35:01 -080018
Zhenyao Mod7490962016-11-09 15:49:51 -080019// Currently this function is only capable of initializing variables of basic types,
20// array of basic types, or struct of basic types.
21// For now it is used for the following two scenarios:
22// 1. initializing gl_Position;
23// 2. initializing ESSL 3.00 shaders' output variables (which might be structs).
24// Specifically, it's not feasible to make it work for local variables because if their
25// types are structs, we can't look into TSymbolTable to find the TType data.
26void InitializeVariables(TIntermNode *root,
27 const InitVariableList &vars,
28 const TSymbolTable &symbolTable);
Jamie Madill45bcc782016-11-07 13:58:48 -050029} // namespace sh
Zhenyao Mo4a667fe2014-02-11 12:35:01 -080030
Geoff Lang0a73dd82014-11-19 16:18:08 -050031#endif // COMPILER_TRANSLATOR_INITIALIZEVARIABLES_H_