Skip to content

Commit 02f786d

Browse files
bashbaugbader
authored andcommitted
add the Vector16 capability for both vec8 and vec16 types (KhronosGroup#229)
* add the Vector16 capability for both vec8 and vec16 types * added test to verify Vector16 capability is added for vectors with eight elements
1 parent d01d480 commit 02f786d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libSPIRV/SPIRVType.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,9 @@ class SPIRVTypeVector:public SPIRVType {
281281
bool isValidIndex(SPIRVWord Index) const { return Index < CompCount;}
282282
SPIRVCapVec getRequiredCapability() const {
283283
SPIRVCapVec V(getComponentType()->getRequiredCapability());
284-
if (CompCount > 8)
284+
// Even though the capability name is "Vector16", it describes
285+
// usage of 8-component or 16-component vectors.
286+
if (CompCount >= 8)
285287
V.push_back(CapabilityVector16);
286288
return std::move(V);
287289
}

0 commit comments

Comments
 (0)