xref: /aosp_15_r20/external/angle/src/compiler/translator/tree_ops/RemoveInactiveInterfaceVariables.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 // RemoveInactiveInterfaceVariables.h:
7 //  Drop shader interface variable declarations for those that are inactive.  This step needs to be
8 //  done after CollectVariables.  This avoids having to emulate them (e.g. atomic counters for
9 //  Vulkan) or remove them in glslang wrapper (again, for Vulkan).
10 //
11 //  Shouldn't be run for the GL backend, as it queries shader interface variables from GL itself,
12 //  instead of relying on what was gathered during CollectVariables.
13 //
14 
15 #ifndef COMPILER_TRANSLATOR_TREEOPS_REMOVEINACTIVEVARIABLES_H_
16 #define COMPILER_TRANSLATOR_TREEOPS_REMOVEINACTIVEVARIABLES_H_
17 
18 #include "common/angleutils.h"
19 
20 namespace sh
21 {
22 
23 struct InterfaceBlock;
24 struct ShaderVariable;
25 class TCompiler;
26 class TIntermBlock;
27 class TSymbolTable;
28 
29 [[nodiscard]] bool RemoveInactiveInterfaceVariables(
30     TCompiler *compiler,
31     TIntermBlock *root,
32     TSymbolTable *symbolTable,
33     const std::vector<sh::ShaderVariable> &attributes,
34     const std::vector<sh::ShaderVariable> &inputVaryings,
35     const std::vector<sh::ShaderVariable> &outputVariables,
36     const std::vector<sh::ShaderVariable> &uniforms,
37     const std::vector<sh::InterfaceBlock> &interfaceBlocks,
38     bool removeFragmentOutputs);
39 
40 }  // namespace sh
41 
42 #endif  // COMPILER_TRANSLATOR_TREEOPS_REMOVEINACTIVEVARIABLES_H_
43