• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 namespace sh
17 {
18 
19 class TCompiler;
20 class TIntermBlock;
21 class TSymbolTable;
22 class DriverUniform;
23 struct ShaderVariable;
24 class AdvancedBlendEquations;
25 
26 // Declares the necessary input attachment (if not already for framebuffer fetch), loads from it and
27 // implements the specified advanced blend equation functions.  A driver uniform is used to select
28 // which function to use at runtime.
29 [[nodiscard]] bool EmulateAdvancedBlendEquations(
30     TCompiler *compiler,
31     TIntermBlock *root,
32     TSymbolTable *symbolTable,
33     const DriverUniform *driverUniforms,
34     std::vector<ShaderVariable> *uniforms,
35     const AdvancedBlendEquations &advancedBlendEquations);
36 
37 }  // namespace sh
38 
39 #endif  // COMPILER_TRANSLATOR_TREEOPS_SPIRV_EMULATEADVANCEDBLENDEQUATIONS_H_
40