2 // Copyright (c) 2014 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.
7 // Methods for GL variable types (varyings, uniforms, etc)
10 #include <GLSLANG/ShaderLang.h>
15 ShaderVariable::ShaderVariable()
22 ShaderVariable::ShaderVariable(GLenum typeIn, unsigned int arraySizeIn)
25 arraySize(arraySizeIn),
29 ShaderVariable::~ShaderVariable()
32 ShaderVariable::ShaderVariable(const ShaderVariable &other)
34 precision(other.precision),
36 mappedName(other.mappedName),
37 arraySize(other.arraySize),
38 staticUse(other.staticUse)
41 ShaderVariable &ShaderVariable::operator=(const ShaderVariable &other)
44 precision = other.precision;
46 mappedName = other.mappedName;
47 arraySize = other.arraySize;
48 staticUse = other.staticUse;
58 Uniform::Uniform(const Uniform &other)
59 : ShaderVariable(other),
63 Uniform &Uniform::operator=(const Uniform &other)
65 ShaderVariable::operator=(other);
66 fields = other.fields;
70 Attribute::Attribute()
74 Attribute::~Attribute()
77 Attribute::Attribute(const Attribute &other)
78 : ShaderVariable(other),
79 location(other.location)
82 Attribute &Attribute::operator=(const Attribute &other)
84 ShaderVariable::operator=(other);
85 location = other.location;
89 InterfaceBlockField::InterfaceBlockField()
90 : isRowMajorMatrix(false)
93 InterfaceBlockField::~InterfaceBlockField()
96 InterfaceBlockField::InterfaceBlockField(const InterfaceBlockField &other)
97 : ShaderVariable(other),
98 isRowMajorMatrix(other.isRowMajorMatrix),
102 InterfaceBlockField &InterfaceBlockField::operator=(const InterfaceBlockField &other)
104 ShaderVariable::operator=(other);
105 isRowMajorMatrix = other.isRowMajorMatrix;
106 fields = other.fields;
111 : interpolation(INTERPOLATION_SMOOTH)
117 Varying::Varying(const Varying &other)
118 : ShaderVariable(other),
119 interpolation(other.interpolation),
120 fields(other.fields),
121 structName(other.structName)
124 Varying &Varying::operator=(const Varying &other)
126 ShaderVariable::operator=(other);
127 interpolation = other.interpolation;
128 fields = other.fields;
129 structName = other.structName;
133 InterfaceBlock::InterfaceBlock()
135 layout(BLOCKLAYOUT_PACKED),
136 isRowMajorLayout(false),
140 InterfaceBlock::~InterfaceBlock()
143 InterfaceBlock::InterfaceBlock(const InterfaceBlock &other)
145 mappedName(other.mappedName),
146 arraySize(other.arraySize),
147 layout(other.layout),
148 isRowMajorLayout(other.isRowMajorLayout),
149 staticUse(other.staticUse),
153 InterfaceBlock &InterfaceBlock::operator=(const InterfaceBlock &other)
156 mappedName = other.mappedName;
157 arraySize = other.arraySize;
158 layout = other.layout;
159 isRowMajorLayout = other.isRowMajorLayout;
160 staticUse = other.staticUse;
161 fields = other.fields;