1 //
2 // Copyright 2021 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 // MonomorphizeUnsupportedFunctionsInVulkanGLSL: Monomorphize functions that are called with
7 // parameters that are not compatible with Vulkan GLSL:
8 //
9 // - Samplers in structs
10 // - Structs that have samplers
11 // - Partially subscripted array of array of samplers
12 // - Partially subscripted array of array of images
13 // - Atomic counters
14 // - samplerCube variables when emulating ES2's cube map sampling
15 // - image* variables with r32f formats (to emulate imageAtomicExchange)
16 //
17 // This transformation basically duplicates such functions, removes the
18 // sampler/image/atomic_counter parameters and uses the opaque uniforms used by the caller.
19 
20 #ifndef COMPILER_TRANSLATOR_TREEOPS_VULKAN_MONOMORPHIZEUNSUPPORTEDFUNCTIONSINVULKANGLSL_H_
21 #define COMPILER_TRANSLATOR_TREEOPS_VULKAN_MONOMORPHIZEUNSUPPORTEDFUNCTIONSINVULKANGLSL_H_
22 
23 #include "common/angleutils.h"
24 #include "compiler/translator/Compiler.h"
25 
26 namespace sh
27 {
28 class TIntermBlock;
29 class TSymbolTable;
30 
31 ANGLE_NO_DISCARD bool MonomorphizeUnsupportedFunctionsInVulkanGLSL(TCompiler *compiler,
32                                                                    TIntermBlock *root,
33                                                                    TSymbolTable *symbolTable,
34                                                                    ShCompileOptions compileOptions);
35 }  // namespace sh
36 
37 #endif  // COMPILER_TRANSLATOR_TREEOPS_VULKAN_MONOMORPHIZEUNSUPPORTEDFUNCTIONSINVULKANGLSL_H_
38