@@ -43,7 +43,7 @@ VulkanLayoutUtils::decorateType(spirv::StructType structType,
43
43
Size memberSize = 0 ;
44
44
Size memberAlignment = 1 ;
45
45
46
- auto memberType =
46
+ Type memberType =
47
47
decorateType (structType.getElementType (i), memberSize, memberAlignment);
48
48
structMemberOffset = llvm::alignTo (structMemberOffset, memberAlignment);
49
49
memberTypes.push_back (memberType);
@@ -105,12 +105,12 @@ Type VulkanLayoutUtils::decorateType(Type type, VulkanLayoutUtils::Size &size,
105
105
Type VulkanLayoutUtils::decorateType (VectorType vectorType,
106
106
VulkanLayoutUtils::Size &size,
107
107
VulkanLayoutUtils::Size &alignment) {
108
- const auto numElements = vectorType.getNumElements ();
109
- auto elementType = vectorType.getElementType ();
108
+ const unsigned numElements = vectorType.getNumElements ();
109
+ Type elementType = vectorType.getElementType ();
110
110
Size elementSize = 0 ;
111
111
Size elementAlignment = 1 ;
112
112
113
- auto memberType = decorateType (elementType, elementSize, elementAlignment);
113
+ Type memberType = decorateType (elementType, elementSize, elementAlignment);
114
114
// According to the Vulkan spec:
115
115
// 1. "A two-component vector has a base alignment equal to twice its scalar
116
116
// alignment."
@@ -124,12 +124,12 @@ Type VulkanLayoutUtils::decorateType(VectorType vectorType,
124
124
Type VulkanLayoutUtils::decorateType (spirv::ArrayType arrayType,
125
125
VulkanLayoutUtils::Size &size,
126
126
VulkanLayoutUtils::Size &alignment) {
127
- const auto numElements = arrayType.getNumElements ();
128
- auto elementType = arrayType.getElementType ();
127
+ const unsigned numElements = arrayType.getNumElements ();
128
+ Type elementType = arrayType.getElementType ();
129
129
Size elementSize = 0 ;
130
130
Size elementAlignment = 1 ;
131
131
132
- auto memberType = decorateType (elementType, elementSize, elementAlignment);
132
+ Type memberType = decorateType (elementType, elementSize, elementAlignment);
133
133
// According to the Vulkan spec:
134
134
// "An array has a base alignment equal to the base alignment of its element
135
135
// type."
@@ -140,10 +140,10 @@ Type VulkanLayoutUtils::decorateType(spirv::ArrayType arrayType,
140
140
141
141
Type VulkanLayoutUtils::decorateType (spirv::RuntimeArrayType arrayType,
142
142
VulkanLayoutUtils::Size &alignment) {
143
- auto elementType = arrayType.getElementType ();
143
+ Type elementType = arrayType.getElementType ();
144
144
Size elementSize = 0 ;
145
145
146
- auto memberType = decorateType (elementType, elementSize, alignment);
146
+ Type memberType = decorateType (elementType, elementSize, alignment);
147
147
return spirv::RuntimeArrayType::get (memberType, elementSize);
148
148
}
149
149
@@ -154,7 +154,7 @@ VulkanLayoutUtils::getScalarTypeAlignment(Type scalarType) {
154
154
// 2. "A scalar has a base alignment equal to its scalar alignment."
155
155
// 3. "A scalar, vector or matrix type has an extended alignment equal to its
156
156
// base alignment."
157
- auto bitWidth = scalarType.getIntOrFloatBitWidth ();
157
+ unsigned bitWidth = scalarType.getIntOrFloatBitWidth ();
158
158
if (bitWidth == 1 )
159
159
return 1 ;
160
160
return bitWidth / 8 ;
@@ -166,7 +166,7 @@ bool VulkanLayoutUtils::isLegalType(Type type) {
166
166
return true ;
167
167
}
168
168
169
- auto storageClass = ptrType.getStorageClass ();
169
+ std::optional<spirv::StorageClass> storageClass = ptrType.getStorageClass ();
170
170
auto structType = dyn_cast<spirv::StructType>(ptrType.getPointeeType ());
171
171
if (!structType) {
172
172
return true ;
0 commit comments