Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-swiftshader: Commit

external/swiftshader


Commit MetaInfo

Revisionff9f9b5d30948f8c280a481e5e11a117c8497627 (tree)
Time2020-04-14 18:43:47
AuthorNicolas Capens <capn@goog...>
CommiterNicolas Capens

Log Message

Rename size/sizeInComponents to componentCount

Bug: b/129000021
Change-Id: I36401de649eb53474ca74acb069351ce37f7529f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43828
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>

Change Summary

Incremental Difference

--- a/src/Pipeline/SpirvShader.cpp
+++ b/src/Pipeline/SpirvShader.cpp
@@ -264,7 +264,7 @@ SpirvShader::SpirvShader(
264264 case spv::StorageClassWorkgroup:
265265 {
266266 auto &elTy = getType(getType(typeId).element);
267- auto sizeInBytes = elTy.sizeInComponents * static_cast<uint32_t>(sizeof(float));
267+ auto sizeInBytes = elTy.componentCount * static_cast<uint32_t>(sizeof(float));
268268 workgroupMemory.allocate(resultId, sizeInBytes);
269269 object.kind = Object::Kind::Pointer;
270270 break;
@@ -308,7 +308,7 @@ SpirvShader::SpirvShader(
308308 // OpConstantNull forms a constant of arbitrary type, all zeros.
309309 auto &object = CreateConstant(insn);
310310 auto &objectTy = getType(object);
311- for(auto i = 0u; i < objectTy.sizeInComponents; i++)
311+ for(auto i = 0u; i < objectTy.componentCount; i++)
312312 {
313313 object.constantValue[i] = 0;
314314 }
@@ -323,7 +323,7 @@ SpirvShader::SpirvShader(
323323 {
324324 auto &constituent = getObject(insn.word(i + 3));
325325 auto &constituentTy = getType(constituent);
326- for(auto j = 0u; j < constituentTy.sizeInComponents; j++)
326+ for(auto j = 0u; j < constituentTy.componentCount; j++)
327327 {
328328 object.constantValue[offset++] = constituent.constantValue[j];
329329 }
@@ -342,7 +342,7 @@ SpirvShader::SpirvShader(
342342 // any execution mode set for LocalSize.
343343 // The object decorated with WorkgroupSize must be declared
344344 // as a three-component vector of 32-bit integers.
345- ASSERT(getType(object).sizeInComponents == 3);
345+ ASSERT(getType(object).componentCount == 3);
346346 modes.WorkgroupSizeX = object.constantValue[0];
347347 modes.WorkgroupSizeY = object.constantValue[1];
348348 modes.WorkgroupSizeZ = object.constantValue[2];
@@ -743,7 +743,7 @@ void SpirvShader::DeclareType(InsnIterator insn)
743743
744744 auto &type = types[resultId];
745745 type.definition = insn;
746- type.sizeInComponents = ComputeTypeSize(insn);
746+ type.componentCount = ComputeTypeSize(insn);
747747
748748 // A structure is a builtin block if it has a builtin
749749 // member. All members of such a structure are builtins.
@@ -795,7 +795,7 @@ SpirvShader::Object &SpirvShader::CreateConstant(InsnIterator insn)
795795 auto &objectTy = getType(typeId);
796796 object.kind = Object::Kind::Constant;
797797 object.definition = insn;
798- object.constantValue = std::unique_ptr<uint32_t[]>(new uint32_t[objectTy.sizeInComponents]);
798+ object.constantValue = std::unique_ptr<uint32_t[]>(new uint32_t[objectTy.componentCount]);
799799
800800 return object;
801801 }
@@ -829,10 +829,10 @@ void SpirvShader::ProcessInterfaceVariable(Object &object)
829829
830830 if(member.HasBuiltIn)
831831 {
832- builtinInterface[member.BuiltIn] = { resultId, offset, memberType.sizeInComponents };
832+ builtinInterface[member.BuiltIn] = { resultId, offset, memberType.componentCount };
833833 }
834834
835- offset += memberType.sizeInComponents;
835+ offset += memberType.componentCount;
836836 ++memberIndex;
837837 }
838838
@@ -842,7 +842,7 @@ void SpirvShader::ProcessInterfaceVariable(Object &object)
842842 auto d = decorations.find(resultId);
843843 if(d != decorations.end() && d->second.HasBuiltIn)
844844 {
845- builtinInterface[d->second.BuiltIn] = { resultId, 0, pointeeTy.sizeInComponents };
845+ builtinInterface[d->second.BuiltIn] = { resultId, 0, pointeeTy.componentCount };
846846 }
847847 else
848848 {
@@ -924,13 +924,13 @@ uint32_t SpirvShader::ComputeTypeSize(InsnIterator insn)
924924 case spv::OpTypeVector:
925925 case spv::OpTypeMatrix:
926926 // Vectors and matrices both consume element count * element size.
927- return getType(insn.word(2)).sizeInComponents * insn.word(3);
927+ return getType(insn.word(2)).componentCount * insn.word(3);
928928
929929 case spv::OpTypeArray:
930930 {
931931 // Element count * element size. Array sizes come from constant ids.
932932 auto arraySize = GetConstScalarInt(insn.word(3));
933- return getType(insn.word(2)).sizeInComponents * arraySize;
933+ return getType(insn.word(2)).componentCount * arraySize;
934934 }
935935
936936 case spv::OpTypeStruct:
@@ -938,7 +938,7 @@ uint32_t SpirvShader::ComputeTypeSize(InsnIterator insn)
938938 uint32_t size = 0;
939939 for(uint32_t i = 2u; i < insn.wordCount(); i++)
940940 {
941- size += getType(insn.word(i)).sizeInComponents;
941+ size += getType(insn.word(i)).componentCount;
942942 }
943943 return size;
944944 }
@@ -1202,7 +1202,7 @@ SIMD::Pointer SpirvShader::WalkAccessChain(Object::ID baseId, uint32_t numIndexe
12021202 for(auto j = 0; j < memberIndex; j++)
12031203 {
12041204 auto memberType = type.definition.word(2u + j);
1205- offsetIntoStruct += getType(memberType).sizeInComponents * sizeof(float);
1205+ offsetIntoStruct += getType(memberType).componentCount * sizeof(float);
12061206 }
12071207 constantOffset += offsetIntoStruct;
12081208 typeId = type.definition.word(2u + memberIndex);
@@ -1233,7 +1233,7 @@ SIMD::Pointer SpirvShader::WalkAccessChain(Object::ID baseId, uint32_t numIndexe
12331233 }
12341234 else
12351235 {
1236- auto stride = getType(type.element).sizeInComponents * static_cast<uint32_t>(sizeof(float));
1236+ auto stride = getType(type.element).componentCount * static_cast<uint32_t>(sizeof(float));
12371237 auto &obj = getObject(indexIds[i]);
12381238 if(obj.kind == Object::Kind::Constant)
12391239 {
@@ -1276,7 +1276,7 @@ uint32_t SpirvShader::WalkLiteralAccessChain(Type::ID typeId, uint32_t numIndexe
12761276 for(auto j = 0; j < memberIndex; j++)
12771277 {
12781278 auto memberType = type.definition.word(2u + j);
1279- offsetIntoStruct += getType(memberType).sizeInComponents;
1279+ offsetIntoStruct += getType(memberType).componentCount;
12801280 }
12811281 componentOffset += offsetIntoStruct;
12821282 typeId = type.definition.word(2u + memberIndex);
@@ -1288,7 +1288,7 @@ uint32_t SpirvShader::WalkLiteralAccessChain(Type::ID typeId, uint32_t numIndexe
12881288 case spv::OpTypeArray:
12891289 {
12901290 auto elementType = type.definition.word(2);
1291- auto stride = getType(elementType).sizeInComponents;
1291+ auto stride = getType(elementType).componentCount;
12921292 componentOffset += stride * indexes[i];
12931293 typeId = elementType;
12941294 break;
@@ -1515,16 +1515,16 @@ void SpirvShader::emitProlog(SpirvRoutine *routine) const
15151515 auto resultPointerType = getType(insn.resultTypeId());
15161516 auto pointeeType = getType(resultPointerType.element);
15171517
1518- if(pointeeType.sizeInComponents > 0) // TODO: what to do about zero-slot objects?
1518+ if(pointeeType.componentCount > 0) // TODO: what to do about zero-slot objects?
15191519 {
1520- routine->createVariable(insn.resultId(), pointeeType.sizeInComponents);
1520+ routine->createVariable(insn.resultId(), pointeeType.componentCount);
15211521 }
15221522 break;
15231523 }
15241524 case spv::OpPhi:
15251525 {
15261526 auto type = getType(insn.resultTypeId());
1527- routine->phis.emplace(insn.resultId(), SpirvRoutine::Variable(type.sizeInComponents));
1527+ routine->phis.emplace(insn.resultId(), SpirvRoutine::Variable(type.componentCount));
15281528 break;
15291529 }
15301530
@@ -1973,7 +1973,7 @@ SpirvShader::EmitResult SpirvShader::EmitAccessChain(InsnIterator insn, EmitStat
19731973 uint32_t numIndexes = insn.wordCount() - 4;
19741974 const uint32_t *indexes = insn.wordPointer(4);
19751975 auto &type = getType(typeId);
1976- ASSERT(type.sizeInComponents == 1);
1976+ ASSERT(type.componentCount == 1);
19771977 ASSERT(getObject(resultId).kind == Object::Kind::Pointer);
19781978
19791979 if(type.storageClass == spv::StorageClassPushConstant ||
@@ -1995,7 +1995,7 @@ SpirvShader::EmitResult SpirvShader::EmitAccessChain(InsnIterator insn, EmitStat
19951995 SpirvShader::EmitResult SpirvShader::EmitCompositeConstruct(InsnIterator insn, EmitState *state) const
19961996 {
19971997 auto &type = getType(insn.resultTypeId());
1998- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
1998+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
19991999 auto offset = 0u;
20002000
20012001 for(auto i = 0u; i < insn.wordCount() - 3; i++)
@@ -2005,7 +2005,7 @@ SpirvShader::EmitResult SpirvShader::EmitCompositeConstruct(InsnIterator insn, E
20052005 auto &srcObjectTy = getType(srcObject);
20062006 Operand srcObjectAccess(this, state, srcObjectId);
20072007
2008- for(auto j = 0u; j < srcObjectTy.sizeInComponents; j++)
2008+ for(auto j = 0u; j < srcObjectTy.componentCount; j++)
20092009 {
20102010 dst.move(offset++, srcObjectAccess.Float(j));
20112011 }
@@ -2018,7 +2018,7 @@ SpirvShader::EmitResult SpirvShader::EmitCompositeInsert(InsnIterator insn, Emit
20182018 {
20192019 Type::ID resultTypeId = insn.word(1);
20202020 auto &type = getType(resultTypeId);
2021- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
2021+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
20222022 auto &newPartObject = getObject(insn.word(3));
20232023 auto &newPartObjectTy = getType(newPartObject);
20242024 auto firstNewComponent = WalkLiteralAccessChain(resultTypeId, insn.wordCount() - 5, insn.wordPointer(5));
@@ -2032,12 +2032,12 @@ SpirvShader::EmitResult SpirvShader::EmitCompositeInsert(InsnIterator insn, Emit
20322032 dst.move(i, srcObjectAccess.Float(i));
20332033 }
20342034 // new part
2035- for(auto i = 0u; i < newPartObjectTy.sizeInComponents; i++)
2035+ for(auto i = 0u; i < newPartObjectTy.componentCount; i++)
20362036 {
20372037 dst.move(firstNewComponent + i, newPartObjectAccess.Float(i));
20382038 }
20392039 // old components after
2040- for(auto i = firstNewComponent + newPartObjectTy.sizeInComponents; i < type.sizeInComponents; i++)
2040+ for(auto i = firstNewComponent + newPartObjectTy.componentCount; i < type.componentCount; i++)
20412041 {
20422042 dst.move(i, srcObjectAccess.Float(i));
20432043 }
@@ -2048,13 +2048,13 @@ SpirvShader::EmitResult SpirvShader::EmitCompositeInsert(InsnIterator insn, Emit
20482048 SpirvShader::EmitResult SpirvShader::EmitCompositeExtract(InsnIterator insn, EmitState *state) const
20492049 {
20502050 auto &type = getType(insn.resultTypeId());
2051- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
2051+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
20522052 auto &compositeObject = getObject(insn.word(3));
20532053 Type::ID compositeTypeId = compositeObject.definition.word(1);
20542054 auto firstComponent = WalkLiteralAccessChain(compositeTypeId, insn.wordCount() - 4, insn.wordPointer(4));
20552055
20562056 Operand compositeObjectAccess(this, state, insn.word(3));
2057- for(auto i = 0u; i < type.sizeInComponents; i++)
2057+ for(auto i = 0u; i < type.componentCount; i++)
20582058 {
20592059 dst.move(i, compositeObjectAccess.Float(firstComponent + i));
20602060 }
@@ -2065,7 +2065,7 @@ SpirvShader::EmitResult SpirvShader::EmitCompositeExtract(InsnIterator insn, Emi
20652065 SpirvShader::EmitResult SpirvShader::EmitVectorShuffle(InsnIterator insn, EmitState *state) const
20662066 {
20672067 auto &type = getType(insn.resultTypeId());
2068- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
2068+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
20692069
20702070 // Note: number of components in result type, first half type, and second
20712071 // half type are all independent.
@@ -2074,7 +2074,7 @@ SpirvShader::EmitResult SpirvShader::EmitVectorShuffle(InsnIterator insn, EmitSt
20742074 Operand firstHalfAccess(this, state, insn.word(3));
20752075 Operand secondHalfAccess(this, state, insn.word(4));
20762076
2077- for(auto i = 0u; i < type.sizeInComponents; i++)
2077+ for(auto i = 0u; i < type.componentCount; i++)
20782078 {
20792079 auto selector = insn.word(5 + i);
20802080 if(selector == static_cast<uint32_t>(-1))
@@ -2083,13 +2083,13 @@ SpirvShader::EmitResult SpirvShader::EmitVectorShuffle(InsnIterator insn, EmitSt
20832083 // a value as any
20842084 dst.move(i, RValue<SIMD::Float>(0.0f));
20852085 }
2086- else if(selector < firstHalfType.sizeInComponents)
2086+ else if(selector < firstHalfType.componentCount)
20872087 {
20882088 dst.move(i, firstHalfAccess.Float(selector));
20892089 }
20902090 else
20912091 {
2092- dst.move(i, secondHalfAccess.Float(selector - firstHalfType.sizeInComponents));
2092+ dst.move(i, secondHalfAccess.Float(selector - firstHalfType.componentCount));
20932093 }
20942094 }
20952095
@@ -2099,7 +2099,7 @@ SpirvShader::EmitResult SpirvShader::EmitVectorShuffle(InsnIterator insn, EmitSt
20992099 SpirvShader::EmitResult SpirvShader::EmitVectorExtractDynamic(InsnIterator insn, EmitState *state) const
21002100 {
21012101 auto &type = getType(insn.resultTypeId());
2102- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
2102+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
21032103 auto &srcType = getType(getObject(insn.word(3)));
21042104
21052105 Operand src(this, state, insn.word(3));
@@ -2107,7 +2107,7 @@ SpirvShader::EmitResult SpirvShader::EmitVectorExtractDynamic(InsnIterator insn,
21072107
21082108 SIMD::UInt v = SIMD::UInt(0);
21092109
2110- for(auto i = 0u; i < srcType.sizeInComponents; i++)
2110+ for(auto i = 0u; i < srcType.componentCount; i++)
21112111 {
21122112 v |= CmpEQ(index.UInt(0), SIMD::UInt(i)) & src.UInt(i);
21132113 }
@@ -2119,13 +2119,13 @@ SpirvShader::EmitResult SpirvShader::EmitVectorExtractDynamic(InsnIterator insn,
21192119 SpirvShader::EmitResult SpirvShader::EmitVectorInsertDynamic(InsnIterator insn, EmitState *state) const
21202120 {
21212121 auto &type = getType(insn.resultTypeId());
2122- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
2122+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
21232123
21242124 Operand src(this, state, insn.word(3));
21252125 Operand component(this, state, insn.word(4));
21262126 Operand index(this, state, insn.word(5));
21272127
2128- for(auto i = 0u; i < type.sizeInComponents; i++)
2128+ for(auto i = 0u; i < type.componentCount; i++)
21292129 {
21302130 SIMD::UInt mask = CmpEQ(SIMD::UInt(i), index.UInt(0));
21312131 dst.move(i, (src.UInt(i) & ~mask) | (component.UInt(0) & mask));
@@ -2136,13 +2136,13 @@ SpirvShader::EmitResult SpirvShader::EmitVectorInsertDynamic(InsnIterator insn,
21362136 SpirvShader::EmitResult SpirvShader::EmitSelect(InsnIterator insn, EmitState *state) const
21372137 {
21382138 auto &type = getType(insn.resultTypeId());
2139- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
2139+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
21402140 auto cond = Operand(this, state, insn.word(3));
2141- auto condIsScalar = (getType(cond).sizeInComponents == 1);
2141+ auto condIsScalar = (getType(cond).componentCount == 1);
21422142 auto lhs = Operand(this, state, insn.word(4));
21432143 auto rhs = Operand(this, state, insn.word(5));
21442144
2145- for(auto i = 0u; i < type.sizeInComponents; i++)
2145+ for(auto i = 0u; i < type.componentCount; i++)
21462146 {
21472147 auto sel = cond.Int(condIsScalar ? 0 : i);
21482148 dst.move(i, (sel & lhs.Int(i)) | (~sel & rhs.Int(i))); // TODO: IfThenElse()
@@ -2154,14 +2154,14 @@ SpirvShader::EmitResult SpirvShader::EmitSelect(InsnIterator insn, EmitState *st
21542154 SpirvShader::EmitResult SpirvShader::EmitAny(InsnIterator insn, EmitState *state) const
21552155 {
21562156 auto &type = getType(insn.resultTypeId());
2157- ASSERT(type.sizeInComponents == 1);
2158- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
2157+ ASSERT(type.componentCount == 1);
2158+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
21592159 auto &srcType = getType(getObject(insn.word(3)));
21602160 auto src = Operand(this, state, insn.word(3));
21612161
21622162 SIMD::UInt result = src.UInt(0);
21632163
2164- for(auto i = 1u; i < srcType.sizeInComponents; i++)
2164+ for(auto i = 1u; i < srcType.componentCount; i++)
21652165 {
21662166 result |= src.UInt(i);
21672167 }
@@ -2173,14 +2173,14 @@ SpirvShader::EmitResult SpirvShader::EmitAny(InsnIterator insn, EmitState *state
21732173 SpirvShader::EmitResult SpirvShader::EmitAll(InsnIterator insn, EmitState *state) const
21742174 {
21752175 auto &type = getType(insn.resultTypeId());
2176- ASSERT(type.sizeInComponents == 1);
2177- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
2176+ ASSERT(type.componentCount == 1);
2177+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
21782178 auto &srcType = getType(getObject(insn.word(3)));
21792179 auto src = Operand(this, state, insn.word(3));
21802180
21812181 SIMD::UInt result = src.UInt(0);
21822182
2183- for(auto i = 1u; i < srcType.sizeInComponents; i++)
2183+ for(auto i = 1u; i < srcType.componentCount; i++)
21842184 {
21852185 result &= src.UInt(i);
21862186 }
@@ -2198,7 +2198,7 @@ SpirvShader::EmitResult SpirvShader::EmitAtomicOp(InsnIterator insn, EmitState *
21982198 auto memoryOrder = MemoryOrder(memorySemantics);
21992199 // Where no value is provided (increment/decrement) use an implicit value of 1.
22002200 auto value = (insn.wordCount() == 7) ? Operand(this, state, insn.word(6)).UInt(0) : RValue<SIMD::UInt>(1);
2201- auto &dst = state->createIntermediate(resultId, resultType.sizeInComponents);
2201+ auto &dst = state->createIntermediate(resultId, resultType.componentCount);
22022202 auto ptr = state->getPointer(insn.word(3));
22032203 auto ptrOffsets = ptr.offsets();
22042204
@@ -2270,7 +2270,7 @@ SpirvShader::EmitResult SpirvShader::EmitAtomicCompareExchange(InsnIterator insn
22702270
22712271 auto value = Operand(this, state, insn.word(7));
22722272 auto comparator = Operand(this, state, insn.word(8));
2273- auto &dst = state->createIntermediate(resultId, resultType.sizeInComponents);
2273+ auto &dst = state->createIntermediate(resultId, resultType.componentCount);
22742274 auto ptr = state->getPointer(insn.word(3));
22752275 auto ptrOffsets = ptr.offsets();
22762276
@@ -2295,9 +2295,9 @@ SpirvShader::EmitResult SpirvShader::EmitAtomicCompareExchange(InsnIterator insn
22952295 SpirvShader::EmitResult SpirvShader::EmitCopyObject(InsnIterator insn, EmitState *state) const
22962296 {
22972297 auto type = getType(insn.resultTypeId());
2298- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
2298+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
22992299 auto src = Operand(this, state, insn.word(3));
2300- for(uint32_t i = 0; i < type.sizeInComponents; i++)
2300+ for(uint32_t i = 0; i < type.componentCount; i++)
23012301 {
23022302 dst.move(i, src.Int(i));
23032303 }
@@ -2310,7 +2310,7 @@ SpirvShader::EmitResult SpirvShader::EmitArrayLength(InsnIterator insn, EmitStat
23102310 auto arrayFieldIdx = insn.word(4);
23112311
23122312 auto &resultType = getType(insn.resultTypeId());
2313- ASSERT(resultType.sizeInComponents == 1);
2313+ ASSERT(resultType.componentCount == 1);
23142314 ASSERT(resultType.definition.opcode() == spv::OpTypeInt);
23152315
23162316 auto &structPtrTy = getType(getObject(structPtrId));
@@ -2356,7 +2356,7 @@ uint32_t SpirvShader::GetConstScalarInt(Object::ID id) const
23562356 {
23572357 auto &scopeObj = getObject(id);
23582358 ASSERT(scopeObj.kind == Object::Kind::Constant);
2359- ASSERT(getType(scopeObj).sizeInComponents == 1);
2359+ ASSERT(getType(scopeObj).componentCount == 1);
23602360 return scopeObj.constantValue[0];
23612361 }
23622362
--- a/src/Pipeline/SpirvShader.hpp
+++ b/src/Pipeline/SpirvShader.hpp
@@ -65,17 +65,17 @@ class SpirvRoutine;
6565
6666 // Incrementally constructed complex bundle of rvalues
6767 // Effectively a restricted vector, supporting only:
68-// - allocation to a (runtime-known) fixed size
68+// - allocation to a (runtime-known) fixed component count
6969 // - in-place construction of elements
7070 // - const operator[]
7171 class Intermediate
7272 {
7373 public:
74- Intermediate(uint32_t size)
75- : scalar(new rr::Value *[size])
76- , size(size)
74+ Intermediate(uint32_t componentCount)
75+ : scalar(new rr::Value *[componentCount])
76+ , componentCount(componentCount)
7777 {
78- memset(scalar, 0, sizeof(rr::Value *) * size);
78+ memset(scalar, 0, sizeof(rr::Value *) * componentCount);
7979 }
8080
8181 ~Intermediate()
@@ -94,21 +94,21 @@ public:
9494 // Value retrieval functions.
9595 RValue<SIMD::Float> Float(uint32_t i) const
9696 {
97- ASSERT(i < size);
97+ ASSERT(i < componentCount);
9898 ASSERT(scalar[i] != nullptr);
9999 return As<SIMD::Float>(scalar[i]); // TODO(b/128539387): RValue<SIMD::Float>(scalar)
100100 }
101101
102102 RValue<SIMD::Int> Int(uint32_t i) const
103103 {
104- ASSERT(i < size);
104+ ASSERT(i < componentCount);
105105 ASSERT(scalar[i] != nullptr);
106106 return As<SIMD::Int>(scalar[i]); // TODO(b/128539387): RValue<SIMD::Int>(scalar)
107107 }
108108
109109 RValue<SIMD::UInt> UInt(uint32_t i) const
110110 {
111- ASSERT(i < size);
111+ ASSERT(i < componentCount);
112112 ASSERT(scalar[i] != nullptr);
113113 return As<SIMD::UInt>(scalar[i]); // TODO(b/128539387): RValue<SIMD::UInt>(scalar)
114114 }
@@ -122,13 +122,13 @@ public:
122122 private:
123123 void emplace(uint32_t i, rr::Value *value)
124124 {
125- ASSERT(i < size);
125+ ASSERT(i < componentCount);
126126 ASSERT(scalar[i] == nullptr);
127127 scalar[i] = value;
128128 }
129129
130130 rr::Value **const scalar;
131- uint32_t size;
131+ uint32_t componentCount;
132132 };
133133
134134 class SpirvShader
@@ -259,7 +259,7 @@ public:
259259
260260 InsnIterator definition;
261261 spv::StorageClass storageClass = static_cast<spv::StorageClass>(-1);
262- uint32_t sizeInComponents = 0;
262+ uint32_t componentCount = 0;
263263 bool isBuiltInBlock = false;
264264
265265 // Inner element type for pointers, arrays, vectors and matrices.
@@ -939,11 +939,11 @@ private:
939939
940940 OutOfBoundsBehavior getOutOfBoundsBehavior(spv::StorageClass storageClass) const;
941941
942- Intermediate &createIntermediate(Object::ID id, uint32_t size)
942+ Intermediate &createIntermediate(Object::ID id, uint32_t componentCount)
943943 {
944944 auto it = intermediates.emplace(std::piecewise_construct,
945945 std::forward_as_tuple(id),
946- std::forward_as_tuple(size));
946+ std::forward_as_tuple(componentCount));
947947 ASSERT_MSG(it.second, "Intermediate %d created twice", id.value());
948948 return it.first->second;
949949 }
@@ -1336,9 +1336,9 @@ public:
13361336
13371337 Pointer<Byte> dbgState; // Pointer to a debugger state.
13381338
1339- void createVariable(SpirvShader::Object::ID id, uint32_t size)
1339+ void createVariable(SpirvShader::Object::ID id, uint32_t componentCount)
13401340 {
1341- bool added = variables.emplace(id, Variable(size)).second;
1341+ bool added = variables.emplace(id, Variable(componentCount)).second;
13421342 ASSERT_MSG(added, "Variable %d created twice", id.value());
13431343 }
13441344
--- a/src/Pipeline/SpirvShaderArithmetic.cpp
+++ b/src/Pipeline/SpirvShaderArithmetic.cpp
@@ -23,11 +23,11 @@ namespace sw {
2323 SpirvShader::EmitResult SpirvShader::EmitVectorTimesScalar(InsnIterator insn, EmitState *state) const
2424 {
2525 auto &type = getType(insn.resultTypeId());
26- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
26+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
2727 auto lhs = Operand(this, state, insn.word(3));
2828 auto rhs = Operand(this, state, insn.word(4));
2929
30- for(auto i = 0u; i < type.sizeInComponents; i++)
30+ for(auto i = 0u; i < type.componentCount; i++)
3131 {
3232 dst.move(i, lhs.Float(i) * rhs.Float(0));
3333 }
@@ -38,17 +38,17 @@ SpirvShader::EmitResult SpirvShader::EmitVectorTimesScalar(InsnIterator insn, Em
3838 SpirvShader::EmitResult SpirvShader::EmitMatrixTimesVector(InsnIterator insn, EmitState *state) const
3939 {
4040 auto &type = getType(insn.resultTypeId());
41- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
41+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
4242 auto lhs = Operand(this, state, insn.word(3));
4343 auto rhs = Operand(this, state, insn.word(4));
4444 auto rhsType = getType(rhs);
4545
46- for(auto i = 0u; i < type.sizeInComponents; i++)
46+ for(auto i = 0u; i < type.componentCount; i++)
4747 {
4848 SIMD::Float v = lhs.Float(i) * rhs.Float(0);
49- for(auto j = 1u; j < rhsType.sizeInComponents; j++)
49+ for(auto j = 1u; j < rhsType.componentCount; j++)
5050 {
51- v += lhs.Float(i + type.sizeInComponents * j) * rhs.Float(j);
51+ v += lhs.Float(i + type.componentCount * j) * rhs.Float(j);
5252 }
5353 dst.move(i, v);
5454 }
@@ -59,17 +59,17 @@ SpirvShader::EmitResult SpirvShader::EmitMatrixTimesVector(InsnIterator insn, Em
5959 SpirvShader::EmitResult SpirvShader::EmitVectorTimesMatrix(InsnIterator insn, EmitState *state) const
6060 {
6161 auto &type = getType(insn.resultTypeId());
62- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
62+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
6363 auto lhs = Operand(this, state, insn.word(3));
6464 auto rhs = Operand(this, state, insn.word(4));
6565 auto lhsType = getType(lhs);
6666
67- for(auto i = 0u; i < type.sizeInComponents; i++)
67+ for(auto i = 0u; i < type.componentCount; i++)
6868 {
69- SIMD::Float v = lhs.Float(0) * rhs.Float(i * lhsType.sizeInComponents);
70- for(auto j = 1u; j < lhsType.sizeInComponents; j++)
69+ SIMD::Float v = lhs.Float(0) * rhs.Float(i * lhsType.componentCount);
70+ for(auto j = 1u; j < lhsType.componentCount; j++)
7171 {
72- v += lhs.Float(j) * rhs.Float(i * lhsType.sizeInComponents + j);
72+ v += lhs.Float(j) * rhs.Float(i * lhsType.componentCount + j);
7373 }
7474 dst.move(i, v);
7575 }
@@ -80,7 +80,7 @@ SpirvShader::EmitResult SpirvShader::EmitVectorTimesMatrix(InsnIterator insn, Em
8080 SpirvShader::EmitResult SpirvShader::EmitMatrixTimesMatrix(InsnIterator insn, EmitState *state) const
8181 {
8282 auto &type = getType(insn.resultTypeId());
83- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
83+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
8484 auto lhs = Operand(this, state, insn.word(3));
8585 auto rhs = Operand(this, state, insn.word(4));
8686
@@ -107,7 +107,7 @@ SpirvShader::EmitResult SpirvShader::EmitMatrixTimesMatrix(InsnIterator insn, Em
107107 SpirvShader::EmitResult SpirvShader::EmitOuterProduct(InsnIterator insn, EmitState *state) const
108108 {
109109 auto &type = getType(insn.resultTypeId());
110- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
110+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
111111 auto lhs = Operand(this, state, insn.word(3));
112112 auto rhs = Operand(this, state, insn.word(4));
113113 auto &lhsType = getType(lhs);
@@ -136,11 +136,11 @@ SpirvShader::EmitResult SpirvShader::EmitOuterProduct(InsnIterator insn, EmitSta
136136 SpirvShader::EmitResult SpirvShader::EmitTranspose(InsnIterator insn, EmitState *state) const
137137 {
138138 auto &type = getType(insn.resultTypeId());
139- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
139+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
140140 auto mat = Operand(this, state, insn.word(3));
141141
142142 auto numCols = type.definition.word(3);
143- auto numRows = getType(type.definition.word(2)).sizeInComponents;
143+ auto numRows = getType(type.definition.word(2)).componentCount;
144144
145145 for(auto col = 0u; col < numCols; col++)
146146 {
@@ -156,10 +156,10 @@ SpirvShader::EmitResult SpirvShader::EmitTranspose(InsnIterator insn, EmitState
156156 SpirvShader::EmitResult SpirvShader::EmitUnaryOp(InsnIterator insn, EmitState *state) const
157157 {
158158 auto &type = getType(insn.resultTypeId());
159- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
159+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
160160 auto src = Operand(this, state, insn.word(3));
161161
162- for(auto i = 0u; i < type.sizeInComponents; i++)
162+ for(auto i = 0u; i < type.componentCount; i++)
163163 {
164164 switch(insn.opcode())
165165 {
@@ -318,12 +318,12 @@ SpirvShader::EmitResult SpirvShader::EmitUnaryOp(InsnIterator insn, EmitState *s
318318 SpirvShader::EmitResult SpirvShader::EmitBinaryOp(InsnIterator insn, EmitState *state) const
319319 {
320320 auto &type = getType(insn.resultTypeId());
321- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
321+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
322322 auto &lhsType = getType(getObject(insn.word(3)));
323323 auto lhs = Operand(this, state, insn.word(3));
324324 auto rhs = Operand(this, state, insn.word(4));
325325
326- for(auto i = 0u; i < lhsType.sizeInComponents; i++)
326+ for(auto i = 0u; i < lhsType.componentCount; i++)
327327 {
328328 switch(insn.opcode())
329329 {
@@ -496,19 +496,19 @@ SpirvShader::EmitResult SpirvShader::EmitBinaryOp(InsnIterator insn, EmitState *
496496 // In our flat view then, component i is the i'th component of the first member;
497497 // component i + N is the i'th component of the second member.
498498 dst.move(i, lhs.Int(i) * rhs.Int(i));
499- dst.move(i + lhsType.sizeInComponents, MulHigh(lhs.Int(i), rhs.Int(i)));
499+ dst.move(i + lhsType.componentCount, MulHigh(lhs.Int(i), rhs.Int(i)));
500500 break;
501501 case spv::OpUMulExtended:
502502 dst.move(i, lhs.UInt(i) * rhs.UInt(i));
503- dst.move(i + lhsType.sizeInComponents, MulHigh(lhs.UInt(i), rhs.UInt(i)));
503+ dst.move(i + lhsType.componentCount, MulHigh(lhs.UInt(i), rhs.UInt(i)));
504504 break;
505505 case spv::OpIAddCarry:
506506 dst.move(i, lhs.UInt(i) + rhs.UInt(i));
507- dst.move(i + lhsType.sizeInComponents, CmpLT(dst.UInt(i), lhs.UInt(i)) >> 31);
507+ dst.move(i + lhsType.componentCount, CmpLT(dst.UInt(i), lhs.UInt(i)) >> 31);
508508 break;
509509 case spv::OpISubBorrow:
510510 dst.move(i, lhs.UInt(i) - rhs.UInt(i));
511- dst.move(i + lhsType.sizeInComponents, CmpLT(lhs.UInt(i), rhs.UInt(i)) >> 31);
511+ dst.move(i + lhsType.componentCount, CmpLT(lhs.UInt(i), rhs.UInt(i)) >> 31);
512512 break;
513513 default:
514514 UNREACHABLE("%s", OpcodeName(insn.opcode()).c_str());
@@ -521,13 +521,13 @@ SpirvShader::EmitResult SpirvShader::EmitBinaryOp(InsnIterator insn, EmitState *
521521 SpirvShader::EmitResult SpirvShader::EmitDot(InsnIterator insn, EmitState *state) const
522522 {
523523 auto &type = getType(insn.resultTypeId());
524- ASSERT(type.sizeInComponents == 1);
525- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
524+ ASSERT(type.componentCount == 1);
525+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
526526 auto &lhsType = getType(getObject(insn.word(3)));
527527 auto lhs = Operand(this, state, insn.word(3));
528528 auto rhs = Operand(this, state, insn.word(4));
529529
530- dst.move(0, Dot(lhsType.sizeInComponents, lhs, rhs));
530+ dst.move(0, Dot(lhsType.componentCount, lhs, rhs));
531531 return EmitResult::Continue;
532532 }
533533
--- a/src/Pipeline/SpirvShaderControlFlow.cpp
+++ b/src/Pipeline/SpirvShaderControlFlow.cpp
@@ -496,7 +496,7 @@ SpirvShader::EmitResult SpirvShader::EmitBranchConditional(InsnIterator insn, Em
496496 auto falseBlockId = Block::ID(block.branchInstruction.word(3));
497497
498498 auto cond = Operand(this, state, condId);
499- ASSERT_MSG(getType(cond).sizeInComponents == 1, "Condition must be a Boolean type scalar");
499+ ASSERT_MSG(getType(cond).componentCount == 1, "Condition must be a Boolean type scalar");
500500
501501 // TODO: Optimize for case where all lanes take same path.
502502
@@ -515,7 +515,7 @@ SpirvShader::EmitResult SpirvShader::EmitSwitch(InsnIterator insn, EmitState *st
515515 auto selId = Object::ID(block.branchInstruction.word(1));
516516
517517 auto sel = Operand(this, state, selId);
518- ASSERT_MSG(getType(sel).sizeInComponents == 1, "Selector must be a scalar");
518+ ASSERT_MSG(getType(sel).componentCount == 1, "Selector must be a scalar");
519519
520520 auto numCases = (block.branchInstruction.wordCount() - 3) / 2;
521521
@@ -650,8 +650,8 @@ void SpirvShader::LoadPhi(InsnIterator insn, EmitState *state) const
650650 ASSERT(storageIt != state->routine->phis.end());
651651 auto &storage = storageIt->second;
652652
653- auto &dst = state->createIntermediate(objectId, type.sizeInComponents);
654- for(uint32_t i = 0; i < type.sizeInComponents; i++)
653+ auto &dst = state->createIntermediate(objectId, type.componentCount);
654+ for(uint32_t i = 0; i < type.componentCount; i++)
655655 {
656656 dst.move(i, storage[i]);
657657 }
@@ -680,7 +680,7 @@ void SpirvShader::StorePhi(Block::ID currentBlock, InsnIterator insn, EmitState
680680 auto mask = GetActiveLaneMaskEdge(state, blockId, currentBlock);
681681 auto in = Operand(this, state, varId);
682682
683- for(uint32_t i = 0; i < type.sizeInComponents; i++)
683+ for(uint32_t i = 0; i < type.componentCount; i++)
684684 {
685685 storage[i] = As<SIMD::Float>((As<SIMD::Int>(storage[i]) & ~mask) | (in.Int(i) & mask));
686686 }
--- a/src/Pipeline/SpirvShaderGLSLstd450.cpp
+++ b/src/Pipeline/SpirvShaderGLSLstd450.cpp
@@ -28,7 +28,7 @@ namespace sw {
2828 SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitState *state) const
2929 {
3030 auto &type = getType(insn.resultTypeId());
31- auto &dst = state->createIntermediate(insn.resultId(), type.sizeInComponents);
31+ auto &dst = state->createIntermediate(insn.resultId(), type.componentCount);
3232 auto extInstIndex = static_cast<GLSLstd450>(insn.word(4));
3333
3434 switch(extInstIndex)
@@ -36,7 +36,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
3636 case GLSLstd450FAbs:
3737 {
3838 auto src = Operand(this, state, insn.word(5));
39- for(auto i = 0u; i < type.sizeInComponents; i++)
39+ for(auto i = 0u; i < type.componentCount; i++)
4040 {
4141 dst.move(i, Abs(src.Float(i)));
4242 }
@@ -45,7 +45,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
4545 case GLSLstd450SAbs:
4646 {
4747 auto src = Operand(this, state, insn.word(5));
48- for(auto i = 0u; i < type.sizeInComponents; i++)
48+ for(auto i = 0u; i < type.componentCount; i++)
4949 {
5050 dst.move(i, Abs(src.Int(i)));
5151 }
@@ -63,7 +63,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
6363 case GLSLstd450Floor:
6464 {
6565 auto src = Operand(this, state, insn.word(5));
66- for(auto i = 0u; i < type.sizeInComponents; i++)
66+ for(auto i = 0u; i < type.componentCount; i++)
6767 {
6868 dst.move(i, Floor(src.Float(i)));
6969 }
@@ -72,7 +72,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
7272 case GLSLstd450Trunc:
7373 {
7474 auto src = Operand(this, state, insn.word(5));
75- for(auto i = 0u; i < type.sizeInComponents; i++)
75+ for(auto i = 0u; i < type.componentCount; i++)
7676 {
7777 dst.move(i, Trunc(src.Float(i)));
7878 }
@@ -81,7 +81,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
8181 case GLSLstd450Ceil:
8282 {
8383 auto src = Operand(this, state, insn.word(5));
84- for(auto i = 0u; i < type.sizeInComponents; i++)
84+ for(auto i = 0u; i < type.componentCount; i++)
8585 {
8686 dst.move(i, Ceil(src.Float(i)));
8787 }
@@ -90,7 +90,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
9090 case GLSLstd450Fract:
9191 {
9292 auto src = Operand(this, state, insn.word(5));
93- for(auto i = 0u; i < type.sizeInComponents; i++)
93+ for(auto i = 0u; i < type.componentCount; i++)
9494 {
9595 dst.move(i, Frac(src.Float(i)));
9696 }
@@ -99,7 +99,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
9999 case GLSLstd450Round:
100100 {
101101 auto src = Operand(this, state, insn.word(5));
102- for(auto i = 0u; i < type.sizeInComponents; i++)
102+ for(auto i = 0u; i < type.componentCount; i++)
103103 {
104104 dst.move(i, Round(src.Float(i)));
105105 }
@@ -108,7 +108,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
108108 case GLSLstd450RoundEven:
109109 {
110110 auto src = Operand(this, state, insn.word(5));
111- for(auto i = 0u; i < type.sizeInComponents; i++)
111+ for(auto i = 0u; i < type.componentCount; i++)
112112 {
113113 auto x = Round(src.Float(i));
114114 // dst = round(src) + ((round(src) < src) * 2 - 1) * (fract(src) == 0.5) * isOdd(round(src));
@@ -121,7 +121,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
121121 {
122122 auto lhs = Operand(this, state, insn.word(5));
123123 auto rhs = Operand(this, state, insn.word(6));
124- for(auto i = 0u; i < type.sizeInComponents; i++)
124+ for(auto i = 0u; i < type.componentCount; i++)
125125 {
126126 dst.move(i, Min(lhs.Float(i), rhs.Float(i)));
127127 }
@@ -131,7 +131,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
131131 {
132132 auto lhs = Operand(this, state, insn.word(5));
133133 auto rhs = Operand(this, state, insn.word(6));
134- for(auto i = 0u; i < type.sizeInComponents; i++)
134+ for(auto i = 0u; i < type.componentCount; i++)
135135 {
136136 dst.move(i, Max(lhs.Float(i), rhs.Float(i)));
137137 }
@@ -141,7 +141,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
141141 {
142142 auto lhs = Operand(this, state, insn.word(5));
143143 auto rhs = Operand(this, state, insn.word(6));
144- for(auto i = 0u; i < type.sizeInComponents; i++)
144+ for(auto i = 0u; i < type.componentCount; i++)
145145 {
146146 dst.move(i, Min(lhs.Int(i), rhs.Int(i)));
147147 }
@@ -151,7 +151,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
151151 {
152152 auto lhs = Operand(this, state, insn.word(5));
153153 auto rhs = Operand(this, state, insn.word(6));
154- for(auto i = 0u; i < type.sizeInComponents; i++)
154+ for(auto i = 0u; i < type.componentCount; i++)
155155 {
156156 dst.move(i, Max(lhs.Int(i), rhs.Int(i)));
157157 }
@@ -161,7 +161,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
161161 {
162162 auto lhs = Operand(this, state, insn.word(5));
163163 auto rhs = Operand(this, state, insn.word(6));
164- for(auto i = 0u; i < type.sizeInComponents; i++)
164+ for(auto i = 0u; i < type.componentCount; i++)
165165 {
166166 dst.move(i, Min(lhs.UInt(i), rhs.UInt(i)));
167167 }
@@ -171,7 +171,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
171171 {
172172 auto lhs = Operand(this, state, insn.word(5));
173173 auto rhs = Operand(this, state, insn.word(6));
174- for(auto i = 0u; i < type.sizeInComponents; i++)
174+ for(auto i = 0u; i < type.componentCount; i++)
175175 {
176176 dst.move(i, Max(lhs.UInt(i), rhs.UInt(i)));
177177 }
@@ -181,7 +181,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
181181 {
182182 auto edge = Operand(this, state, insn.word(5));
183183 auto x = Operand(this, state, insn.word(6));
184- for(auto i = 0u; i < type.sizeInComponents; i++)
184+ for(auto i = 0u; i < type.componentCount; i++)
185185 {
186186 dst.move(i, CmpNLT(x.Float(i), edge.Float(i)) & As<SIMD::Int>(SIMD::Float(1.0f)));
187187 }
@@ -192,7 +192,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
192192 auto edge0 = Operand(this, state, insn.word(5));
193193 auto edge1 = Operand(this, state, insn.word(6));
194194 auto x = Operand(this, state, insn.word(7));
195- for(auto i = 0u; i < type.sizeInComponents; i++)
195+ for(auto i = 0u; i < type.componentCount; i++)
196196 {
197197 auto tx = Min(Max((x.Float(i) - edge0.Float(i)) /
198198 (edge1.Float(i) - edge0.Float(i)),
@@ -207,7 +207,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
207207 auto x = Operand(this, state, insn.word(5));
208208 auto y = Operand(this, state, insn.word(6));
209209 auto a = Operand(this, state, insn.word(7));
210- for(auto i = 0u; i < type.sizeInComponents; i++)
210+ for(auto i = 0u; i < type.componentCount; i++)
211211 {
212212 dst.move(i, a.Float(i) * (y.Float(i) - x.Float(i)) + x.Float(i));
213213 }
@@ -218,7 +218,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
218218 auto x = Operand(this, state, insn.word(5));
219219 auto minVal = Operand(this, state, insn.word(6));
220220 auto maxVal = Operand(this, state, insn.word(7));
221- for(auto i = 0u; i < type.sizeInComponents; i++)
221+ for(auto i = 0u; i < type.componentCount; i++)
222222 {
223223 dst.move(i, Min(Max(x.Float(i), minVal.Float(i)), maxVal.Float(i)));
224224 }
@@ -229,7 +229,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
229229 auto x = Operand(this, state, insn.word(5));
230230 auto minVal = Operand(this, state, insn.word(6));
231231 auto maxVal = Operand(this, state, insn.word(7));
232- for(auto i = 0u; i < type.sizeInComponents; i++)
232+ for(auto i = 0u; i < type.componentCount; i++)
233233 {
234234 dst.move(i, Min(Max(x.Int(i), minVal.Int(i)), maxVal.Int(i)));
235235 }
@@ -240,7 +240,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
240240 auto x = Operand(this, state, insn.word(5));
241241 auto minVal = Operand(this, state, insn.word(6));
242242 auto maxVal = Operand(this, state, insn.word(7));
243- for(auto i = 0u; i < type.sizeInComponents; i++)
243+ for(auto i = 0u; i < type.componentCount; i++)
244244 {
245245 dst.move(i, Min(Max(x.UInt(i), minVal.UInt(i)), maxVal.UInt(i)));
246246 }
@@ -249,7 +249,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
249249 case GLSLstd450FSign:
250250 {
251251 auto src = Operand(this, state, insn.word(5));
252- for(auto i = 0u; i < type.sizeInComponents; i++)
252+ for(auto i = 0u; i < type.componentCount; i++)
253253 {
254254 auto neg = As<SIMD::Int>(CmpLT(src.Float(i), SIMD::Float(-0.0f))) & As<SIMD::Int>(SIMD::Float(-1.0f));
255255 auto pos = As<SIMD::Int>(CmpNLE(src.Float(i), SIMD::Float(+0.0f))) & As<SIMD::Int>(SIMD::Float(1.0f));
@@ -260,7 +260,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
260260 case GLSLstd450SSign:
261261 {
262262 auto src = Operand(this, state, insn.word(5));
263- for(auto i = 0u; i < type.sizeInComponents; i++)
263+ for(auto i = 0u; i < type.componentCount; i++)
264264 {
265265 auto neg = CmpLT(src.Int(i), SIMD::Int(0)) & SIMD::Int(-1);
266266 auto pos = CmpNLE(src.Int(i), SIMD::Int(0)) & SIMD::Int(1);
@@ -273,9 +273,9 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
273273 auto I = Operand(this, state, insn.word(5));
274274 auto N = Operand(this, state, insn.word(6));
275275
276- SIMD::Float d = Dot(type.sizeInComponents, I, N);
276+ SIMD::Float d = Dot(type.componentCount, I, N);
277277
278- for(auto i = 0u; i < type.sizeInComponents; i++)
278+ for(auto i = 0u; i < type.componentCount; i++)
279279 {
280280 dst.move(i, I.Float(i) - SIMD::Float(2.0f) * d * N.Float(i));
281281 }
@@ -287,12 +287,12 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
287287 auto N = Operand(this, state, insn.word(6));
288288 auto eta = Operand(this, state, insn.word(7));
289289
290- SIMD::Float d = Dot(type.sizeInComponents, I, N);
290+ SIMD::Float d = Dot(type.componentCount, I, N);
291291 SIMD::Float k = SIMD::Float(1.0f) - eta.Float(0) * eta.Float(0) * (SIMD::Float(1.0f) - d * d);
292292 SIMD::Int pos = CmpNLT(k, SIMD::Float(0.0f));
293293 SIMD::Float t = (eta.Float(0) * d + Sqrt(k));
294294
295- for(auto i = 0u; i < type.sizeInComponents; i++)
295+ for(auto i = 0u; i < type.componentCount; i++)
296296 {
297297 dst.move(i, pos & As<SIMD::Int>(eta.Float(0) * I.Float(i) - t * N.Float(i)));
298298 }
@@ -304,10 +304,10 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
304304 auto I = Operand(this, state, insn.word(6));
305305 auto Nref = Operand(this, state, insn.word(7));
306306
307- SIMD::Float d = Dot(type.sizeInComponents, I, Nref);
307+ SIMD::Float d = Dot(type.componentCount, I, Nref);
308308 SIMD::Int neg = CmpLT(d, SIMD::Float(0.0f));
309309
310- for(auto i = 0u; i < type.sizeInComponents; i++)
310+ for(auto i = 0u; i < type.componentCount; i++)
311311 {
312312 auto n = N.Float(i);
313313 dst.move(i, (neg & As<SIMD::Int>(n)) | (~neg & As<SIMD::Int>(-n)));
@@ -317,7 +317,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
317317 case GLSLstd450Length:
318318 {
319319 auto x = Operand(this, state, insn.word(5));
320- SIMD::Float d = Dot(getType(getObject(insn.word(5))).sizeInComponents, x, x);
320+ SIMD::Float d = Dot(getType(getObject(insn.word(5))).componentCount, x, x);
321321
322322 dst.move(0, Sqrt(d));
323323 break;
@@ -325,10 +325,10 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
325325 case GLSLstd450Normalize:
326326 {
327327 auto x = Operand(this, state, insn.word(5));
328- SIMD::Float d = Dot(getType(getObject(insn.word(5))).sizeInComponents, x, x);
328+ SIMD::Float d = Dot(getType(getObject(insn.word(5))).componentCount, x, x);
329329 SIMD::Float invLength = SIMD::Float(1.0f) / Sqrt(d);
330330
331- for(auto i = 0u; i < type.sizeInComponents; i++)
331+ for(auto i = 0u; i < type.componentCount; i++)
332332 {
333333 dst.move(i, invLength * x.Float(i));
334334 }
@@ -343,7 +343,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
343343 // sqrt(dot(p0-p1, p0-p1))
344344 SIMD::Float d = (p0.Float(0) - p1.Float(0)) * (p0.Float(0) - p1.Float(0));
345345
346- for(auto i = 1u; i < p0Type.sizeInComponents; i++)
346+ for(auto i = 1u; i < p0Type.componentCount; i++)
347347 {
348348 d += (p0.Float(i) - p1.Float(i)) * (p0.Float(i) - p1.Float(i));
349349 }
@@ -364,7 +364,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
364364 // - Eliminate lane masking and assume interleaving.
365365 auto robustness = OutOfBoundsBehavior::UndefinedBehavior;
366366
367- for(auto i = 0u; i < type.sizeInComponents; i++)
367+ for(auto i = 0u; i < type.componentCount; i++)
368368 {
369369 SIMD::Float whole, frac;
370370 std::tie(whole, frac) = Modf(val.Float(i));
@@ -380,12 +380,12 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
380380 auto val = Operand(this, state, insn.word(5));
381381 auto valTy = getType(val);
382382
383- for(auto i = 0u; i < valTy.sizeInComponents; i++)
383+ for(auto i = 0u; i < valTy.componentCount; i++)
384384 {
385385 SIMD::Float whole, frac;
386386 std::tie(whole, frac) = Modf(val.Float(i));
387387 dst.move(i, frac);
388- dst.move(i + valTy.sizeInComponents, whole);
388+ dst.move(i + valTy.componentCount, whole);
389389 }
390390 break;
391391 }
@@ -491,7 +491,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
491491 auto a = Operand(this, state, insn.word(5));
492492 auto b = Operand(this, state, insn.word(6));
493493 auto c = Operand(this, state, insn.word(7));
494- for(auto i = 0u; i < type.sizeInComponents; i++)
494+ for(auto i = 0u; i < type.componentCount; i++)
495495 {
496496 dst.move(i, FMA(a.Float(i), b.Float(i), c.Float(i)));
497497 }
@@ -510,7 +510,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
510510 // - Eliminate lane masking and assume interleaving.
511511 auto robustness = OutOfBoundsBehavior::UndefinedBehavior;
512512
513- for(auto i = 0u; i < type.sizeInComponents; i++)
513+ for(auto i = 0u; i < type.componentCount; i++)
514514 {
515515 SIMD::Float significand;
516516 SIMD::Int exponent;
@@ -527,7 +527,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
527527 case GLSLstd450FrexpStruct:
528528 {
529529 auto val = Operand(this, state, insn.word(5));
530- auto numComponents = getType(val).sizeInComponents;
530+ auto numComponents = getType(val).componentCount;
531531 for(auto i = 0u; i < numComponents; i++)
532532 {
533533 auto significandAndExponent = Frexp(val.Float(i));
@@ -540,7 +540,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
540540 {
541541 auto significand = Operand(this, state, insn.word(5));
542542 auto exponent = Operand(this, state, insn.word(6));
543- for(auto i = 0u; i < type.sizeInComponents; i++)
543+ for(auto i = 0u; i < type.componentCount; i++)
544544 {
545545 // Assumes IEEE 754
546546 auto in = significand.Float(i);
@@ -573,7 +573,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
573573 case GLSLstd450Radians:
574574 {
575575 auto degrees = Operand(this, state, insn.word(5));
576- for(auto i = 0u; i < type.sizeInComponents; i++)
576+ for(auto i = 0u; i < type.componentCount; i++)
577577 {
578578 dst.move(i, degrees.Float(i) * SIMD::Float(PI / 180.0f));
579579 }
@@ -582,7 +582,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
582582 case GLSLstd450Degrees:
583583 {
584584 auto radians = Operand(this, state, insn.word(5));
585- for(auto i = 0u; i < type.sizeInComponents; i++)
585+ for(auto i = 0u; i < type.componentCount; i++)
586586 {
587587 dst.move(i, radians.Float(i) * SIMD::Float(180.0f / PI));
588588 }
@@ -591,7 +591,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
591591 case GLSLstd450Sin:
592592 {
593593 auto radians = Operand(this, state, insn.word(5));
594- for(auto i = 0u; i < type.sizeInComponents; i++)
594+ for(auto i = 0u; i < type.componentCount; i++)
595595 {
596596 dst.move(i, Sin(radians.Float(i)));
597597 }
@@ -600,7 +600,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
600600 case GLSLstd450Cos:
601601 {
602602 auto radians = Operand(this, state, insn.word(5));
603- for(auto i = 0u; i < type.sizeInComponents; i++)
603+ for(auto i = 0u; i < type.componentCount; i++)
604604 {
605605 dst.move(i, Cos(radians.Float(i)));
606606 }
@@ -609,7 +609,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
609609 case GLSLstd450Tan:
610610 {
611611 auto radians = Operand(this, state, insn.word(5));
612- for(auto i = 0u; i < type.sizeInComponents; i++)
612+ for(auto i = 0u; i < type.componentCount; i++)
613613 {
614614 dst.move(i, Tan(radians.Float(i)));
615615 }
@@ -618,7 +618,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
618618 case GLSLstd450Asin:
619619 {
620620 auto val = Operand(this, state, insn.word(5));
621- for(auto i = 0u; i < type.sizeInComponents; i++)
621+ for(auto i = 0u; i < type.componentCount; i++)
622622 {
623623 dst.move(i, Asin(val.Float(i)));
624624 }
@@ -627,7 +627,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
627627 case GLSLstd450Acos:
628628 {
629629 auto val = Operand(this, state, insn.word(5));
630- for(auto i = 0u; i < type.sizeInComponents; i++)
630+ for(auto i = 0u; i < type.componentCount; i++)
631631 {
632632 dst.move(i, Acos(val.Float(i)));
633633 }
@@ -636,7 +636,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
636636 case GLSLstd450Atan:
637637 {
638638 auto val = Operand(this, state, insn.word(5));
639- for(auto i = 0u; i < type.sizeInComponents; i++)
639+ for(auto i = 0u; i < type.componentCount; i++)
640640 {
641641 dst.move(i, Atan(val.Float(i)));
642642 }
@@ -645,7 +645,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
645645 case GLSLstd450Sinh:
646646 {
647647 auto val = Operand(this, state, insn.word(5));
648- for(auto i = 0u; i < type.sizeInComponents; i++)
648+ for(auto i = 0u; i < type.componentCount; i++)
649649 {
650650 dst.move(i, Sinh(val.Float(i)));
651651 }
@@ -654,7 +654,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
654654 case GLSLstd450Cosh:
655655 {
656656 auto val = Operand(this, state, insn.word(5));
657- for(auto i = 0u; i < type.sizeInComponents; i++)
657+ for(auto i = 0u; i < type.componentCount; i++)
658658 {
659659 dst.move(i, Cosh(val.Float(i)));
660660 }
@@ -663,7 +663,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
663663 case GLSLstd450Tanh:
664664 {
665665 auto val = Operand(this, state, insn.word(5));
666- for(auto i = 0u; i < type.sizeInComponents; i++)
666+ for(auto i = 0u; i < type.componentCount; i++)
667667 {
668668 dst.move(i, Tanh(val.Float(i)));
669669 }
@@ -672,7 +672,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
672672 case GLSLstd450Asinh:
673673 {
674674 auto val = Operand(this, state, insn.word(5));
675- for(auto i = 0u; i < type.sizeInComponents; i++)
675+ for(auto i = 0u; i < type.componentCount; i++)
676676 {
677677 dst.move(i, Asinh(val.Float(i)));
678678 }
@@ -681,7 +681,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
681681 case GLSLstd450Acosh:
682682 {
683683 auto val = Operand(this, state, insn.word(5));
684- for(auto i = 0u; i < type.sizeInComponents; i++)
684+ for(auto i = 0u; i < type.componentCount; i++)
685685 {
686686 dst.move(i, Acosh(val.Float(i)));
687687 }
@@ -690,7 +690,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
690690 case GLSLstd450Atanh:
691691 {
692692 auto val = Operand(this, state, insn.word(5));
693- for(auto i = 0u; i < type.sizeInComponents; i++)
693+ for(auto i = 0u; i < type.componentCount; i++)
694694 {
695695 dst.move(i, Atanh(val.Float(i)));
696696 }
@@ -700,7 +700,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
700700 {
701701 auto x = Operand(this, state, insn.word(5));
702702 auto y = Operand(this, state, insn.word(6));
703- for(auto i = 0u; i < type.sizeInComponents; i++)
703+ for(auto i = 0u; i < type.componentCount; i++)
704704 {
705705 dst.move(i, Atan2(x.Float(i), y.Float(i)));
706706 }
@@ -710,7 +710,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
710710 {
711711 auto x = Operand(this, state, insn.word(5));
712712 auto y = Operand(this, state, insn.word(6));
713- for(auto i = 0u; i < type.sizeInComponents; i++)
713+ for(auto i = 0u; i < type.componentCount; i++)
714714 {
715715 dst.move(i, Pow(x.Float(i), y.Float(i)));
716716 }
@@ -719,7 +719,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
719719 case GLSLstd450Exp:
720720 {
721721 auto val = Operand(this, state, insn.word(5));
722- for(auto i = 0u; i < type.sizeInComponents; i++)
722+ for(auto i = 0u; i < type.componentCount; i++)
723723 {
724724 dst.move(i, Exp(val.Float(i)));
725725 }
@@ -728,7 +728,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
728728 case GLSLstd450Log:
729729 {
730730 auto val = Operand(this, state, insn.word(5));
731- for(auto i = 0u; i < type.sizeInComponents; i++)
731+ for(auto i = 0u; i < type.componentCount; i++)
732732 {
733733 dst.move(i, Log(val.Float(i)));
734734 }
@@ -737,7 +737,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
737737 case GLSLstd450Exp2:
738738 {
739739 auto val = Operand(this, state, insn.word(5));
740- for(auto i = 0u; i < type.sizeInComponents; i++)
740+ for(auto i = 0u; i < type.componentCount; i++)
741741 {
742742 dst.move(i, Exp2(val.Float(i)));
743743 }
@@ -746,7 +746,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
746746 case GLSLstd450Log2:
747747 {
748748 auto val = Operand(this, state, insn.word(5));
749- for(auto i = 0u; i < type.sizeInComponents; i++)
749+ for(auto i = 0u; i < type.componentCount; i++)
750750 {
751751 dst.move(i, Log2(val.Float(i)));
752752 }
@@ -755,7 +755,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
755755 case GLSLstd450Sqrt:
756756 {
757757 auto val = Operand(this, state, insn.word(5));
758- for(auto i = 0u; i < type.sizeInComponents; i++)
758+ for(auto i = 0u; i < type.componentCount; i++)
759759 {
760760 dst.move(i, Sqrt(val.Float(i)));
761761 }
@@ -768,14 +768,14 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
768768 ApplyDecorationsForId(&d, insn.word(5));
769769 if(d.RelaxedPrecision)
770770 {
771- for(auto i = 0u; i < type.sizeInComponents; i++)
771+ for(auto i = 0u; i < type.componentCount; i++)
772772 {
773773 dst.move(i, RcpSqrt_pp(val.Float(i)));
774774 }
775775 }
776776 else
777777 {
778- for(auto i = 0u; i < type.sizeInComponents; i++)
778+ for(auto i = 0u; i < type.componentCount; i++)
779779 {
780780 dst.move(i, SIMD::Float(1.0f) / Sqrt(val.Float(i)));
781781 }
@@ -785,7 +785,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
785785 case GLSLstd450Determinant:
786786 {
787787 auto mat = Operand(this, state, insn.word(5));
788- auto numComponents = getType(mat).sizeInComponents;
788+ auto numComponents = getType(mat).componentCount;
789789 switch(numComponents)
790790 {
791791 case 4: // 2x2
@@ -814,7 +814,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
814814 case GLSLstd450MatrixInverse:
815815 {
816816 auto mat = Operand(this, state, insn.word(5));
817- auto numComponents = getType(mat).sizeInComponents;
817+ auto numComponents = getType(mat).componentCount;
818818 switch(numComponents)
819819 {
820820 case 4: // 2x2
@@ -876,7 +876,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
876876 case GLSLstd450FindILsb:
877877 {
878878 auto val = Operand(this, state, insn.word(5));
879- for(auto i = 0u; i < type.sizeInComponents; i++)
879+ for(auto i = 0u; i < type.componentCount; i++)
880880 {
881881 auto v = val.UInt(i);
882882 dst.move(i, Cttz(v, true) | CmpEQ(v, SIMD::UInt(0)));
@@ -886,7 +886,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
886886 case GLSLstd450FindSMsb:
887887 {
888888 auto val = Operand(this, state, insn.word(5));
889- for(auto i = 0u; i < type.sizeInComponents; i++)
889+ for(auto i = 0u; i < type.componentCount; i++)
890890 {
891891 auto v = val.UInt(i) ^ As<SIMD::UInt>(CmpLT(val.Int(i), SIMD::Int(0)));
892892 dst.move(i, SIMD::UInt(31) - Ctlz(v, false));
@@ -896,7 +896,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
896896 case GLSLstd450FindUMsb:
897897 {
898898 auto val = Operand(this, state, insn.word(5));
899- for(auto i = 0u; i < type.sizeInComponents; i++)
899+ for(auto i = 0u; i < type.componentCount; i++)
900900 {
901901 dst.move(i, SIMD::UInt(31) - Ctlz(val.UInt(i), false));
902902 }
@@ -921,7 +921,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
921921 {
922922 auto x = Operand(this, state, insn.word(5));
923923 auto y = Operand(this, state, insn.word(6));
924- for(auto i = 0u; i < type.sizeInComponents; i++)
924+ for(auto i = 0u; i < type.componentCount; i++)
925925 {
926926 dst.move(i, NMin(x.Float(i), y.Float(i)));
927927 }
@@ -931,7 +931,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
931931 {
932932 auto x = Operand(this, state, insn.word(5));
933933 auto y = Operand(this, state, insn.word(6));
934- for(auto i = 0u; i < type.sizeInComponents; i++)
934+ for(auto i = 0u; i < type.componentCount; i++)
935935 {
936936 dst.move(i, NMax(x.Float(i), y.Float(i)));
937937 }
@@ -942,7 +942,7 @@ SpirvShader::EmitResult SpirvShader::EmitExtGLSLstd450(InsnIterator insn, EmitSt
942942 auto x = Operand(this, state, insn.word(5));
943943 auto minVal = Operand(this, state, insn.word(6));
944944 auto maxVal = Operand(this, state, insn.word(7));
945- for(auto i = 0u; i < type.sizeInComponents; i++)
945+ for(auto i = 0u; i < type.componentCount; i++)
946946 {
947947 auto clamp = NMin(NMax(x.Float(i), minVal.Float(i)), maxVal.Float(i));
948948 dst.move(i, clamp);
--- a/src/Pipeline/SpirvShaderGroup.cpp
+++ b/src/Pipeline/SpirvShaderGroup.cpp
@@ -36,7 +36,7 @@ struct SpirvShader::Impl::Group
3636 {
3737 SpirvShader::Operand value(shader, state, insn.word(5));
3838 auto &type = shader->getType(SpirvShader::Type::ID(insn.word(1)));
39- for(auto i = 0u; i < type.sizeInComponents; i++)
39+ for(auto i = 0u; i < type.componentCount; i++)
4040 {
4141 auto mask = As<SIMD::UInt>(state->activeLaneMask());
4242 auto identity = TYPE(identityValue);
@@ -85,7 +85,7 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
8585 auto scope = spv::Scope(GetConstScalarInt(insn.word(3)));
8686 ASSERT_MSG(scope == spv::ScopeSubgroup, "Scope for Non Uniform Group Operations must be Subgroup for Vulkan 1.1");
8787
88- auto &dst = state->createIntermediate(resultId, type.sizeInComponents);
88+ auto &dst = state->createIntermediate(resultId, type.componentCount);
8989
9090 switch(insn.opcode())
9191 {
@@ -122,7 +122,7 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
122122 auto res = SIMD::UInt(0xffffffff);
123123 SIMD::UInt active = As<SIMD::UInt>(state->activeLaneMask());
124124 SIMD::UInt inactive = ~active;
125- for(auto i = 0u; i < type.sizeInComponents; i++)
125+ for(auto i = 0u; i < type.componentCount; i++)
126126 {
127127 SIMD::UInt v = value.UInt(i) & active;
128128 SIMD::UInt filled = v;
@@ -142,7 +142,7 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
142142 auto id = SIMD::Int(GetConstScalarInt(insn.word(5)));
143143 Operand value(this, state, valueId);
144144 auto mask = CmpEQ(id, SIMD::Int(0, 1, 2, 3));
145- for(auto i = 0u; i < type.sizeInComponents; i++)
145+ for(auto i = 0u; i < type.componentCount; i++)
146146 {
147147 dst.move(i, OrAll(value.Int(i) & mask));
148148 }
@@ -160,7 +160,7 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
160160 // elect = active & ~(active.Oxyz | active.OOxy | active.OOOx)
161161 auto v0111 = SIMD::Int(0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
162162 auto elect = active & ~(v0111 & (active.xxyz | active.xxxy | active.xxxx));
163- for(auto i = 0u; i < type.sizeInComponents; i++)
163+ for(auto i = 0u; i < type.componentCount; i++)
164164 {
165165 dst.move(i, OrAll(value.Int(i) & elect));
166166 }
@@ -169,7 +169,7 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
169169
170170 case spv::OpGroupNonUniformBallot:
171171 {
172- ASSERT(type.sizeInComponents == 4);
172+ ASSERT(type.componentCount == 4);
173173 Operand predicate(this, state, insn.word(4));
174174 dst.move(0, SIMD::Int(SignMask(state->activeLaneMask() & predicate.Int(0))));
175175 dst.move(1, SIMD::Int(0));
@@ -181,8 +181,8 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
181181 case spv::OpGroupNonUniformInverseBallot:
182182 {
183183 auto valueId = Object::ID(insn.word(4));
184- ASSERT(type.sizeInComponents == 1);
185- ASSERT(getType(getObject(valueId)).sizeInComponents == 4);
184+ ASSERT(type.componentCount == 1);
185+ ASSERT(getType(getObject(valueId)).componentCount == 4);
186186 Operand value(this, state, valueId);
187187 auto bit = (value.Int(0) >> SIMD::Int(0, 1, 2, 3)) & SIMD::Int(1);
188188 dst.move(0, -bit);
@@ -193,9 +193,9 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
193193 {
194194 auto valueId = Object::ID(insn.word(4));
195195 auto indexId = Object::ID(insn.word(5));
196- ASSERT(type.sizeInComponents == 1);
197- ASSERT(getType(getObject(valueId)).sizeInComponents == 4);
198- ASSERT(getType(getObject(indexId)).sizeInComponents == 1);
196+ ASSERT(type.componentCount == 1);
197+ ASSERT(getType(getObject(valueId)).componentCount == 4);
198+ ASSERT(getType(getObject(indexId)).componentCount == 1);
199199 Operand value(this, state, valueId);
200200 Operand index(this, state, indexId);
201201 auto vecIdx = index.Int(0) / SIMD::Int(32);
@@ -212,8 +212,8 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
212212 {
213213 auto operation = spv::GroupOperation(insn.word(4));
214214 auto valueId = Object::ID(insn.word(5));
215- ASSERT(type.sizeInComponents == 1);
216- ASSERT(getType(getObject(valueId)).sizeInComponents == 4);
215+ ASSERT(type.componentCount == 1);
216+ ASSERT(getType(getObject(valueId)).componentCount == 4);
217217 Operand value(this, state, valueId);
218218 switch(operation)
219219 {
@@ -235,8 +235,8 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
235235 case spv::OpGroupNonUniformBallotFindLSB:
236236 {
237237 auto valueId = Object::ID(insn.word(4));
238- ASSERT(type.sizeInComponents == 1);
239- ASSERT(getType(getObject(valueId)).sizeInComponents == 4);
238+ ASSERT(type.componentCount == 1);
239+ ASSERT(getType(getObject(valueId)).componentCount == 4);
240240 Operand value(this, state, valueId);
241241 dst.move(0, Cttz(value.UInt(0) & SIMD::UInt(15), true));
242242 break;
@@ -245,8 +245,8 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
245245 case spv::OpGroupNonUniformBallotFindMSB:
246246 {
247247 auto valueId = Object::ID(insn.word(4));
248- ASSERT(type.sizeInComponents == 1);
249- ASSERT(getType(getObject(valueId)).sizeInComponents == 4);
248+ ASSERT(type.componentCount == 1);
249+ ASSERT(getType(getObject(valueId)).componentCount == 4);
250250 Operand value(this, state, valueId);
251251 dst.move(0, SIMD::UInt(31) - Ctlz(value.UInt(0) & SIMD::UInt(15), false));
252252 break;
@@ -260,7 +260,7 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
260260 auto y = CmpEQ(SIMD::Int(1), id.Int(0));
261261 auto z = CmpEQ(SIMD::Int(2), id.Int(0));
262262 auto w = CmpEQ(SIMD::Int(3), id.Int(0));
263- for(auto i = 0u; i < type.sizeInComponents; i++)
263+ for(auto i = 0u; i < type.componentCount; i++)
264264 {
265265 SIMD::Int v = value.Int(i);
266266 dst.move(i, (x & v.xxxx) | (y & v.yyyy) | (z & v.zzzz) | (w & v.wwww));
@@ -276,7 +276,7 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
276276 auto y = CmpEQ(SIMD::Int(1), SIMD::Int(0, 1, 2, 3) ^ mask.Int(0));
277277 auto z = CmpEQ(SIMD::Int(2), SIMD::Int(0, 1, 2, 3) ^ mask.Int(0));
278278 auto w = CmpEQ(SIMD::Int(3), SIMD::Int(0, 1, 2, 3) ^ mask.Int(0));
279- for(auto i = 0u; i < type.sizeInComponents; i++)
279+ for(auto i = 0u; i < type.componentCount; i++)
280280 {
281281 SIMD::Int v = value.Int(i);
282282 dst.move(i, (x & v.xxxx) | (y & v.yyyy) | (z & v.zzzz) | (w & v.wwww));
@@ -292,7 +292,7 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
292292 auto d1 = CmpEQ(SIMD::Int(1), delta.Int(0));
293293 auto d2 = CmpEQ(SIMD::Int(2), delta.Int(0));
294294 auto d3 = CmpEQ(SIMD::Int(3), delta.Int(0));
295- for(auto i = 0u; i < type.sizeInComponents; i++)
295+ for(auto i = 0u; i < type.componentCount; i++)
296296 {
297297 SIMD::Int v = value.Int(i);
298298 dst.move(i, (d0 & v.xyzw) | (d1 & v.xxyz) | (d2 & v.xxxy) | (d3 & v.xxxx));
@@ -308,7 +308,7 @@ SpirvShader::EmitResult SpirvShader::EmitGroupNonUniform(InsnIterator insn, Emit
308308 auto d1 = CmpEQ(SIMD::Int(1), delta.Int(0));
309309 auto d2 = CmpEQ(SIMD::Int(2), delta.Int(0));
310310 auto d3 = CmpEQ(SIMD::Int(3), delta.Int(0));
311- for(auto i = 0u; i < type.sizeInComponents; i++)
311+ for(auto i = 0u; i < type.componentCount; i++)
312312 {
313313 SIMD::Int v = value.Int(i);
314314 dst.move(i, (d0 & v.xyzw) | (d1 & v.yzww) | (d2 & v.zwww) | (d3 & v.wwww));
--- a/src/Pipeline/SpirvShaderImage.cpp
+++ b/src/Pipeline/SpirvShaderImage.cpp
@@ -111,7 +111,7 @@ SpirvShader::EmitResult SpirvShader::EmitImageSample(ImageInstruction instructio
111111 Object::ID coordinateId = insn.word(4);
112112 auto &resultType = getType(insn.resultTypeId());
113113
114- auto &result = state->createIntermediate(insn.resultId(), resultType.sizeInComponents);
114+ auto &result = state->createIntermediate(insn.resultId(), resultType.componentCount);
115115 auto imageDescriptor = state->getPointer(sampledImageId).base; // vk::SampledImageDescriptor*
116116
117117 // If using a separate sampler, look through the OpSampledImage instruction to find the sampler descriptor
@@ -204,7 +204,7 @@ SpirvShader::EmitResult SpirvShader::EmitImageSample(ImageInstruction instructio
204204
205205 Array<SIMD::Float> in(16); // Maximum 16 input parameter components.
206206
207- uint32_t coordinates = coordinateType.sizeInComponents - instruction.isProj();
207+ uint32_t coordinates = coordinateType.componentCount - instruction.isProj();
208208 instruction.coordinates = coordinates;
209209
210210 uint32_t i = 0;
@@ -247,16 +247,16 @@ SpirvShader::EmitResult SpirvShader::EmitImageSample(ImageInstruction instructio
247247 auto dxValue = Operand(this, state, gradDxId);
248248 auto dyValue = Operand(this, state, gradDyId);
249249 auto &dxyType = getType(dxValue);
250- ASSERT(dxyType.sizeInComponents == getType(dyValue).sizeInComponents);
250+ ASSERT(dxyType.componentCount == getType(dyValue).componentCount);
251251
252- instruction.grad = dxyType.sizeInComponents;
252+ instruction.grad = dxyType.componentCount;
253253
254- for(uint32_t j = 0; j < dxyType.sizeInComponents; j++, i++)
254+ for(uint32_t j = 0; j < dxyType.componentCount; j++, i++)
255255 {
256256 in[i] = dxValue.Float(j);
257257 }
258258
259- for(uint32_t j = 0; j < dxyType.sizeInComponents; j++, i++)
259+ for(uint32_t j = 0; j < dxyType.componentCount; j++, i++)
260260 {
261261 in[i] = dyValue.Float(j);
262262 }
@@ -275,9 +275,9 @@ SpirvShader::EmitResult SpirvShader::EmitImageSample(ImageInstruction instructio
275275 auto offsetValue = Operand(this, state, offsetId);
276276 auto &offsetType = getType(offsetValue);
277277
278- instruction.offset = offsetType.sizeInComponents;
278+ instruction.offset = offsetType.componentCount;
279279
280- for(uint32_t j = 0; j < offsetType.sizeInComponents; j++, i++)
280+ for(uint32_t j = 0; j < offsetType.componentCount; j++, i++)
281281 {
282282 in[i] = As<SIMD::Float>(offsetValue.Int(j)); // Integer values, but transfered as float.
283283 }
@@ -304,7 +304,7 @@ SpirvShader::EmitResult SpirvShader::EmitImageSample(ImageInstruction instructio
304304 Array<SIMD::Float> out(4);
305305 Call<ImageSampler>(cache.function, texture, &in[0], &out[0], state->routine->constants);
306306
307- for(auto i = 0u; i < resultType.sizeInComponents; i++) { result.move(i, out[i]); }
307+ for(auto i = 0u; i < resultType.componentCount; i++) { result.move(i, out[i]); }
308308
309309 return EmitResult::Continue;
310310 }
@@ -315,7 +315,7 @@ SpirvShader::EmitResult SpirvShader::EmitImageQuerySizeLod(InsnIterator insn, Em
315315 auto imageId = Object::ID(insn.word(3));
316316 auto lodId = Object::ID(insn.word(4));
317317
318- auto &dst = state->createIntermediate(insn.resultId(), resultTy.sizeInComponents);
318+ auto &dst = state->createIntermediate(insn.resultId(), resultTy.componentCount);
319319 GetImageDimensions(state, resultTy, imageId, lodId, dst);
320320
321321 return EmitResult::Continue;
@@ -327,7 +327,7 @@ SpirvShader::EmitResult SpirvShader::EmitImageQuerySize(InsnIterator insn, EmitS
327327 auto imageId = Object::ID(insn.word(3));
328328 auto lodId = Object::ID(0);
329329
330- auto &dst = state->createIntermediate(insn.resultId(), resultTy.sizeInComponents);
330+ auto &dst = state->createIntermediate(insn.resultId(), resultTy.componentCount);
331331 GetImageDimensions(state, resultTy, imageId, lodId, dst);
332332
333333 return EmitResult::Continue;
@@ -378,12 +378,12 @@ void SpirvShader::GetImageDimensions(EmitState const *state, Type const &resultT
378378 UNREACHABLE("Image descriptorType: %d", int(bindingLayout.descriptorType));
379379 }
380380
381- auto dimensions = resultTy.sizeInComponents - (isArrayed ? 1 : 0);
381+ auto dimensions = resultTy.componentCount - (isArrayed ? 1 : 0);
382382 std::vector<Int> out;
383383 if(lodId != 0)
384384 {
385385 auto lodVal = Operand(this, state, lodId);
386- ASSERT(getType(lodVal).sizeInComponents == 1);
386+ ASSERT(getType(lodVal).componentCount == 1);
387387 auto lod = lodVal.Int(0);
388388 auto one = SIMD::Int(1);
389389 for(uint32_t i = 0; i < dimensions; i++)
@@ -409,7 +409,7 @@ void SpirvShader::GetImageDimensions(EmitState const *state, Type const &resultT
409409 SpirvShader::EmitResult SpirvShader::EmitImageQueryLevels(InsnIterator insn, EmitState *state) const
410410 {
411411 auto &resultTy = getType(Type::ID(insn.resultTypeId()));
412- ASSERT(resultTy.sizeInComponents == 1);
412+ ASSERT(resultTy.componentCount == 1);
413413 auto imageId = Object::ID(insn.word(3));
414414
415415 const DescriptorDecorations &d = descriptorDecorations.at(imageId);
@@ -438,7 +438,7 @@ SpirvShader::EmitResult SpirvShader::EmitImageQueryLevels(InsnIterator insn, Emi
438438 SpirvShader::EmitResult SpirvShader::EmitImageQuerySamples(InsnIterator insn, EmitState *state) const
439439 {
440440 auto &resultTy = getType(Type::ID(insn.resultTypeId()));
441- ASSERT(resultTy.sizeInComponents == 1);
441+ ASSERT(resultTy.componentCount == 1);
442442 auto imageId = Object::ID(insn.word(3));
443443 auto imageTy = getType(getObject(imageId));
444444 ASSERT(imageTy.definition.opcode() == spv::OpTypeImage);
@@ -476,12 +476,12 @@ SIMD::Pointer SpirvShader::GetTexelAddress(EmitState const *state, SIMD::Pointer
476476 auto routine = state->routine;
477477 bool isArrayed = imageType.definition.word(5) != 0;
478478 auto dim = static_cast<spv::Dim>(imageType.definition.word(3));
479- int dims = getType(coordinate).sizeInComponents - (isArrayed ? 1 : 0);
479+ int dims = getType(coordinate).componentCount - (isArrayed ? 1 : 0);
480480
481481 SIMD::Int u = coordinate.Int(0);
482482 SIMD::Int v = SIMD::Int(0);
483483
484- if(getType(coordinate).sizeInComponents > 1)
484+ if(getType(coordinate).componentCount > 1)
485485 {
486486 v = coordinate.Int(1);
487487 }
@@ -586,7 +586,7 @@ SpirvShader::EmitResult SpirvShader::EmitImageRead(InsnIterator insn, EmitState
586586
587587 auto imageSizeInBytes = *Pointer<Int>(binding + OFFSET(vk::StorageImageDescriptor, sizeInBytes));
588588
589- auto &dst = state->createIntermediate(insn.resultId(), resultType.sizeInComponents);
589+ auto &dst = state->createIntermediate(insn.resultId(), resultType.componentCount);
590590
591591 auto texelSize = vk::Format(vkFormat).bytes();
592592 auto basePtr = SIMD::Pointer(imageBase, imageSizeInBytes);
--- a/src/Pipeline/SpirvShaderMemory.cpp
+++ b/src/Pipeline/SpirvShaderMemory.cpp
@@ -54,7 +54,7 @@ SpirvShader::EmitResult SpirvShader::EmitLoad(InsnIterator insn, EmitState *stat
5454
5555 auto ptr = GetPointerToData(pointerId, 0, state);
5656 bool interleavedByLane = IsStorageInterleavedByLane(pointerTy.storageClass);
57- auto &dst = state->createIntermediate(resultId, resultTy.sizeInComponents);
57+ auto &dst = state->createIntermediate(resultId, resultTy.componentCount);
5858 auto robustness = state->getOutOfBoundsBehavior(pointerTy.storageClass);
5959
6060 VisitMemoryObject(pointerId, [&](const MemoryElement &el) {
@@ -136,7 +136,7 @@ SpirvShader::EmitResult SpirvShader::EmitVariable(InsnIterator insn, EmitState *
136136 ASSERT(objectTy.opcode() == spv::OpTypePointer);
137137 auto base = &routine->getVariable(resultId)[0];
138138 auto elementTy = getType(objectTy.element);
139- auto size = elementTy.sizeInComponents * static_cast<uint32_t>(sizeof(float)) * SIMD::Width;
139+ auto size = elementTy.componentCount * static_cast<uint32_t>(sizeof(float)) * SIMD::Width;
140140 state->createPointer(resultId, SIMD::Pointer(base, size));
141141 break;
142142 }
@@ -163,7 +163,7 @@ SpirvShader::EmitResult SpirvShader::EmitVariable(InsnIterator insn, EmitState *
163163 ASSERT(objectTy.opcode() == spv::OpTypePointer);
164164 auto base = &routine->getVariable(resultId)[0];
165165 auto elementTy = getType(objectTy.element);
166- auto size = elementTy.sizeInComponents * static_cast<uint32_t>(sizeof(float)) * SIMD::Width;
166+ auto size = elementTy.componentCount * static_cast<uint32_t>(sizeof(float)) * SIMD::Width;
167167 state->createPointer(resultId, SIMD::Pointer(base, size));
168168 break;
169169 }
@@ -378,7 +378,7 @@ void SpirvShader::VisitMemoryObject(Object::ID id, const MemoryVisitor &f) const
378378 {
379379 // Objects without explicit layout are tightly packed.
380380 auto &elType = getType(type.element);
381- for(auto index = 0u; index < elType.sizeInComponents; index++)
381+ for(auto index = 0u; index < elType.componentCount; index++)
382382 {
383383 auto offset = static_cast<uint32_t>(index * sizeof(float));
384384 f({ index, offset, elType });
--- a/src/Pipeline/SpirvShaderSpec.cpp
+++ b/src/Pipeline/SpirvShaderSpec.cpp
@@ -69,11 +69,11 @@ void SpirvShader::EvalSpecConstantOp(InsnIterator insn)
6969 {
7070 auto &result = CreateConstant(insn);
7171 auto const &cond = getObject(insn.word(4));
72- auto condIsScalar = (getType(cond).sizeInComponents == 1);
72+ auto condIsScalar = (getType(cond).componentCount == 1);
7373 auto const &left = getObject(insn.word(5));
7474 auto const &right = getObject(insn.word(6));
7575
76- for(auto i = 0u; i < getType(result).sizeInComponents; i++)
76+ for(auto i = 0u; i < getType(result).componentCount; i++)
7777 {
7878 auto sel = cond.constantValue[condIsScalar ? 0 : i];
7979 result.constantValue[i] = sel ? left.constantValue[i] : right.constantValue[i];
@@ -87,7 +87,7 @@ void SpirvShader::EvalSpecConstantOp(InsnIterator insn)
8787 auto const &compositeObject = getObject(insn.word(4));
8888 auto firstComponent = WalkLiteralAccessChain(compositeObject.typeId(), insn.wordCount() - 5, insn.wordPointer(5));
8989
90- for(auto i = 0u; i < getType(result).sizeInComponents; i++)
90+ for(auto i = 0u; i < getType(result).componentCount; i++)
9191 {
9292 result.constantValue[i] = compositeObject.constantValue[firstComponent + i];
9393 }
@@ -107,12 +107,12 @@ void SpirvShader::EvalSpecConstantOp(InsnIterator insn)
107107 result.constantValue[i] = oldObject.constantValue[i];
108108 }
109109 // new part
110- for(auto i = 0u; i < getType(newPart).sizeInComponents; i++)
110+ for(auto i = 0u; i < getType(newPart).componentCount; i++)
111111 {
112112 result.constantValue[firstNewComponent + i] = newPart.constantValue[i];
113113 }
114114 // old components after
115- for(auto i = firstNewComponent + getType(newPart).sizeInComponents; i < getType(result).sizeInComponents; i++)
115+ for(auto i = firstNewComponent + getType(newPart).componentCount; i < getType(result).componentCount; i++)
116116 {
117117 result.constantValue[i] = oldObject.constantValue[i];
118118 }
@@ -125,7 +125,7 @@ void SpirvShader::EvalSpecConstantOp(InsnIterator insn)
125125 auto const &firstHalf = getObject(insn.word(4));
126126 auto const &secondHalf = getObject(insn.word(5));
127127
128- for(auto i = 0u; i < getType(result).sizeInComponents; i++)
128+ for(auto i = 0u; i < getType(result).componentCount; i++)
129129 {
130130 auto selector = insn.word(6 + i);
131131 if(selector == static_cast<uint32_t>(-1))
@@ -133,13 +133,13 @@ void SpirvShader::EvalSpecConstantOp(InsnIterator insn)
133133 // Undefined value, we'll use zero
134134 result.constantValue[i] = 0;
135135 }
136- else if(selector < getType(firstHalf).sizeInComponents)
136+ else if(selector < getType(firstHalf).componentCount)
137137 {
138138 result.constantValue[i] = firstHalf.constantValue[selector];
139139 }
140140 else
141141 {
142- result.constantValue[i] = secondHalf.constantValue[selector - getType(firstHalf).sizeInComponents];
142+ result.constantValue[i] = secondHalf.constantValue[selector - getType(firstHalf).componentCount];
143143 }
144144 }
145145 break;
@@ -159,7 +159,7 @@ void SpirvShader::EvalSpecConstantUnaryOp(InsnIterator insn)
159159
160160 auto opcode = static_cast<spv::Op>(insn.word(3));
161161 auto const &lhs = getObject(insn.word(4));
162- auto size = getType(lhs).sizeInComponents;
162+ auto size = getType(lhs).componentCount;
163163
164164 for(auto i = 0u; i < size; i++)
165165 {
@@ -210,7 +210,7 @@ void SpirvShader::EvalSpecConstantBinaryOp(InsnIterator insn)
210210 auto opcode = static_cast<spv::Op>(insn.word(3));
211211 auto const &lhs = getObject(insn.word(4));
212212 auto const &rhs = getObject(insn.word(5));
213- auto size = getType(lhs).sizeInComponents;
213+ auto size = getType(lhs).componentCount;
214214
215215 for(auto i = 0u; i < size; i++)
216216 {
Show on old repository browser