1 //
2 // Copyright 2019 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 // EmulateGLDrawID is an AST traverser to convert the gl_DrawID builtin
7 // to a uniform int
8 //
9 // EmulateGLBaseVertexBaseInstance is an AST traverser to convert the gl_BaseVertex and
10 // gl_BaseInstance builtin to uniform ints
11 //
12 // EmulateGLBaseInstance is an AST traverser to convert the gl_BaseInstance builtin
13 // to a uniform int
14 //
15 
16 #ifndef COMPILER_TRANSLATOR_TREEOPS_EMULATEMULTIDRAWSHADERBUILTINS_H_
17 #define COMPILER_TRANSLATOR_TREEOPS_EMULATEMULTIDRAWSHADERBUILTINS_H_
18 
19 #include <GLSLANG/ShaderLang.h>
20 #include <vector>
21 
22 #include "common/angleutils.h"
23 #include "compiler/translator/HashNames.h"
24 
25 namespace sh
26 {
27 struct ShaderVariable;
28 class TCompiler;
29 class TIntermBlock;
30 class TSymbolTable;
31 
32 ANGLE_NO_DISCARD bool EmulateGLDrawID(TCompiler *compiler,
33                                       TIntermBlock *root,
34                                       TSymbolTable *symbolTable,
35                                       std::vector<sh::ShaderVariable> *uniforms,
36                                       bool shouldCollect);
37 
38 ANGLE_NO_DISCARD bool EmulateGLBaseVertexBaseInstance(TCompiler *compiler,
39                                                       TIntermBlock *root,
40                                                       TSymbolTable *symbolTable,
41                                                       std::vector<sh::ShaderVariable> *uniforms,
42                                                       bool shouldCollect,
43                                                       bool addBaseVertexToVertexID);
44 
45 }  // namespace sh
46 
47 #endif  // COMPILER_TRANSLATOR_TREEOPS_EMULATEMULTIDRAWSHADERBUILTINS_H_
48