This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Fix capability check for 64-bit element types
ClosedPublic

Authored by antiagainst on May 23 2022, 4:21 PM.

Details

Summary

Using 64-bit integer/float type in interface storage classes would
require Int64/Float64 capability, per the Vulkan spec:

shaderInt64 specifies whether 64-bit integers (signed and unsigned) are
supported in shader code. If this feature is not enabled, 64-bit integer
types must not be used in shader code. This also specifies whether
shader modules can declare the Int64 capability. Declaring and using
64-bit integers is enabled for all storage classes that SPIR-V allows
with the Int64 capability.

This is different from, say, 16-bit element types, where:

shaderInt16 specifies whether 16-bit integers (signed and unsigned) are
supported in shader code. If this feature is not enabled, 16-bit integer
types must not be used in shader code. This also specifies whether
shader modules can declare the Int16 capability. However, this only
enables a subset of the storage classes that SPIR-V allows for the Int16
SPIR-V capability: Declaring and using 16-bit integers in the Private,
Workgroup (for non-Block variables), and Function storage classes is
enabled, while declaring them in the interface storage classes (e.g.,
UniformConstant, Uniform, StorageBuffer, Input, Output, and
PushConstant) is not enabled.

Diff Detail

Event Timeline

antiagainst created this revision.May 23 2022, 4:21 PM
antiagainst requested review of this revision.May 23 2022, 4:21 PM
hanchung accepted this revision.May 24 2022, 9:33 PM
This revision is now accepted and ready to land.May 24 2022, 9:33 PM