~gabriel1984sibiu/minitube/qt5.6

« back to all changes in this revision

Viewing changes to src/3rdparty/angle/src/compiler/translator/VariableInfo.h

  • Committer: Grevutiu Gabriel
  • Date: 2017-06-13 08:43:17 UTC
  • Revision ID: gabriel1984sibiu@gmail.com-20170613084317-ek0zqe0u9g3ocvi8
OriginalĀ upstreamĀ code

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// Copyright (c) 2002-2011 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
 
 
7
#ifndef COMPILER_TRANSLATOR_VARIABLEINFO_H_
 
8
#define COMPILER_TRANSLATOR_VARIABLEINFO_H_
 
9
 
 
10
#include <GLSLANG/ShaderLang.h>
 
11
 
 
12
#include "compiler/translator/IntermNode.h"
 
13
 
 
14
class TSymbolTable;
 
15
 
 
16
namespace sh
 
17
{
 
18
 
 
19
// Traverses intermediate tree to collect all attributes, uniforms, varyings.
 
20
class CollectVariables : public TIntermTraverser
 
21
{
 
22
  public:
 
23
    CollectVariables(std::vector<Attribute> *attribs,
 
24
                     std::vector<OutputVariable> *outputVariables,
 
25
                     std::vector<Uniform> *uniforms,
 
26
                     std::vector<Varying> *varyings,
 
27
                     std::vector<InterfaceBlock> *interfaceBlocks,
 
28
                     ShHashFunction64 hashFunction,
 
29
                     const TSymbolTable &symbolTable);
 
30
 
 
31
    void visitSymbol(TIntermSymbol *symbol) override;
 
32
    bool visitAggregate(Visit, TIntermAggregate *node) override;
 
33
    bool visitBinary(Visit visit, TIntermBinary *binaryNode) override;
 
34
 
 
35
  private:
 
36
    template <typename VarT>
 
37
    void visitVariable(const TIntermSymbol *variable, std::vector<VarT> *infoList) const;
 
38
 
 
39
    template <typename VarT>
 
40
    void visitInfoList(const TIntermSequence &sequence, std::vector<VarT> *infoList) const;
 
41
 
 
42
    std::vector<Attribute> *mAttribs;
 
43
    std::vector<OutputVariable> *mOutputVariables;
 
44
    std::vector<Uniform> *mUniforms;
 
45
    std::vector<Varying> *mVaryings;
 
46
    std::vector<InterfaceBlock> *mInterfaceBlocks;
 
47
 
 
48
    std::map<std::string, InterfaceBlockField *> mInterfaceBlockFields;
 
49
 
 
50
    bool mDepthRangeAdded;
 
51
    bool mPointCoordAdded;
 
52
    bool mFrontFacingAdded;
 
53
    bool mFragCoordAdded;
 
54
 
 
55
    bool mInstanceIDAdded;
 
56
    bool mPositionAdded;
 
57
    bool mPointSizeAdded;
 
58
    bool mLastFragDataAdded;
 
59
    bool mFragColorAdded;
 
60
    bool mFragDataAdded;
 
61
    bool mFragDepthEXTAdded;
 
62
    bool mFragDepthAdded;
 
63
    bool mSecondaryFragColorEXTAdded;
 
64
    bool mSecondaryFragDataEXTAdded;
 
65
 
 
66
    ShHashFunction64 mHashFunction;
 
67
 
 
68
    const TSymbolTable &mSymbolTable;
 
69
};
 
70
 
 
71
// Expand struct uniforms to flattened lists of split variables
 
72
void ExpandUniforms(const std::vector<Uniform> &compact,
 
73
                    std::vector<ShaderVariable> *expanded);
 
74
 
 
75
}
 
76
 
 
77
#endif  // COMPILER_TRANSLATOR_VARIABLEINFO_H_