• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2018 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 // RewriteExpressionsWithShaderStorageBlock rewrites the expressions that contain shader storage
7 // block calls into several simple ones that can be easily handled in the HLSL translator. After the
8 // AST pass, all ssbo related blocks will be like below:
9 //     ssbo_access_chain = ssbo_access_chain;
10 //     ssbo_access_chain = expr_no_ssbo;
11 //     lvalue_no_ssbo    = ssbo_access_chain;
12 //
13 // Below situations are needed to be rewritten (Details can be found in .cpp file).
14 //     SSBO as the operand of compound assignment operators.
15 //     SSBO as the operand of ++/--.
16 //     SSBO as the operand of repeated assignment.
17 //     SSBO as the operand of readonly unary/binary/ternary operators.
18 //     SSBO as the argument of aggregate type.
19 //     SSBO as the condition of if/switch/while/do-while/for
20 
21 #ifndef COMPILER_TRANSLATOR_TREEOPS_D3D_REWRITE_EXPRESSIONS_WITH_SHADER_STORAGE_BLOCK_H_
22 #define COMPILER_TRANSLATOR_TREEOPS_D3D_REWRITE_EXPRESSIONS_WITH_SHADER_STORAGE_BLOCK_H_
23 
24 #include "common/angleutils.h"
25 
26 namespace sh
27 {
28 class TCompiler;
29 class TIntermNode;
30 class TSymbolTable;
31 
32 ANGLE_NO_DISCARD bool RewriteExpressionsWithShaderStorageBlock(TCompiler *compiler,
33                                                                TIntermNode *root,
34                                                                TSymbolTable *symbolTable);
35 }  // namespace sh
36 
37 #endif  // COMPILER_TRANSLATOR_TREEOPS_D3D_REWRITE_EXPRESSIONS_WITH_SHADER_STORAGE_BLOCK_H_
38