xref: /aosp_15_r20/external/angle/src/compiler/translator/tree_ops/spirv/FlagSamplersWithTexelFetch.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2020 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 // FlagSamplersForTexelFetch.h: finds all instances of texelFetch used with a static reference to a
7 // sampler uniform, and flag that uniform as having been used with texelFetch
8 //
9 
10 #ifndef COMPILER_TRANSLATOR_TREEOPS_SPIRV_FLAGSAMPLERSWITHTEXELFETCH_H_
11 #define COMPILER_TRANSLATOR_TREEOPS_SPIRV_FLAGSAMPLERSWITHTEXELFETCH_H_
12 
13 #include "GLSLANG/ShaderVars.h"
14 #include "common/angleutils.h"
15 
16 namespace sh
17 {
18 class TCompiler;
19 class TIntermBlock;
20 class TSymbolTable;
21 
22 // This flags all samplers which are statically accessed by a texelFetch invokation- that is, the
23 // sampler is used as a direct argument to the call to texelFetch. Dynamic accesses, or accesses
24 // with any amount of indirection, are not counted.
25 [[nodiscard]] bool FlagSamplersForTexelFetch(TCompiler *compiler,
26                                              TIntermBlock *root,
27                                              TSymbolTable *symbolTable,
28                                              std::vector<sh::ShaderVariable> *uniforms);
29 }  // namespace sh
30 
31 #endif  // COMPILER_TRANSLATOR_TREEOPS_SPIRV_FLAGSAMPLERSWITHTEXELFETCH_H_
32