| 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 #ifndef SKIASL_TYPE | 8 #ifndef SKIASL_TYPE |
| 9 #define SKIASL_TYPE | 9 #define SKIASL_TYPE |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 kSampler_Kind, | 50 kSampler_Kind, |
| 51 kOther_Kind | 51 kOther_Kind |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 // Create an "other" (special) type with the given name. These types cannot
be directly | 54 // Create an "other" (special) type with the given name. These types cannot
be directly |
| 55 // referenced from user code. | 55 // referenced from user code. |
| 56 Type(std::string name) | 56 Type(std::string name) |
| 57 : INHERITED(Position(), kType_Kind, std::move(name)) | 57 : INHERITED(Position(), kType_Kind, std::move(name)) |
| 58 , fTypeKind(kOther_Kind) {} | 58 , fTypeKind(kOther_Kind) {} |
| 59 | 59 |
| 60 // Create a generic type which maps to the listed types. | 60 // Create a generic type which maps to the listed types. As currently implem
ented, there are |
| 61 // always exactly four coercion targets, mapping to the scalar, vec2, vec3,
and vec4 versions of |
| 62 // a type. |
| 61 Type(std::string name, std::vector<const Type*> types) | 63 Type(std::string name, std::vector<const Type*> types) |
| 62 : INHERITED(Position(), kType_Kind, std::move(name)) | 64 : INHERITED(Position(), kType_Kind, std::move(name)) |
| 63 , fTypeKind(kGeneric_Kind) | 65 , fTypeKind(kGeneric_Kind) |
| 64 , fCoercibleTypes(std::move(types)) { | 66 , fCoercibleTypes(std::move(types)) { |
| 65 ASSERT(fCoercibleTypes.size() == 4); | 67 ASSERT(fCoercibleTypes.size() == 4); |
| 66 } | 68 } |
| 67 | 69 |
| 68 // Create a struct type with the given fields. | 70 // Create a struct type with the given fields. |
| 69 Type(std::string name, std::vector<Field> fields) | 71 Type(std::string name, std::vector<Field> fields) |
| 70 : INHERITED(Position(), kType_Kind, std::move(name)) | 72 : INHERITED(Position(), kType_Kind, std::move(name)) |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 const SpvDim_ fDimensions = SpvDim1D; | 338 const SpvDim_ fDimensions = SpvDim1D; |
| 337 const bool fIsDepth = false; | 339 const bool fIsDepth = false; |
| 338 const bool fIsArrayed = false; | 340 const bool fIsArrayed = false; |
| 339 const bool fIsMultisampled = false; | 341 const bool fIsMultisampled = false; |
| 340 const bool fIsSampled = false; | 342 const bool fIsSampled = false; |
| 341 }; | 343 }; |
| 342 | 344 |
| 343 } // namespace | 345 } // namespace |
| 344 | 346 |
| 345 #endif | 347 #endif |
| OLD | NEW |