diff options
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/RewriteElseBlocks.h')
-rw-r--r-- | src/3rdparty/angle/src/compiler/translator/RewriteElseBlocks.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/RewriteElseBlocks.h b/src/3rdparty/angle/src/compiler/translator/RewriteElseBlocks.h new file mode 100644 index 0000000000..10221335ce --- /dev/null +++ b/src/3rdparty/angle/src/compiler/translator/RewriteElseBlocks.h @@ -0,0 +1,39 @@ +// +// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// RewriteElseBlocks.h: Prototype for tree transform to change +// all if-else blocks to if-if blocks. +// + +#ifndef COMPILER_REWRITE_ELSE_BLOCKS_H_ +#define COMPILER_REWRITE_ELSE_BLOCKS_H_ + +#include "compiler/translator/intermediate.h" + +namespace sh +{ + +class ElseBlockRewriter : public TIntermTraverser +{ + public: + ElseBlockRewriter() + : TIntermTraverser(false, false, true, false) + , mTemporaryIndex(0) + {} + + protected: + bool visitAggregate(Visit visit, TIntermAggregate *aggregate); + + private: + int mTemporaryIndex; + + TIntermNode *rewriteSelection(TIntermSelection *selection); +}; + +void RewriteElseBlocks(TIntermNode *node); + +} + +#endif // COMPILER_REWRITE_ELSE_BLOCKS_H_ |