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_REWRITE_EXPRESSIONS_WITH_SHADER_STORAGE_BLOCK_H_
22#define COMPILER_TRANSLATOR_TREEOPS_REWRITE_EXPRESSIONS_WITH_SHADER_STORAGE_BLOCK_H_
23
24namespace sh
25{
26class TIntermNode;
27class TSymbolTable;
28
29void RewriteExpressionsWithShaderStorageBlock(TIntermNode *root, TSymbolTable *symbolTable);
30} // namespace sh
31
32#endif // COMPILER_TRANSLATOR_TREEOPS_REWRITE_EXPRESSIONS_WITH_SHADER_STORAGE_BLOCK_H_
33