Jamie Madill | 570e04d | 2013-06-21 09:15:33 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2013 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 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 7 | #ifndef COMPILER_TRANSLATOR_FLAGSTD140STRUCTS_H_ |
| 8 | #define COMPILER_TRANSLATOR_FLAGSTD140STRUCTS_H_ |
Jamie Madill | 570e04d | 2013-06-21 09:15:33 -0400 | [diff] [blame] | 9 | |
Jamie Madill | b1a85f4 | 2014-08-19 15:23:24 -0400 | [diff] [blame] | 10 | #include "compiler/translator/IntermNode.h" |
Jamie Madill | 570e04d | 2013-06-21 09:15:33 -0400 | [diff] [blame] | 11 | |
| 12 | namespace sh |
| 13 | { |
| 14 | |
| 15 | // This class finds references to nested structs of std140 blocks that access |
| 16 | // the nested struct "by value", where the padding added in the translator |
| 17 | // conflicts with the "natural" unpadded type. |
| 18 | class FlagStd140Structs : public TIntermTraverser |
| 19 | { |
| 20 | public: |
| 21 | const std::vector<TIntermTyped *> getFlaggedNodes() const { return mFlaggedNodes; } |
| 22 | |
| 23 | protected: |
| 24 | virtual bool visitBinary(Visit visit, TIntermBinary *binaryNode); |
| 25 | virtual void visitSymbol(TIntermSymbol *symbol); |
| 26 | |
| 27 | private: |
| 28 | bool isInStd140InterfaceBlock(TIntermTyped *node) const; |
| 29 | |
| 30 | std::vector<TIntermTyped *> mFlaggedNodes; |
| 31 | }; |
| 32 | |
| 33 | std::vector<TIntermTyped *> FlagStd140ValueStructs(TIntermNode *node); |
| 34 | |
| 35 | } |
| 36 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 37 | #endif // COMPILER_TRANSLATOR_FLAGSTD140STRUCTS_H_ |