xref: /aosp_15_r20/external/angle/src/compiler/translator/tree_ops/EmulateMultiDrawShaderBuiltins.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
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 [[nodiscard]] bool EmulateGLDrawID(TCompiler *compiler,
33                                    TIntermBlock *root,
34                                    TSymbolTable *symbolTable,
35                                    std::vector<sh::ShaderVariable> *uniforms);
36 
37 [[nodiscard]] bool EmulateGLBaseVertexBaseInstance(TCompiler *compiler,
38                                                    TIntermBlock *root,
39                                                    TSymbolTable *symbolTable,
40                                                    std::vector<sh::ShaderVariable> *uniforms,
41                                                    bool addBaseVertexToVertexID);
42 
43 }  // namespace sh
44 
45 #endif  // COMPILER_TRANSLATOR_TREEOPS_EMULATEMULTIDRAWSHADERBUILTINS_H_
46