blob: ccd0221fff0466cf86bea75dc64526bd106b5545 [file] [log] [blame]
Jamie Madill6a729792014-07-18 10:33:14 -04001//
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.
5//
Jamie Madilla2ad4e82014-07-17 14:16:32 -04006// ShaderVars.cpp:
Jamie Madill6a729792014-07-18 10:33:14 -04007// Methods for GL variable types (varyings, uniforms, etc)
8//
9
Jamie Madille294bb82014-07-17 14:16:26 -040010#include <GLSLANG/ShaderLang.h>
Jamie Madill6a729792014-07-18 10:33:14 -040011
Olli Etuahod57e0db2015-04-24 15:05:08 +030012#include "common/debug.h"
Zhenyao Moed136362014-10-03 13:23:01 -070013
Jamie Madill6a729792014-07-18 10:33:14 -040014namespace sh
15{
16
Jamie Madille9cc4692015-02-19 16:00:13 -050017namespace
18{
19
20InterpolationType GetNonAuxiliaryInterpolationType(InterpolationType interpolation)
21{
22 return (interpolation == INTERPOLATION_CENTROID ? INTERPOLATION_SMOOTH : interpolation);
23}
Jamie Madille9cc4692015-02-19 16:00:13 -050024}
25// The ES 3.0 spec is not clear on this point, but the ES 3.1 spec, and discussion
26// on Khronos.org, clarifies that a smooth/flat mismatch produces a link error,
27// but auxiliary qualifier mismatch (centroid) does not.
28bool InterpolationTypesMatch(InterpolationType a, InterpolationType b)
29{
30 return (GetNonAuxiliaryInterpolationType(a) == GetNonAuxiliaryInterpolationType(b));
31}
32
Jamie Madilld7b1ab52016-12-12 14:42:19 -050033ShaderVariable::ShaderVariable() : type(0), precision(0), arraySize(0), staticUse(false)
34{
35}
Jamie Madill6a729792014-07-18 10:33:14 -040036
37ShaderVariable::ShaderVariable(GLenum typeIn, unsigned int arraySizeIn)
Jamie Madilld7b1ab52016-12-12 14:42:19 -050038 : type(typeIn), precision(0), arraySize(arraySizeIn), staticUse(false)
39{
40}
Jamie Madill6a729792014-07-18 10:33:14 -040041
42ShaderVariable::~ShaderVariable()
Jamie Madilld7b1ab52016-12-12 14:42:19 -050043{
44}
Jamie Madill6a729792014-07-18 10:33:14 -040045
46ShaderVariable::ShaderVariable(const ShaderVariable &other)
47 : type(other.type),
48 precision(other.precision),
49 name(other.name),
50 mappedName(other.mappedName),
51 arraySize(other.arraySize),
Jamie Madill42bcf322014-08-25 16:20:46 -040052 staticUse(other.staticUse),
53 fields(other.fields),
54 structName(other.structName)
Jamie Madilld7b1ab52016-12-12 14:42:19 -050055{
56}
Jamie Madill6a729792014-07-18 10:33:14 -040057
58ShaderVariable &ShaderVariable::operator=(const ShaderVariable &other)
59{
Jamie Madilld7b1ab52016-12-12 14:42:19 -050060 type = other.type;
61 precision = other.precision;
62 name = other.name;
Jamie Madill6a729792014-07-18 10:33:14 -040063 mappedName = other.mappedName;
Jamie Madilld7b1ab52016-12-12 14:42:19 -050064 arraySize = other.arraySize;
65 staticUse = other.staticUse;
66 fields = other.fields;
Jamie Madill42bcf322014-08-25 16:20:46 -040067 structName = other.structName;
Jamie Madill6a729792014-07-18 10:33:14 -040068 return *this;
69}
70
Zhenyao Moed136362014-10-03 13:23:01 -070071bool ShaderVariable::operator==(const ShaderVariable &other) const
72{
Jamie Madilld7b1ab52016-12-12 14:42:19 -050073 if (type != other.type || precision != other.precision || name != other.name ||
74 mappedName != other.mappedName || arraySize != other.arraySize ||
75 staticUse != other.staticUse || fields.size() != other.fields.size() ||
Zhenyao Moed136362014-10-03 13:23:01 -070076 structName != other.structName)
77 {
78 return false;
79 }
80 for (size_t ii = 0; ii < fields.size(); ++ii)
81 {
82 if (fields[ii] != other.fields[ii])
83 return false;
84 }
85 return true;
86}
87
Jamie Madilld7b1ab52016-12-12 14:42:19 -050088bool ShaderVariable::findInfoByMappedName(const std::string &mappedFullName,
89 const ShaderVariable **leafVar,
90 std::string *originalFullName) const
Zhenyao Moed136362014-10-03 13:23:01 -070091{
92 ASSERT(leafVar && originalFullName);
93 // There are three cases:
94 // 1) the top variable is of struct type;
95 // 2) the top variable is an array;
96 // 3) otherwise.
97 size_t pos = mappedFullName.find_first_of(".[");
Zhenyao Moed136362014-10-03 13:23:01 -070098
99 if (pos == std::string::npos)
100 {
101 // Case 3.
102 if (mappedFullName != this->mappedName)
103 return false;
104 *originalFullName = this->name;
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500105 *leafVar = this;
Zhenyao Moed136362014-10-03 13:23:01 -0700106 return true;
107 }
108 else
109 {
110 std::string topName = mappedFullName.substr(0, pos);
111 if (topName != this->mappedName)
112 return false;
113 std::string originalName = this->name;
114 std::string remaining;
115 if (mappedFullName[pos] == '[')
116 {
117 // Case 2.
118 size_t closePos = mappedFullName.find_first_of(']');
119 if (closePos < pos || closePos == std::string::npos)
120 return false;
121 // Append '[index]'.
122 originalName += mappedFullName.substr(pos, closePos - pos + 1);
123 if (closePos + 1 == mappedFullName.size())
124 {
125 *originalFullName = originalName;
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500126 *leafVar = this;
Zhenyao Moed136362014-10-03 13:23:01 -0700127 return true;
128 }
129 else
130 {
131 // In the form of 'a[0].b', so after ']', '.' is expected.
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500132 if (mappedFullName[closePos + 1] != '.')
Zhenyao Moed136362014-10-03 13:23:01 -0700133 return false;
134 remaining = mappedFullName.substr(closePos + 2); // Skip "]."
135 }
136 }
137 else
138 {
139 // Case 1.
140 remaining = mappedFullName.substr(pos + 1); // Skip "."
141 }
142 for (size_t ii = 0; ii < this->fields.size(); ++ii)
143 {
Yunchao Hed7297bf2017-04-19 15:27:10 +0800144 const ShaderVariable *fieldVar = nullptr;
Zhenyao Moed136362014-10-03 13:23:01 -0700145 std::string originalFieldName;
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500146 bool found = fields[ii].findInfoByMappedName(remaining, &fieldVar, &originalFieldName);
Zhenyao Moed136362014-10-03 13:23:01 -0700147 if (found)
148 {
149 *originalFullName = originalName + "." + originalFieldName;
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500150 *leafVar = fieldVar;
Zhenyao Moed136362014-10-03 13:23:01 -0700151 return true;
152 }
153 }
154 return false;
155 }
156}
157
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500158bool ShaderVariable::isSameVariableAtLinkTime(const ShaderVariable &other,
159 bool matchPrecision) const
Zhenyao Moed136362014-10-03 13:23:01 -0700160{
161 if (type != other.type)
162 return false;
163 if (matchPrecision && precision != other.precision)
164 return false;
165 if (name != other.name)
166 return false;
167 ASSERT(mappedName == other.mappedName);
168 if (arraySize != other.arraySize)
169 return false;
170 if (fields.size() != other.fields.size())
171 return false;
172 for (size_t ii = 0; ii < fields.size(); ++ii)
173 {
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500174 if (!fields[ii].isSameVariableAtLinkTime(other.fields[ii], matchPrecision))
Zhenyao Moed136362014-10-03 13:23:01 -0700175 {
176 return false;
177 }
178 }
179 if (structName != other.structName)
180 return false;
181 return true;
182}
183
jchen104cdac9e2017-05-08 11:01:20 +0800184Uniform::Uniform() : binding(-1), offset(-1)
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500185{
186}
Jamie Madill6a729792014-07-18 10:33:14 -0400187
188Uniform::~Uniform()
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500189{
190}
Jamie Madill6a729792014-07-18 10:33:14 -0400191
jchen104cdac9e2017-05-08 11:01:20 +0800192Uniform::Uniform(const Uniform &other)
193 : VariableWithLocation(other), binding(other.binding), offset(other.offset)
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500194{
195}
Jamie Madill6a729792014-07-18 10:33:14 -0400196
197Uniform &Uniform::operator=(const Uniform &other)
198{
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000199 VariableWithLocation::operator=(other);
Olli Etuaho547cbd42017-02-27 11:54:00 +0200200 binding = other.binding;
jchen104cdac9e2017-05-08 11:01:20 +0800201 offset = other.offset;
Jamie Madill6a729792014-07-18 10:33:14 -0400202 return *this;
203}
204
Zhenyao Moed136362014-10-03 13:23:01 -0700205bool Uniform::operator==(const Uniform &other) const
206{
jchen104cdac9e2017-05-08 11:01:20 +0800207 return VariableWithLocation::operator==(other) && binding == other.binding &&
208 offset == other.offset;
Zhenyao Moed136362014-10-03 13:23:01 -0700209}
210
211bool Uniform::isSameUniformAtLinkTime(const Uniform &other) const
212{
jchen10eaef1e52017-06-13 10:44:11 +0800213 // Enforce a consistent match.
214 // https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16261
215 if (binding != -1 && other.binding != -1 && binding != other.binding)
Olli Etuaho547cbd42017-02-27 11:54:00 +0200216 {
217 return false;
218 }
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000219 if (location != -1 && other.location != -1 && location != other.location)
220 {
221 return false;
222 }
jchen104cdac9e2017-05-08 11:01:20 +0800223 if (offset != other.offset)
224 {
225 return false;
226 }
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000227 return VariableWithLocation::isSameVariableAtLinkTime(other, true);
Zhenyao Moed136362014-10-03 13:23:01 -0700228}
229
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000230VariableWithLocation::VariableWithLocation() : location(-1)
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500231{
232}
Jamie Madill6a729792014-07-18 10:33:14 -0400233
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000234VariableWithLocation::~VariableWithLocation()
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500235{
236}
Jamie Madill6a729792014-07-18 10:33:14 -0400237
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000238VariableWithLocation::VariableWithLocation(const VariableWithLocation &other)
Jamie Madilla0a9e122015-09-02 15:54:30 -0400239 : ShaderVariable(other), location(other.location)
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500240{
241}
Jamie Madill6a729792014-07-18 10:33:14 -0400242
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000243VariableWithLocation &VariableWithLocation::operator=(const VariableWithLocation &other)
Jamie Madill6a729792014-07-18 10:33:14 -0400244{
245 ShaderVariable::operator=(other);
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500246 location = other.location;
Jamie Madill6a729792014-07-18 10:33:14 -0400247 return *this;
248}
249
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000250bool VariableWithLocation::operator==(const VariableWithLocation &other) const
Zhenyao Moed136362014-10-03 13:23:01 -0700251{
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500252 return (ShaderVariable::operator==(other) && location == other.location);
Zhenyao Moed136362014-10-03 13:23:01 -0700253}
254
Jamie Madilla0a9e122015-09-02 15:54:30 -0400255Attribute::Attribute()
256{
257}
258
259Attribute::~Attribute()
260{
261}
262
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000263Attribute::Attribute(const Attribute &other) : VariableWithLocation(other)
Jamie Madilla0a9e122015-09-02 15:54:30 -0400264{
265}
266
267Attribute &Attribute::operator=(const Attribute &other)
268{
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000269 VariableWithLocation::operator=(other);
Jamie Madilla0a9e122015-09-02 15:54:30 -0400270 return *this;
271}
272
273bool Attribute::operator==(const Attribute &other) const
274{
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000275 return VariableWithLocation::operator==(other);
Jamie Madilla0a9e122015-09-02 15:54:30 -0400276}
277
278OutputVariable::OutputVariable()
279{
280}
281
282OutputVariable::~OutputVariable()
283{
284}
285
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000286OutputVariable::OutputVariable(const OutputVariable &other) : VariableWithLocation(other)
Jamie Madilla0a9e122015-09-02 15:54:30 -0400287{
288}
289
290OutputVariable &OutputVariable::operator=(const OutputVariable &other)
291{
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000292 VariableWithLocation::operator=(other);
Jamie Madilla0a9e122015-09-02 15:54:30 -0400293 return *this;
294}
295
296bool OutputVariable::operator==(const OutputVariable &other) const
297{
Olli Etuaho6ca2b652017-02-19 18:05:10 +0000298 return VariableWithLocation::operator==(other);
Jamie Madilla0a9e122015-09-02 15:54:30 -0400299}
300
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500301InterfaceBlockField::InterfaceBlockField() : isRowMajorLayout(false)
302{
303}
Jamie Madill6a729792014-07-18 10:33:14 -0400304
305InterfaceBlockField::~InterfaceBlockField()
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500306{
307}
Jamie Madill6a729792014-07-18 10:33:14 -0400308
309InterfaceBlockField::InterfaceBlockField(const InterfaceBlockField &other)
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500310 : ShaderVariable(other), isRowMajorLayout(other.isRowMajorLayout)
311{
312}
Jamie Madill6a729792014-07-18 10:33:14 -0400313
314InterfaceBlockField &InterfaceBlockField::operator=(const InterfaceBlockField &other)
315{
316 ShaderVariable::operator=(other);
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500317 isRowMajorLayout = other.isRowMajorLayout;
Jamie Madill6a729792014-07-18 10:33:14 -0400318 return *this;
319}
320
Zhenyao Moed136362014-10-03 13:23:01 -0700321bool InterfaceBlockField::operator==(const InterfaceBlockField &other) const
322{
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500323 return (ShaderVariable::operator==(other) && isRowMajorLayout == other.isRowMajorLayout);
Zhenyao Moed136362014-10-03 13:23:01 -0700324}
325
326bool InterfaceBlockField::isSameInterfaceBlockFieldAtLinkTime(
327 const InterfaceBlockField &other) const
328{
329 return (ShaderVariable::isSameVariableAtLinkTime(other, true) &&
330 isRowMajorLayout == other.isRowMajorLayout);
331}
332
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500333Varying::Varying() : interpolation(INTERPOLATION_SMOOTH), isInvariant(false)
334{
335}
Jamie Madill6a729792014-07-18 10:33:14 -0400336
337Varying::~Varying()
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500338{
339}
Jamie Madill6a729792014-07-18 10:33:14 -0400340
341Varying::Varying(const Varying &other)
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500342 : ShaderVariable(other), interpolation(other.interpolation), isInvariant(other.isInvariant)
343{
344}
Jamie Madill6a729792014-07-18 10:33:14 -0400345
346Varying &Varying::operator=(const Varying &other)
347{
348 ShaderVariable::operator=(other);
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500349 interpolation = other.interpolation;
350 isInvariant = other.isInvariant;
Jamie Madill6a729792014-07-18 10:33:14 -0400351 return *this;
352}
353
Zhenyao Moed136362014-10-03 13:23:01 -0700354bool Varying::operator==(const Varying &other) const
355{
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500356 return (ShaderVariable::operator==(other) && interpolation == other.interpolation &&
Zhenyao Moed136362014-10-03 13:23:01 -0700357 isInvariant == other.isInvariant);
358}
359
Jamie Madill9e64edc2015-05-07 14:08:06 +0000360bool Varying::isSameVaryingAtLinkTime(const Varying &other) const
Zhenyao Moed136362014-10-03 13:23:01 -0700361{
Olli Etuaho37ad4742015-04-27 13:18:50 +0300362 return isSameVaryingAtLinkTime(other, 100);
363}
364
365bool Varying::isSameVaryingAtLinkTime(const Varying &other, int shaderVersion) const
366{
Zhenyao Moed136362014-10-03 13:23:01 -0700367 return (ShaderVariable::isSameVariableAtLinkTime(other, false) &&
Corentin Wallez84954982016-07-12 15:42:18 -0400368 InterpolationTypesMatch(interpolation, other.interpolation) &&
Olli Etuaho37ad4742015-04-27 13:18:50 +0300369 (shaderVersion >= 300 || isInvariant == other.isInvariant));
Zhenyao Moed136362014-10-03 13:23:01 -0700370}
371
Jamie Madill6a729792014-07-18 10:33:14 -0400372InterfaceBlock::InterfaceBlock()
jchen10af713a22017-04-19 09:10:56 +0800373 : arraySize(0),
374 layout(BLOCKLAYOUT_PACKED),
375 isRowMajorLayout(false),
376 binding(-1),
Jiajia Qin9b11ea42017-07-11 16:50:08 +0800377 staticUse(false),
378 blockType(BlockType::BLOCK_UNIFORM)
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500379{
380}
Jamie Madill6a729792014-07-18 10:33:14 -0400381
382InterfaceBlock::~InterfaceBlock()
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500383{
384}
Jamie Madill6a729792014-07-18 10:33:14 -0400385
386InterfaceBlock::InterfaceBlock(const InterfaceBlock &other)
387 : name(other.name),
388 mappedName(other.mappedName),
Jamie Madill42bcf322014-08-25 16:20:46 -0400389 instanceName(other.instanceName),
Jamie Madill6a729792014-07-18 10:33:14 -0400390 arraySize(other.arraySize),
391 layout(other.layout),
392 isRowMajorLayout(other.isRowMajorLayout),
jchen10af713a22017-04-19 09:10:56 +0800393 binding(other.binding),
Jamie Madill6a729792014-07-18 10:33:14 -0400394 staticUse(other.staticUse),
Jiajia Qin9b11ea42017-07-11 16:50:08 +0800395 blockType(other.blockType),
Jamie Madill6a729792014-07-18 10:33:14 -0400396 fields(other.fields)
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500397{
398}
Jamie Madill6a729792014-07-18 10:33:14 -0400399
400InterfaceBlock &InterfaceBlock::operator=(const InterfaceBlock &other)
401{
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500402 name = other.name;
403 mappedName = other.mappedName;
404 instanceName = other.instanceName;
405 arraySize = other.arraySize;
406 layout = other.layout;
Jamie Madill6a729792014-07-18 10:33:14 -0400407 isRowMajorLayout = other.isRowMajorLayout;
jchen10af713a22017-04-19 09:10:56 +0800408 binding = other.binding;
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500409 staticUse = other.staticUse;
Jiajia Qin9b11ea42017-07-11 16:50:08 +0800410 blockType = other.blockType;
Jamie Madilld7b1ab52016-12-12 14:42:19 -0500411 fields = other.fields;
Jamie Madill6a729792014-07-18 10:33:14 -0400412 return *this;
413}
414
Jamie Madill39046162016-02-08 15:05:17 -0500415std::string InterfaceBlock::fieldPrefix() const
416{
417 return instanceName.empty() ? "" : name;
Jamie Madill6a729792014-07-18 10:33:14 -0400418}
Jamie Madill39046162016-02-08 15:05:17 -0500419
Corentin Wallez84954982016-07-12 15:42:18 -0400420bool InterfaceBlock::isSameInterfaceBlockAtLinkTime(const InterfaceBlock &other) const
421{
422 if (name != other.name || mappedName != other.mappedName || arraySize != other.arraySize ||
423 layout != other.layout || isRowMajorLayout != other.isRowMajorLayout ||
Jiajia Qin9b11ea42017-07-11 16:50:08 +0800424 binding != other.binding || blockType != other.blockType ||
425 fields.size() != other.fields.size())
Corentin Wallez84954982016-07-12 15:42:18 -0400426 {
427 return false;
428 }
429
430 for (size_t fieldIndex = 0; fieldIndex < fields.size(); ++fieldIndex)
431 {
432 if (!fields[fieldIndex].isSameInterfaceBlockFieldAtLinkTime(other.fields[fieldIndex]))
433 {
434 return false;
435 }
436 }
437
438 return true;
439}
440
Martin Radev4c4c8e72016-08-04 12:25:34 +0300441void WorkGroupSize::fill(int fillValue)
442{
443 localSizeQualifiers[0] = fillValue;
444 localSizeQualifiers[1] = fillValue;
445 localSizeQualifiers[2] = fillValue;
446}
447
448void WorkGroupSize::setLocalSize(int localSizeX, int localSizeY, int localSizeZ)
449{
450 localSizeQualifiers[0] = localSizeX;
451 localSizeQualifiers[1] = localSizeY;
452 localSizeQualifiers[2] = localSizeZ;
453}
454
455// check that if one of them is less than 1, then all of them are.
456// Or if one is positive, then all of them are positive.
457bool WorkGroupSize::isLocalSizeValid() const
458{
459 return (
460 (localSizeQualifiers[0] < 1 && localSizeQualifiers[1] < 1 && localSizeQualifiers[2] < 1) ||
461 (localSizeQualifiers[0] > 0 && localSizeQualifiers[1] > 0 && localSizeQualifiers[2] > 0));
462}
463
464bool WorkGroupSize::isAnyValueSet() const
465{
466 return localSizeQualifiers[0] > 0 || localSizeQualifiers[1] > 0 || localSizeQualifiers[2] > 0;
467}
468
469bool WorkGroupSize::isDeclared() const
470{
471 bool localSizeDeclared = localSizeQualifiers[0] > 0;
472 ASSERT(isLocalSizeValid());
473 return localSizeDeclared;
474}
475
476bool WorkGroupSize::isWorkGroupSizeMatching(const WorkGroupSize &right) const
477{
478 for (size_t i = 0u; i < size(); ++i)
479 {
480 bool result = (localSizeQualifiers[i] == right.localSizeQualifiers[i] ||
481 (localSizeQualifiers[i] == 1 && right.localSizeQualifiers[i] == -1) ||
482 (localSizeQualifiers[i] == -1 && right.localSizeQualifiers[i] == 1));
483 if (!result)
484 {
485 return false;
486 }
487 }
488 return true;
489}
490
491int &WorkGroupSize::operator[](size_t index)
492{
493 ASSERT(index < size());
494 return localSizeQualifiers[index];
495}
496
497int WorkGroupSize::operator[](size_t index) const
498{
499 ASSERT(index < size());
500 return localSizeQualifiers[index];
501}
502
503size_t WorkGroupSize::size() const
504{
505 return 3u;
506}
507
Jamie Madill39046162016-02-08 15:05:17 -0500508} // namespace sh