Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Side by Side Diff: src/sksl/ir/SkSLType.cpp

Issue 2143323003: Revert of SkSL performance improvements (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/sksl/ir/SkSLType.h ('k') | src/sksl/ir/SkSLTypeReference.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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(const Type& other, int* outCost) const { 12 bool Type::determineCoercionCost(std::shared_ptr<Type> other, int* outCost) cons t {
13 if (*this == other) { 13 if (this == other.get()) {
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.componentTy pe(), outCost); 19 return this->componentType()->determineCoercionCost(other->component Type(), 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.componentTy pe(), outCost); 26 return this->componentType()->determineCoercionCost(other->component Type(), 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 const Type& Type::toCompound(int columns, int rows) const { 39 std::shared_ptr<Type> Type::toCompound(int columns, int rows) {
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 *this; 42 return std::shared_ptr<Type>(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) {
55 case 2: return *kMat2x2_Type; 55 case 2: return kMat2x2_Type;
56 case 3: return *kMat3x2_Type; 56 case 3: return kMat3x2_Type;
57 case 4: return *kMat4x2_Type; 57 case 4: return kMat4x2_Type;
58 default: ABORT("unsupported matrix column count (%d)", colum ns); 58 default: ABORT("unsupported matrix column count (%d)", colum ns);
59 } 59 }
60 case 3: 60 case 3:
61 switch (columns) { 61 switch (columns) {
62 case 2: return *kMat2x3_Type; 62 case 2: return kMat2x3_Type;
63 case 3: return *kMat3x3_Type; 63 case 3: return kMat3x3_Type;
64 case 4: return *kMat4x3_Type; 64 case 4: return kMat4x3_Type;
65 default: ABORT("unsupported matrix column count (%d)", colum ns); 65 default: ABORT("unsupported matrix column count (%d)", colum ns);
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) {
87 case 2: return *kDMat2x2_Type; 87 case 2: return kDMat2x2_Type;
88 case 3: return *kDMat3x2_Type; 88 case 3: return kDMat3x2_Type;
89 case 4: return *kDMat4x2_Type; 89 case 4: return kDMat4x2_Type;
90 default: ABORT("unsupported matrix column count (%d)", colum ns); 90 default: ABORT("unsupported matrix column count (%d)", colum ns);
91 } 91 }
92 case 3: 92 case 3:
93 switch (columns) { 93 switch (columns) {
94 case 2: return *kDMat2x3_Type; 94 case 2: return kDMat2x3_Type;
95 case 3: return *kDMat3x3_Type; 95 case 3: return kDMat3x3_Type;
96 case 4: return *kDMat4x3_Type; 96 case 4: return kDMat4x3_Type;
97 default: ABORT("unsupported matrix column count (%d)", colum ns); 97 default: ABORT("unsupported matrix column count (%d)", colum ns);
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 Type* kVoid_Type = new Type("void"); 134 const std::shared_ptr<Type> kVoid_Type(new Type("void"));
135 135
136 const Type* kDouble_Type = new Type("double", true); 136 const std::shared_ptr<Type> kDouble_Type(new Type("double", true));
137 const Type* kDVec2_Type = new Type("dvec2", *kDouble_Type, 2); 137 const std::shared_ptr<Type> kDVec2_Type(new Type("dvec2", kDouble_Type, 2));
138 const Type* kDVec3_Type = new Type("dvec3", *kDouble_Type, 3); 138 const std::shared_ptr<Type> kDVec3_Type(new Type("dvec3", kDouble_Type, 3));
139 const Type* kDVec4_Type = new Type("dvec4", *kDouble_Type, 4); 139 const std::shared_ptr<Type> kDVec4_Type(new Type("dvec4", kDouble_Type, 4));
140 140
141 const Type* kFloat_Type = new Type("float", true, { kDouble_Type }); 141 const std::shared_ptr<Type> kFloat_Type(new Type("float", true, { kDouble_Type } ));
142 const Type* kVec2_Type = new Type("vec2", *kFloat_Type, 2); 142 const std::shared_ptr<Type> kVec2_Type(new Type("vec2", kFloat_Type, 2));
143 const Type* kVec3_Type = new Type("vec3", *kFloat_Type, 3); 143 const std::shared_ptr<Type> kVec3_Type(new Type("vec3", kFloat_Type, 3));
144 const Type* kVec4_Type = new Type("vec4", *kFloat_Type, 4); 144 const std::shared_ptr<Type> kVec4_Type(new Type("vec4", kFloat_Type, 4));
145 145
146 const Type* kUInt_Type = new Type("uint", true, { kFloat_Type, kDouble_Type }); 146 const std::shared_ptr<Type> kUInt_Type(new Type("uint", true, { kFloat_Type, kDo uble_Type }));
147 const Type* kUVec2_Type = new Type("uvec2", *kUInt_Type, 2); 147 const std::shared_ptr<Type> kUVec2_Type(new Type("uvec2", kUInt_Type, 2));
148 const Type* kUVec3_Type = new Type("uvec3", *kUInt_Type, 3); 148 const std::shared_ptr<Type> kUVec3_Type(new Type("uvec3", kUInt_Type, 3));
149 const Type* kUVec4_Type = new Type("uvec4", *kUInt_Type, 4); 149 const std::shared_ptr<Type> kUVec4_Type(new Type("uvec4", kUInt_Type, 4));
150 150
151 const Type* kInt_Type = new Type("int", true, { kUInt_Type, kFloat_Type, kDouble _Type }); 151 const std::shared_ptr<Type> kInt_Type(new Type("int", true, { kUInt_Type, kFloat _Type,
152 const Type* kIVec2_Type = new Type("ivec2", *kInt_Type, 2); 152 kDouble_Type }));
153 const Type* kIVec3_Type = new Type("ivec3", *kInt_Type, 3); 153 const std::shared_ptr<Type> kIVec2_Type(new Type("ivec2", kInt_Type, 2));
154 const Type* kIVec4_Type = new Type("ivec4", *kInt_Type, 4); 154 const std::shared_ptr<Type> kIVec3_Type(new Type("ivec3", kInt_Type, 3));
155 const std::shared_ptr<Type> kIVec4_Type(new Type("ivec4", kInt_Type, 4));
155 156
156 const Type* kBool_Type = new Type("bool", false); 157 const std::shared_ptr<Type> kBool_Type(new Type("bool", false));
157 const Type* kBVec2_Type = new Type("bvec2", *kBool_Type, 2); 158 const std::shared_ptr<Type> kBVec2_Type(new Type("bvec2", kBool_Type, 2));
158 const Type* kBVec3_Type = new Type("bvec3", *kBool_Type, 3); 159 const std::shared_ptr<Type> kBVec3_Type(new Type("bvec3", kBool_Type, 3));
159 const Type* kBVec4_Type = new Type("bvec4", *kBool_Type, 4); 160 const std::shared_ptr<Type> kBVec4_Type(new Type("bvec4", kBool_Type, 4));
160 161
161 const Type* kMat2x2_Type = new Type("mat2", *kFloat_Type, 2, 2); 162 const std::shared_ptr<Type> kMat2x2_Type(new Type("mat2", kFloat_Type, 2, 2));
162 const Type* kMat2x3_Type = new Type("mat2x3", *kFloat_Type, 2, 3); 163 const std::shared_ptr<Type> kMat2x3_Type(new Type("mat2x3", kFloat_Type, 2, 3));
163 const Type* kMat2x4_Type = new Type("mat2x4", *kFloat_Type, 2, 4); 164 const std::shared_ptr<Type> kMat2x4_Type(new Type("mat2x4", kFloat_Type, 2, 4));
164 const Type* kMat3x2_Type = new Type("mat3x2", *kFloat_Type, 3, 2); 165 const std::shared_ptr<Type> kMat3x2_Type(new Type("mat3x2", kFloat_Type, 3, 2));
165 const Type* kMat3x3_Type = new Type("mat3", *kFloat_Type, 3, 3); 166 const std::shared_ptr<Type> kMat3x3_Type(new Type("mat3", kFloat_Type, 3, 3));
166 const Type* kMat3x4_Type = new Type("mat3x4", *kFloat_Type, 3, 4); 167 const std::shared_ptr<Type> kMat3x4_Type(new Type("mat3x4", kFloat_Type, 3, 4));
167 const Type* kMat4x2_Type = new Type("mat4x2", *kFloat_Type, 4, 2); 168 const std::shared_ptr<Type> kMat4x2_Type(new Type("mat4x2", kFloat_Type, 4, 2));
168 const Type* kMat4x3_Type = new Type("mat4x3", *kFloat_Type, 4, 3); 169 const std::shared_ptr<Type> kMat4x3_Type(new Type("mat4x3", kFloat_Type, 4, 3));
169 const Type* kMat4x4_Type = new Type("mat4", *kFloat_Type, 4, 4); 170 const std::shared_ptr<Type> kMat4x4_Type(new Type("mat4", kFloat_Type, 4, 4));
170 171
171 const Type* kDMat2x2_Type = new Type("dmat2", *kFloat_Type, 2, 2); 172 const std::shared_ptr<Type> kDMat2x2_Type(new Type("dmat2", kFloat_Type, 2, 2) );
172 const Type* kDMat2x3_Type = new Type("dmat2x3", *kFloat_Type, 2, 3); 173 const std::shared_ptr<Type> kDMat2x3_Type(new Type("dmat2x3", kFloat_Type, 2, 3) );
173 const Type* kDMat2x4_Type = new Type("dmat2x4", *kFloat_Type, 2, 4); 174 const std::shared_ptr<Type> kDMat2x4_Type(new Type("dmat2x4", kFloat_Type, 2, 4) );
174 const Type* kDMat3x2_Type = new Type("dmat3x2", *kFloat_Type, 3, 2); 175 const std::shared_ptr<Type> kDMat3x2_Type(new Type("dmat3x2", kFloat_Type, 3, 2) );
175 const Type* kDMat3x3_Type = new Type("dmat3", *kFloat_Type, 3, 3); 176 const std::shared_ptr<Type> kDMat3x3_Type(new Type("dmat3", kFloat_Type, 3, 3) );
176 const Type* kDMat3x4_Type = new Type("dmat3x4", *kFloat_Type, 3, 4); 177 const std::shared_ptr<Type> kDMat3x4_Type(new Type("dmat3x4", kFloat_Type, 3, 4) );
177 const Type* kDMat4x2_Type = new Type("dmat4x2", *kFloat_Type, 4, 2); 178 const std::shared_ptr<Type> kDMat4x2_Type(new Type("dmat4x2", kFloat_Type, 4, 2) );
178 const Type* kDMat4x3_Type = new Type("dmat4x3", *kFloat_Type, 4, 3); 179 const std::shared_ptr<Type> kDMat4x3_Type(new Type("dmat4x3", kFloat_Type, 4, 3) );
179 const Type* kDMat4x4_Type = new Type("dmat4", *kFloat_Type, 4, 4); 180 const std::shared_ptr<Type> kDMat4x4_Type(new Type("dmat4", kFloat_Type, 4, 4) );
180 181
181 const Type* kSampler1D_Type = new Type("sampler1D", SpvDim1D, false, false, fals e, true); 182 const std::shared_ptr<Type> kSampler1D_Type(new Type("sampler1D", SpvDim1D, fals e, false, false, true));
182 const Type* kSampler2D_Type = new Type("sampler2D", SpvDim2D, false, false, fals e, true); 183 const std::shared_ptr<Type> kSampler2D_Type(new Type("sampler2D", SpvDim2D, fals e, false, false, true));
183 const Type* kSampler3D_Type = new Type("sampler3D", SpvDim3D, false, false, fals e, true); 184 const std::shared_ptr<Type> kSampler3D_Type(new Type("sampler3D", SpvDim3D, fals e, false, false, true));
184 const Type* kSamplerCube_Type = new Type("samplerCube"); 185 const std::shared_ptr<Type> kSamplerCube_Type(new Type("samplerCube"));
185 const Type* kSampler2DRect_Type = new Type("sampler2DRect"); 186 const std::shared_ptr<Type> kSampler2DRect_Type(new Type("sampler2DRect"));
186 const Type* kSampler1DArray_Type = new Type("sampler1DArray"); 187 const std::shared_ptr<Type> kSampler1DArray_Type(new Type("sampler1DArray"));
187 const Type* kSampler2DArray_Type = new Type("sampler2DArray"); 188 const std::shared_ptr<Type> kSampler2DArray_Type(new Type("sampler2DArray"));
188 const Type* kSamplerCubeArray_Type = new Type("samplerCubeArray"); 189 const std::shared_ptr<Type> kSamplerCubeArray_Type(new Type("samplerCubeArray")) ;
189 const Type* kSamplerBuffer_Type = new Type("samplerBuffer"); 190 const std::shared_ptr<Type> kSamplerBuffer_Type(new Type("samplerBuffer"));
190 const Type* kSampler2DMS_Type = new Type("sampler2DMS"); 191 const std::shared_ptr<Type> kSampler2DMS_Type(new Type("sampler2DMS"));
191 const Type* kSampler2DMSArray_Type = new Type("sampler2DMSArray"); 192 const std::shared_ptr<Type> kSampler2DMSArray_Type(new Type("sampler2DMSArray")) ;
192 const Type* kSampler1DShadow_Type = new Type("sampler1DShadow"); 193 const std::shared_ptr<Type> kSampler1DShadow_Type(new Type("sampler1DShadow"));
193 const Type* kSampler2DShadow_Type = new Type("sampler2DShadow"); 194 const std::shared_ptr<Type> kSampler2DShadow_Type(new Type("sampler2DShadow"));
194 const Type* kSamplerCubeShadow_Type = new Type("samplerCubeShadow"); 195 const std::shared_ptr<Type> kSamplerCubeShadow_Type(new Type("samplerCubeShadow" ));
195 const Type* kSampler2DRectShadow_Type = new Type("sampler2DRectShadow"); 196 const std::shared_ptr<Type> kSampler2DRectShadow_Type(new Type("sampler2DRectSha dow"));
196 const Type* kSampler1DArrayShadow_Type = new Type("sampler1DArrayShadow"); 197 const std::shared_ptr<Type> kSampler1DArrayShadow_Type(new Type("sampler1DArrayS hadow"));
197 const Type* kSampler2DArrayShadow_Type = new Type("sampler2DArrayShadow"); 198 const std::shared_ptr<Type> kSampler2DArrayShadow_Type(new Type("sampler2DArrayS hadow"));
198 const Type* kSamplerCubeArrayShadow_Type = new Type("samplerCubeArrayShadow"); 199 const std::shared_ptr<Type> kSamplerCubeArrayShadow_Type(new Type("samplerCubeAr rayShadow"));
199 200
200 static std::vector<const Type*> type(const Type* t) { 201 static std::vector<std::shared_ptr<Type>> type(std::shared_ptr<Type> t) {
201 return { t, t, t, t }; 202 return { t, t, t, t };
202 } 203 }
203 204
204 // FIXME figure out what we're supposed to do with the gsampler et al. types 205 // FIXME figure out what we're supposed to do with the gsampler et al. types
205 const Type* kGSampler1D_Type = new Type("$gsampler1D", type(kSampler1D_Type)); 206 const std::shared_ptr<Type> kGSampler1D_Type(new Type("$gsampler1D", type(kSampl er1D_Type)));
206 const Type* kGSampler2D_Type = new Type("$gsampler2D", type(kSampler2D_Type)); 207 const std::shared_ptr<Type> kGSampler2D_Type(new Type("$gsampler2D", type(kSampl er2D_Type)));
207 const Type* kGSampler3D_Type = new Type("$gsampler3D", type(kSampler3D_Type)); 208 const std::shared_ptr<Type> kGSampler3D_Type(new Type("$gsampler3D", type(kSampl er3D_Type)));
208 const Type* kGSamplerCube_Type = new Type("$gsamplerCube", type(kSamplerCube_Typ e)); 209 const std::shared_ptr<Type> kGSamplerCube_Type(new Type("$gsamplerCube", type(kS amplerCube_Type)));
209 const Type* kGSampler2DRect_Type = new Type("$gsampler2DRect", type(kSampler2DRe ct_Type)); 210 const std::shared_ptr<Type> kGSampler2DRect_Type(new Type("$gsampler2DRect",
210 const Type* kGSampler1DArray_Type = new Type("$gsampler1DArray", type(kSampler1D Array_Type)); 211 type(kSampler2DRect_Type)));
211 const Type* kGSampler2DArray_Type = new Type("$gsampler2DArray", type(kSampler2D Array_Type)); 212 const std::shared_ptr<Type> kGSampler1DArray_Type(new Type("$gsampler1DArray",
212 const Type* kGSamplerCubeArray_Type = new Type("$gsamplerCubeArray", type(kSampl erCubeArray_Type)); 213 type(kSampler1DArray_Type)));
213 const Type* kGSamplerBuffer_Type = new Type("$gsamplerBuffer", type(kSamplerBuff er_Type)); 214 const std::shared_ptr<Type> kGSampler2DArray_Type(new Type("$gsampler2DArray",
214 const Type* kGSampler2DMS_Type = new Type("$gsampler2DMS", type(kSampler2DMS_Typ e)); 215 type(kSampler2DArray_Type)));
215 const Type* kGSampler2DMSArray_Type = new Type("$gsampler2DMSArray", type(kSampl er2DMSArray_Type)); 216 const std::shared_ptr<Type> kGSamplerCubeArray_Type(new Type("$gsamplerCubeArray ",
216 const Type* kGSampler2DArrayShadow_Type = new Type("$gsampler2DArrayShadow", 217 type(kSamplerCubeArray_Type) ));
217 type(kSampler2DArrayShadow_Ty pe)); 218 const std::shared_ptr<Type> kGSamplerBuffer_Type(new Type("$gsamplerBuffer",
218 const Type* kGSamplerCubeArrayShadow_Type = new Type("$gsamplerCubeArrayShadow", 219 type(kSamplerBuffer_Type)));
219 type(kSamplerCubeArrayShado w_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)));
220 228
221 const Type* kGenType_Type = new Type("$genType", { kFloat_Type, kVec2_Type, kVec 3_Type, 229 const std::shared_ptr<Type> kGenType_Type(new Type("$genType", { kFloat_Type, kV ec2_Type,
222 kVec4_Type }); 230 kVec3_Type, kVe c4_Type }));
223 const Type* kGenDType_Type = new Type("$genDType", { kDouble_Type, kDVec2_Type, kDVec3_Type, 231 const std::shared_ptr<Type> kGenDType_Type(new Type("$genDType", { kDouble_Type, kDVec2_Type,
224 kDVec4_Type }); 232 kDVec3_Type, kDVec4_Type }));
225 const Type* kGenIType_Type = new Type("$genIType", { kInt_Type, kIVec2_Type, kIV ec3_Type, 233 const std::shared_ptr<Type> kGenIType_Type(new Type("$genIType", { kInt_Type, kI Vec2_Type,
226 kIVec4_Type }); 234 kIVec3_Type, kIVec4_Type }));
227 const Type* kGenUType_Type = new Type("$genUType", { kUInt_Type, kUVec2_Type, kU Vec3_Type, 235 const std::shared_ptr<Type> kGenUType_Type(new Type("$genUType", { kUInt_Type, k UVec2_Type,
228 kUVec4_Type }); 236 kUVec3_Type, kUVec4_Type }));
229 const Type* kGenBType_Type = new Type("$genBType", { kBool_Type, kBVec2_Type, kB Vec3_Type, 237 const std::shared_ptr<Type> kGenBType_Type(new Type("$genBType", { kBool_Type, k BVec2_Type,
230 kBVec4_Type }); 238 kBVec3_Type, kBVec4_Type }));
231 239
232 const Type* kMat_Type = new Type("$mat"); 240 const std::shared_ptr<Type> kMat_Type(new Type("$mat"));
233 241
234 const Type* kVec_Type = new Type("$vec", { kVec2_Type, kVec2_Type, kVec3_Type, k Vec4_Type }); 242 const std::shared_ptr<Type> kVec_Type(new Type("$vec", { kVec2_Type, kVec2_Type, kVec3_Type,
243 kVec4_Type }));
235 244
236 const Type* kGVec_Type = new Type("$gvec"); 245 const std::shared_ptr<Type> kGVec_Type(new Type("$gvec"));
237 const Type* kGVec2_Type = new Type("$gvec2"); 246 const std::shared_ptr<Type> kGVec2_Type(new Type("$gvec2"));
238 const Type* kGVec3_Type = new Type("$gvec3"); 247 const std::shared_ptr<Type> kGVec3_Type(new Type("$gvec3"));
239 const Type* kGVec4_Type = new Type("$gvec4", type(kVec4_Type)); 248 const std::shared_ptr<Type> kGVec4_Type(new Type("$gvec4", type(kVec4_Type)));
240 const Type* kDVec_Type = new Type("$dvec"); 249 const std::shared_ptr<Type> kDVec_Type(new Type("$dvec"));
241 const Type* kIVec_Type = new Type("$ivec"); 250 const std::shared_ptr<Type> kIVec_Type(new Type("$ivec"));
242 const Type* kUVec_Type = new Type("$uvec"); 251 const std::shared_ptr<Type> kUVec_Type(new Type("$uvec"));
243 252
244 const Type* kBVec_Type = new Type("$bvec", { kBVec2_Type, kBVec2_Type, kBVec3_Ty pe, kBVec4_Type }); 253 const std::shared_ptr<Type> kBVec_Type(new Type("$bvec", { kBVec2_Type, kBVec2_T ype,
254 kBVec3_Type, kBVec4_T ype }));
245 255
246 const Type* kInvalid_Type = new Type("<INVALID>"); 256 const std::shared_ptr<Type> kInvalid_Type(new Type("<INVALID>"));
247 257
248 } // namespace 258 } // namespace
OLDNEW
« no previous file with comments | « src/sksl/ir/SkSLType.h ('k') | src/sksl/ir/SkSLTypeReference.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698