OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkSLType.h" | 8 #include "SkSLType.h" |
9 | 9 |
10 namespace SkSL { | 10 namespace SkSL { |
11 | 11 |
12 bool Type::determineCoercionCost(std::shared_ptr<Type> other, int* outCost) cons
t { | 12 bool Type::determineCoercionCost(const Type& other, int* outCost) const { |
13 if (this == other.get()) { | 13 if (*this == other) { |
14 *outCost = 0; | 14 *outCost = 0; |
15 return true; | 15 return true; |
16 } | 16 } |
17 if (this->kind() == kVector_Kind && other->kind() == kVector_Kind) { | 17 if (this->kind() == kVector_Kind && other.kind() == kVector_Kind) { |
18 if (this->columns() == other->columns()) { | 18 if (this->columns() == other.columns()) { |
19 return this->componentType()->determineCoercionCost(other->component
Type(), outCost); | 19 return this->componentType().determineCoercionCost(other.componentTy
pe(), outCost); |
20 } | 20 } |
21 return false; | 21 return false; |
22 } | 22 } |
23 if (this->kind() == kMatrix_Kind) { | 23 if (this->kind() == kMatrix_Kind) { |
24 if (this->columns() == other->columns() && | 24 if (this->columns() == other.columns() && |
25 this->rows() == other->rows()) { | 25 this->rows() == other.rows()) { |
26 return this->componentType()->determineCoercionCost(other->component
Type(), outCost); | 26 return this->componentType().determineCoercionCost(other.componentTy
pe(), outCost); |
27 } | 27 } |
28 return false; | 28 return false; |
29 } | 29 } |
30 for (size_t i = 0; i < fCoercibleTypes.size(); i++) { | 30 for (size_t i = 0; i < fCoercibleTypes.size(); i++) { |
31 if (fCoercibleTypes[i] == other) { | 31 if (*fCoercibleTypes[i] == other) { |
32 *outCost = (int) i + 1; | 32 *outCost = (int) i + 1; |
33 return true; | 33 return true; |
34 } | 34 } |
35 } | 35 } |
36 return false; | 36 return false; |
37 } | 37 } |
38 | 38 |
39 std::shared_ptr<Type> Type::toCompound(int columns, int rows) { | 39 const Type& Type::toCompound(int columns, int rows) const { |
40 ASSERT(this->kind() == Type::kScalar_Kind); | 40 ASSERT(this->kind() == Type::kScalar_Kind); |
41 if (columns == 1 && rows == 1) { | 41 if (columns == 1 && rows == 1) { |
42 return std::shared_ptr<Type>(this); | 42 return *this; |
43 } | 43 } |
44 if (*this == *kFloat_Type) { | 44 if (*this == kFloat_Type) { |
45 switch (rows) { | 45 switch (rows) { |
46 case 1: | 46 case 1: |
47 switch (columns) { | 47 switch (columns) { |
48 case 2: return kVec2_Type; | 48 case 2: return kVec2_Type; |
49 case 3: return kVec3_Type; | 49 case 3: return kVec3_Type; |
50 case 4: return kVec4_Type; | 50 case 4: return kVec4_Type; |
51 default: ABORT("unsupported vector column count (%d)", colum
ns); | 51 default: ABORT("unsupported vector column count (%d)", colum
ns); |
52 } | 52 } |
53 case 2: | 53 case 2: |
54 switch (columns) { | 54 switch (columns) { |
(...skipping 11 matching lines...) Expand all Loading... |
66 } | 66 } |
67 case 4: | 67 case 4: |
68 switch (columns) { | 68 switch (columns) { |
69 case 2: return kMat2x4_Type; | 69 case 2: return kMat2x4_Type; |
70 case 3: return kMat3x4_Type; | 70 case 3: return kMat3x4_Type; |
71 case 4: return kMat4x4_Type; | 71 case 4: return kMat4x4_Type; |
72 default: ABORT("unsupported matrix column count (%d)", colum
ns); | 72 default: ABORT("unsupported matrix column count (%d)", colum
ns); |
73 } | 73 } |
74 default: ABORT("unsupported row count (%d)", rows); | 74 default: ABORT("unsupported row count (%d)", rows); |
75 } | 75 } |
76 } else if (*this == *kDouble_Type) { | 76 } else if (*this == kDouble_Type) { |
77 switch (rows) { | 77 switch (rows) { |
78 case 1: | 78 case 1: |
79 switch (columns) { | 79 switch (columns) { |
80 case 2: return kDVec2_Type; | 80 case 2: return kDVec2_Type; |
81 case 3: return kDVec3_Type; | 81 case 3: return kDVec3_Type; |
82 case 4: return kDVec4_Type; | 82 case 4: return kDVec4_Type; |
83 default: ABORT("unsupported vector column count (%d)", colum
ns); | 83 default: ABORT("unsupported vector column count (%d)", colum
ns); |
84 } | 84 } |
85 case 2: | 85 case 2: |
86 switch (columns) { | 86 switch (columns) { |
(...skipping 11 matching lines...) Expand all Loading... |
98 } | 98 } |
99 case 4: | 99 case 4: |
100 switch (columns) { | 100 switch (columns) { |
101 case 2: return kDMat2x4_Type; | 101 case 2: return kDMat2x4_Type; |
102 case 3: return kDMat3x4_Type; | 102 case 3: return kDMat3x4_Type; |
103 case 4: return kDMat4x4_Type; | 103 case 4: return kDMat4x4_Type; |
104 default: ABORT("unsupported matrix column count (%d)", colum
ns); | 104 default: ABORT("unsupported matrix column count (%d)", colum
ns); |
105 } | 105 } |
106 default: ABORT("unsupported row count (%d)", rows); | 106 default: ABORT("unsupported row count (%d)", rows); |
107 } | 107 } |
108 } else if (*this == *kInt_Type) { | 108 } else if (*this == kInt_Type) { |
109 switch (rows) { | 109 switch (rows) { |
110 case 1: | 110 case 1: |
111 switch (columns) { | 111 switch (columns) { |
112 case 2: return kIVec2_Type; | 112 case 2: return kIVec2_Type; |
113 case 3: return kIVec3_Type; | 113 case 3: return kIVec3_Type; |
114 case 4: return kIVec4_Type; | 114 case 4: return kIVec4_Type; |
115 default: ABORT("unsupported vector column count (%d)", colum
ns); | 115 default: ABORT("unsupported vector column count (%d)", colum
ns); |
116 } | 116 } |
117 default: ABORT("unsupported row count (%d)", rows); | 117 default: ABORT("unsupported row count (%d)", rows); |
118 } | 118 } |
119 } else if (*this == *kUInt_Type) { | 119 } else if (*this == kUInt_Type) { |
120 switch (rows) { | 120 switch (rows) { |
121 case 1: | 121 case 1: |
122 switch (columns) { | 122 switch (columns) { |
123 case 2: return kUVec2_Type; | 123 case 2: return kUVec2_Type; |
124 case 3: return kUVec3_Type; | 124 case 3: return kUVec3_Type; |
125 case 4: return kUVec4_Type; | 125 case 4: return kUVec4_Type; |
126 default: ABORT("unsupported vector column count (%d)", colum
ns); | 126 default: ABORT("unsupported vector column count (%d)", colum
ns); |
127 } | 127 } |
128 default: ABORT("unsupported row count (%d)", rows); | 128 default: ABORT("unsupported row count (%d)", rows); |
129 } | 129 } |
130 } | 130 } |
131 ABORT("unsupported scalar_to_compound type %s", this->description().c_str())
; | 131 ABORT("unsupported scalar_to_compound type %s", this->description().c_str())
; |
132 } | 132 } |
133 | 133 |
134 const std::shared_ptr<Type> kVoid_Type(new Type("void")); | 134 const Type kVoid_Type("void"); |
135 | 135 |
136 const std::shared_ptr<Type> kDouble_Type(new Type("double", true)); | 136 const Type kDouble_Type("double", true); |
137 const std::shared_ptr<Type> kDVec2_Type(new Type("dvec2", kDouble_Type, 2)); | 137 const Type kDVec2_Type("dvec2", kDouble_Type, 2); |
138 const std::shared_ptr<Type> kDVec3_Type(new Type("dvec3", kDouble_Type, 3)); | 138 const Type kDVec3_Type("dvec3", kDouble_Type, 3); |
139 const std::shared_ptr<Type> kDVec4_Type(new Type("dvec4", kDouble_Type, 4)); | 139 const Type kDVec4_Type("dvec4", kDouble_Type, 4); |
140 | 140 |
141 const std::shared_ptr<Type> kFloat_Type(new Type("float", true, { kDouble_Type }
)); | 141 const Type kFloat_Type("float", true, { &kDouble_Type }); |
142 const std::shared_ptr<Type> kVec2_Type(new Type("vec2", kFloat_Type, 2)); | 142 const Type kVec2_Type("vec2", kFloat_Type, 2); |
143 const std::shared_ptr<Type> kVec3_Type(new Type("vec3", kFloat_Type, 3)); | 143 const Type kVec3_Type("vec3", kFloat_Type, 3); |
144 const std::shared_ptr<Type> kVec4_Type(new Type("vec4", kFloat_Type, 4)); | 144 const Type kVec4_Type("vec4", kFloat_Type, 4); |
145 | 145 |
146 const std::shared_ptr<Type> kUInt_Type(new Type("uint", true, { kFloat_Type, kDo
uble_Type })); | 146 const Type kUInt_Type("uint", true, { &kFloat_Type, &kDouble_Type }); |
147 const std::shared_ptr<Type> kUVec2_Type(new Type("uvec2", kUInt_Type, 2)); | 147 const Type kUVec2_Type("uvec2", kUInt_Type, 2); |
148 const std::shared_ptr<Type> kUVec3_Type(new Type("uvec3", kUInt_Type, 3)); | 148 const Type kUVec3_Type("uvec3", kUInt_Type, 3); |
149 const std::shared_ptr<Type> kUVec4_Type(new Type("uvec4", kUInt_Type, 4)); | 149 const Type kUVec4_Type("uvec4", kUInt_Type, 4); |
150 | 150 |
151 const std::shared_ptr<Type> kInt_Type(new Type("int", true, { kUInt_Type, kFloat
_Type, | 151 const Type kInt_Type("int", true, { &kUInt_Type, &kFloat_Type, &kDouble_Type }); |
152 kDouble_Type })); | 152 const Type kIVec2_Type("ivec2", kInt_Type, 2); |
153 const std::shared_ptr<Type> kIVec2_Type(new Type("ivec2", kInt_Type, 2)); | 153 const Type kIVec3_Type("ivec3", kInt_Type, 3); |
154 const std::shared_ptr<Type> kIVec3_Type(new Type("ivec3", kInt_Type, 3)); | 154 const Type kIVec4_Type("ivec4", kInt_Type, 4); |
155 const std::shared_ptr<Type> kIVec4_Type(new Type("ivec4", kInt_Type, 4)); | |
156 | 155 |
157 const std::shared_ptr<Type> kBool_Type(new Type("bool", false)); | 156 const Type kBool_Type("bool", false); |
158 const std::shared_ptr<Type> kBVec2_Type(new Type("bvec2", kBool_Type, 2)); | 157 const Type kBVec2_Type("bvec2", kBool_Type, 2); |
159 const std::shared_ptr<Type> kBVec3_Type(new Type("bvec3", kBool_Type, 3)); | 158 const Type kBVec3_Type("bvec3", kBool_Type, 3); |
160 const std::shared_ptr<Type> kBVec4_Type(new Type("bvec4", kBool_Type, 4)); | 159 const Type kBVec4_Type("bvec4", kBool_Type, 4); |
161 | 160 |
162 const std::shared_ptr<Type> kMat2x2_Type(new Type("mat2", kFloat_Type, 2, 2)); | 161 const Type kMat2x2_Type("mat2", kFloat_Type, 2, 2); |
163 const std::shared_ptr<Type> kMat2x3_Type(new Type("mat2x3", kFloat_Type, 2, 3)); | 162 const Type kMat2x3_Type("mat2x3", kFloat_Type, 2, 3); |
164 const std::shared_ptr<Type> kMat2x4_Type(new Type("mat2x4", kFloat_Type, 2, 4)); | 163 const Type kMat2x4_Type("mat2x4", kFloat_Type, 2, 4); |
165 const std::shared_ptr<Type> kMat3x2_Type(new Type("mat3x2", kFloat_Type, 3, 2)); | 164 const Type kMat3x2_Type("mat3x2", kFloat_Type, 3, 2); |
166 const std::shared_ptr<Type> kMat3x3_Type(new Type("mat3", kFloat_Type, 3, 3)); | 165 const Type kMat3x3_Type("mat3", kFloat_Type, 3, 3); |
167 const std::shared_ptr<Type> kMat3x4_Type(new Type("mat3x4", kFloat_Type, 3, 4)); | 166 const Type kMat3x4_Type("mat3x4", kFloat_Type, 3, 4); |
168 const std::shared_ptr<Type> kMat4x2_Type(new Type("mat4x2", kFloat_Type, 4, 2)); | 167 const Type kMat4x2_Type("mat4x2", kFloat_Type, 4, 2); |
169 const std::shared_ptr<Type> kMat4x3_Type(new Type("mat4x3", kFloat_Type, 4, 3)); | 168 const Type kMat4x3_Type("mat4x3", kFloat_Type, 4, 3); |
170 const std::shared_ptr<Type> kMat4x4_Type(new Type("mat4", kFloat_Type, 4, 4)); | 169 const Type kMat4x4_Type("mat4", kFloat_Type, 4, 4); |
171 | 170 |
172 const std::shared_ptr<Type> kDMat2x2_Type(new Type("dmat2", kFloat_Type, 2, 2)
); | 171 const Type kDMat2x2_Type("dmat2", kFloat_Type, 2, 2); |
173 const std::shared_ptr<Type> kDMat2x3_Type(new Type("dmat2x3", kFloat_Type, 2, 3)
); | 172 const Type kDMat2x3_Type("dmat2x3", kFloat_Type, 2, 3); |
174 const std::shared_ptr<Type> kDMat2x4_Type(new Type("dmat2x4", kFloat_Type, 2, 4)
); | 173 const Type kDMat2x4_Type("dmat2x4", kFloat_Type, 2, 4); |
175 const std::shared_ptr<Type> kDMat3x2_Type(new Type("dmat3x2", kFloat_Type, 3, 2)
); | 174 const Type kDMat3x2_Type("dmat3x2", kFloat_Type, 3, 2); |
176 const std::shared_ptr<Type> kDMat3x3_Type(new Type("dmat3", kFloat_Type, 3, 3)
); | 175 const Type kDMat3x3_Type("dmat3", kFloat_Type, 3, 3); |
177 const std::shared_ptr<Type> kDMat3x4_Type(new Type("dmat3x4", kFloat_Type, 3, 4)
); | 176 const Type kDMat3x4_Type("dmat3x4", kFloat_Type, 3, 4); |
178 const std::shared_ptr<Type> kDMat4x2_Type(new Type("dmat4x2", kFloat_Type, 4, 2)
); | 177 const Type kDMat4x2_Type("dmat4x2", kFloat_Type, 4, 2); |
179 const std::shared_ptr<Type> kDMat4x3_Type(new Type("dmat4x3", kFloat_Type, 4, 3)
); | 178 const Type kDMat4x3_Type("dmat4x3", kFloat_Type, 4, 3); |
180 const std::shared_ptr<Type> kDMat4x4_Type(new Type("dmat4", kFloat_Type, 4, 4)
); | 179 const Type kDMat4x4_Type("dmat4", kFloat_Type, 4, 4); |
181 | 180 |
182 const std::shared_ptr<Type> kSampler1D_Type(new Type("sampler1D", SpvDim1D, fals
e, false, false, true)); | 181 const Type kSampler1D_Type("sampler1D", SpvDim1D, false, false, false, true); |
183 const std::shared_ptr<Type> kSampler2D_Type(new Type("sampler2D", SpvDim2D, fals
e, false, false, true)); | 182 const Type kSampler2D_Type("sampler2D", SpvDim2D, false, false, false, true); |
184 const std::shared_ptr<Type> kSampler3D_Type(new Type("sampler3D", SpvDim3D, fals
e, false, false, true)); | 183 const Type kSampler3D_Type("sampler3D", SpvDim3D, false, false, false, true); |
185 const std::shared_ptr<Type> kSamplerCube_Type(new Type("samplerCube")); | 184 const Type kSamplerCube_Type("samplerCube"); |
186 const std::shared_ptr<Type> kSampler2DRect_Type(new Type("sampler2DRect")); | 185 const Type kSampler2DRect_Type("sampler2DRect"); |
187 const std::shared_ptr<Type> kSampler1DArray_Type(new Type("sampler1DArray")); | 186 const Type kSampler1DArray_Type("sampler1DArray"); |
188 const std::shared_ptr<Type> kSampler2DArray_Type(new Type("sampler2DArray")); | 187 const Type kSampler2DArray_Type("sampler2DArray"); |
189 const std::shared_ptr<Type> kSamplerCubeArray_Type(new Type("samplerCubeArray"))
; | 188 const Type kSamplerCubeArray_Type("samplerCubeArray"); |
190 const std::shared_ptr<Type> kSamplerBuffer_Type(new Type("samplerBuffer")); | 189 const Type kSamplerBuffer_Type("samplerBuffer"); |
191 const std::shared_ptr<Type> kSampler2DMS_Type(new Type("sampler2DMS")); | 190 const Type kSampler2DMS_Type("sampler2DMS"); |
192 const std::shared_ptr<Type> kSampler2DMSArray_Type(new Type("sampler2DMSArray"))
; | 191 const Type kSampler2DMSArray_Type("sampler2DMSArray"); |
193 const std::shared_ptr<Type> kSampler1DShadow_Type(new Type("sampler1DShadow")); | 192 const Type kSampler1DShadow_Type("sampler1DShadow"); |
194 const std::shared_ptr<Type> kSampler2DShadow_Type(new Type("sampler2DShadow")); | 193 const Type kSampler2DShadow_Type("sampler2DShadow"); |
195 const std::shared_ptr<Type> kSamplerCubeShadow_Type(new Type("samplerCubeShadow"
)); | 194 const Type kSamplerCubeShadow_Type("samplerCubeShadow"); |
196 const std::shared_ptr<Type> kSampler2DRectShadow_Type(new Type("sampler2DRectSha
dow")); | 195 const Type kSampler2DRectShadow_Type("sampler2DRectShadow"); |
197 const std::shared_ptr<Type> kSampler1DArrayShadow_Type(new Type("sampler1DArrayS
hadow")); | 196 const Type kSampler1DArrayShadow_Type("sampler1DArrayShadow"); |
198 const std::shared_ptr<Type> kSampler2DArrayShadow_Type(new Type("sampler2DArrayS
hadow")); | 197 const Type kSampler2DArrayShadow_Type("sampler2DArrayShadow"); |
199 const std::shared_ptr<Type> kSamplerCubeArrayShadow_Type(new Type("samplerCubeAr
rayShadow")); | 198 const Type kSamplerCubeArrayShadow_Type("samplerCubeArrayShadow"); |
200 | 199 |
201 static std::vector<std::shared_ptr<Type>> type(std::shared_ptr<Type> t) { | 200 static std::vector<const Type*> type(const Type& t) { |
202 return { t, t, t, t }; | 201 return { &t, &t, &t, &t }; |
203 } | 202 } |
204 | 203 |
205 // FIXME figure out what we're supposed to do with the gsampler et al. types | 204 // FIXME figure out what we're supposed to do with the gsampler et al. types |
206 const std::shared_ptr<Type> kGSampler1D_Type(new Type("$gsampler1D", type(kSampl
er1D_Type))); | 205 const Type kGSampler1D_Type("$gsampler1D", type(kSampler1D_Type)); |
207 const std::shared_ptr<Type> kGSampler2D_Type(new Type("$gsampler2D", type(kSampl
er2D_Type))); | 206 const Type kGSampler2D_Type("$gsampler2D", type(kSampler2D_Type)); |
208 const std::shared_ptr<Type> kGSampler3D_Type(new Type("$gsampler3D", type(kSampl
er3D_Type))); | 207 const Type kGSampler3D_Type("$gsampler3D", type(kSampler3D_Type)); |
209 const std::shared_ptr<Type> kGSamplerCube_Type(new Type("$gsamplerCube", type(kS
amplerCube_Type))); | 208 const Type kGSamplerCube_Type("$gsamplerCube", type(kSamplerCube_Type)); |
210 const std::shared_ptr<Type> kGSampler2DRect_Type(new Type("$gsampler2DRect", | 209 const Type kGSampler2DRect_Type("$gsampler2DRect", type(kSampler2DRect_Type)); |
211 type(kSampler2DRect_Type))); | 210 const Type kGSampler1DArray_Type("$gsampler1DArray", type(kSampler1DArray_Type))
; |
212 const std::shared_ptr<Type> kGSampler1DArray_Type(new Type("$gsampler1DArray", | 211 const Type kGSampler2DArray_Type("$gsampler2DArray", type(kSampler2DArray_Type))
; |
213 type(kSampler1DArray_Type))); | 212 const Type kGSamplerCubeArray_Type("$gsamplerCubeArray", type(kSamplerCubeArray_
Type)); |
214 const std::shared_ptr<Type> kGSampler2DArray_Type(new Type("$gsampler2DArray", | 213 const Type kGSamplerBuffer_Type("$gsamplerBuffer", type(kSamplerBuffer_Type)); |
215 type(kSampler2DArray_Type))); | 214 const Type kGSampler2DMS_Type("$gsampler2DMS", type(kSampler2DMS_Type)); |
216 const std::shared_ptr<Type> kGSamplerCubeArray_Type(new Type("$gsamplerCubeArray
", | 215 const Type kGSampler2DMSArray_Type("$gsampler2DMSArray", type(kSampler2DMSArray_
Type)); |
217 type(kSamplerCubeArray_Type)
)); | 216 const Type kGSampler2DArrayShadow_Type("$gsampler2DArrayShadow", type(kSampler2D
ArrayShadow_Type)); |
218 const std::shared_ptr<Type> kGSamplerBuffer_Type(new Type("$gsamplerBuffer", | 217 const Type kGSamplerCubeArrayShadow_Type("$gsamplerCubeArrayShadow", |
219 type(kSamplerBuffer_Type))); | 218 type(kSamplerCubeArrayShadow_Type)); |
220 const std::shared_ptr<Type> kGSampler2DMS_Type(new Type("$gsampler2DMS", | |
221 type(kSampler2DMS_Type))); | |
222 const std::shared_ptr<Type> kGSampler2DMSArray_Type(new Type("$gsampler2DMSArray
", | |
223 type(kSampler2DMSArray_Type)
)); | |
224 const std::shared_ptr<Type> kGSampler2DArrayShadow_Type(new Type("$gsampler2DArr
ayShadow", | |
225 type(kSampler2DArrayShad
ow_Type))); | |
226 const std::shared_ptr<Type> kGSamplerCubeArrayShadow_Type(new Type("$gsamplerCub
eArrayShadow", | |
227 type(kSamplerCubeArray
Shadow_Type))); | |
228 | 219 |
229 const std::shared_ptr<Type> kGenType_Type(new Type("$genType", { kFloat_Type, kV
ec2_Type, | 220 const Type kGenType_Type("$genType", { &kFloat_Type, &kVec2_Type, &kVec3_Type, &
kVec4_Type }); |
230 kVec3_Type, kVe
c4_Type })); | 221 const Type kGenDType_Type("$genDType", { &kDouble_Type, &kDVec2_Type, &kDVec3_Ty
pe, &kDVec4_Type }); |
231 const std::shared_ptr<Type> kGenDType_Type(new Type("$genDType", { kDouble_Type,
kDVec2_Type, | 222 const Type kGenIType_Type("$genIType", { &kInt_Type, &kIVec2_Type, &kIVec3_Type,
&kIVec4_Type }); |
232 kDVec3_Type,
kDVec4_Type })); | 223 const Type kGenUType_Type("$genUType", { &kUInt_Type, &kUVec2_Type, &kUVec3_Type
, &kUVec4_Type }); |
233 const std::shared_ptr<Type> kGenIType_Type(new Type("$genIType", { kInt_Type, kI
Vec2_Type, | 224 const Type kGenBType_Type("$genBType", { &kBool_Type, &kBVec2_Type, &kBVec3_Type
, &kBVec4_Type }); |
234 kIVec3_Type,
kIVec4_Type })); | |
235 const std::shared_ptr<Type> kGenUType_Type(new Type("$genUType", { kUInt_Type, k
UVec2_Type, | |
236 kUVec3_Type,
kUVec4_Type })); | |
237 const std::shared_ptr<Type> kGenBType_Type(new Type("$genBType", { kBool_Type, k
BVec2_Type, | |
238 kBVec3_Type,
kBVec4_Type })); | |
239 | 225 |
240 const std::shared_ptr<Type> kMat_Type(new Type("$mat")); | 226 const Type kMat_Type("$mat"); |
241 | 227 |
242 const std::shared_ptr<Type> kVec_Type(new Type("$vec", { kVec2_Type, kVec2_Type,
kVec3_Type, | 228 const Type kVec_Type("$vec", { &kVec2_Type, &kVec2_Type, &kVec3_Type, &kVec4_Typ
e }); |
243 kVec4_Type })); | |
244 | 229 |
245 const std::shared_ptr<Type> kGVec_Type(new Type("$gvec")); | 230 const Type kGVec_Type("$gvec"); |
246 const std::shared_ptr<Type> kGVec2_Type(new Type("$gvec2")); | 231 const Type kGVec2_Type("$gvec2"); |
247 const std::shared_ptr<Type> kGVec3_Type(new Type("$gvec3")); | 232 const Type kGVec3_Type("$gvec3"); |
248 const std::shared_ptr<Type> kGVec4_Type(new Type("$gvec4", type(kVec4_Type))); | 233 const Type kGVec4_Type("$gvec4", type(kVec4_Type)); |
249 const std::shared_ptr<Type> kDVec_Type(new Type("$dvec")); | 234 const Type kDVec_Type("$dvec"); |
250 const std::shared_ptr<Type> kIVec_Type(new Type("$ivec")); | 235 const Type kIVec_Type("$ivec"); |
251 const std::shared_ptr<Type> kUVec_Type(new Type("$uvec")); | 236 const Type kUVec_Type("$uvec"); |
252 | 237 |
253 const std::shared_ptr<Type> kBVec_Type(new Type("$bvec", { kBVec2_Type, kBVec2_T
ype, | 238 const Type kBVec_Type("$bvec", { &kBVec2_Type, &kBVec2_Type, &kBVec3_Type, &kBVe
c4_Type }); |
254 kBVec3_Type, kBVec4_T
ype })); | |
255 | 239 |
256 const std::shared_ptr<Type> kInvalid_Type(new Type("<INVALID>")); | 240 const Type kInvalid_Type("<INVALID>"); |
257 | 241 |
258 } // namespace | 242 } // namespace |
OLD | NEW |