Zhenyao Mo | 4a667fe | 2014-02-11 12:35:01 -0800 | [diff] [blame] | 1 | // |
| 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 Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 7 | #ifndef COMPILER_TRANSLATOR_INITIALIZEVARIABLES_H_ |
| 8 | #define COMPILER_TRANSLATOR_INITIALIZEVARIABLES_H_ |
Zhenyao Mo | 4a667fe | 2014-02-11 12:35:01 -0800 | [diff] [blame] | 9 | |
Zhenyao Mo | 7211191 | 2016-07-20 17:45:56 -0700 | [diff] [blame] | 10 | #include <GLSLANG/ShaderLang.h> |
Zhenyao Mo | 4a667fe | 2014-02-11 12:35:01 -0800 | [diff] [blame] | 11 | |
Jamie Madill | 45bcc78 | 2016-11-07 13:58:48 -0500 | [diff] [blame] | 12 | namespace sh |
| 13 | { |
Zhenyao Mo | 7211191 | 2016-07-20 17:45:56 -0700 | [diff] [blame] | 14 | class TIntermNode; |
Zhenyao Mo | d749096 | 2016-11-09 15:49:51 -0800 | [diff] [blame] | 15 | class TSymbolTable; |
Zhenyao Mo | 4a667fe | 2014-02-11 12:35:01 -0800 | [diff] [blame] | 16 | |
Zhenyao Mo | 7211191 | 2016-07-20 17:45:56 -0700 | [diff] [blame] | 17 | typedef std::vector<sh::ShaderVariable> InitVariableList; |
Zhenyao Mo | 4a667fe | 2014-02-11 12:35:01 -0800 | [diff] [blame] | 18 | |
Zhenyao Mo | d749096 | 2016-11-09 15:49:51 -0800 | [diff] [blame] | 19 | // 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. |
| 26 | void InitializeVariables(TIntermNode *root, |
| 27 | const InitVariableList &vars, |
| 28 | const TSymbolTable &symbolTable); |
Jamie Madill | 45bcc78 | 2016-11-07 13:58:48 -0500 | [diff] [blame] | 29 | } // namespace sh |
Zhenyao Mo | 4a667fe | 2014-02-11 12:35:01 -0800 | [diff] [blame] | 30 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 31 | #endif // COMPILER_TRANSLATOR_INITIALIZEVARIABLES_H_ |