xref: /aosp_15_r20/external/angle/src/compiler/translator/tree_ops/spirv/EmulateAdvancedBlendEquations.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2022 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 // EmulateAdvancedBlendEquations.h: Emulate advanced blend equations by implicitly reading back from
7 // the color attachment (as an input attachment) and apply the equation function based on a uniform.
8 //
9 
10 #ifndef COMPILER_TRANSLATOR_TREEOPS_SPIRV_EMULATEADVANCEDBLENDEQUATIONS_H_
11 #define COMPILER_TRANSLATOR_TREEOPS_SPIRV_EMULATEADVANCEDBLENDEQUATIONS_H_
12 
13 #include "common/angleutils.h"
14 #include "compiler/translator/Compiler.h"
15 #include "compiler/translator/tree_ops/spirv/EmulateFramebufferFetch.h"
16 
17 namespace sh
18 {
19 
20 class TIntermBlock;
21 class TSymbolTable;
22 class DriverUniform;
23 class AdvancedBlendEquations;
24 
25 // Declares the necessary input attachment (if not already for framebuffer fetch), loads from it and
26 // implements the specified advanced blend equation functions.  A driver uniform is used to select
27 // which function to use at runtime.
28 [[nodiscard]] bool EmulateAdvancedBlendEquations(
29     TCompiler *compiler,
30     TIntermBlock *root,
31     TSymbolTable *symbolTable,
32     const AdvancedBlendEquations &advancedBlendEquations,
33     const DriverUniform *driverUniforms,
34     InputAttachmentMap *inputAttachmentMapOut);
35 
36 }  // namespace sh
37 
38 #endif  // COMPILER_TRANSLATOR_TREEOPS_SPIRV_EMULATEADVANCEDBLENDEQUATIONS_H_
39