KhronosGroup / SPIRV-Tools

Apache License 2.0
1.05k stars 549 forks source link

Support for new Intel SPIR-V exts used by new "ISPC for Gen" generated SPIR-V files #3632

Open oscarbg opened 4 years ago

oscarbg commented 4 years ago

Hi, new ISPC 1.14 supports now Intel GPUs.. see: https://ispc.github.io/ispc_for_gen.html (ispc foo.ispc --target=genx-x8 -o foo.spv) It generates SPIR-V files using new Intel SPIR-V extensions which seem unsupported by spirv-dis right now.. I generate like this: ispc ispc-v1.14.0-gen-alpha-linux/examples/portable/genx/aobench/aobench2.ispc -o ao.spv --target=genx-x8 -I./ispc-v1.14.0-gen-alpha-linux/include/ispcrt upon quick inspection on spv file I see it makes use of this SPIR-V extensions:

SPV_INTEL_float_controls2
SPV_INTEL_vector_compute
SPV_KHR_float_controls
SPV_KHR_no_integer_wrap_decoration

fail to spirv-dis:

spirv-dis ao.spv
; SPIR-V
; Version: 1.1
; Generator: Khronos LLVM/SPIR-V Translator; 14
; Bound: 3851
; Schema: 0
               OpCapability Addresses
               OpCapability Linkage
               OpCapability Kernel
               OpCapability Vector16
               OpCapability Int64
               OpCapability Int16
               OpCapability Int8
               OpCapability SubgroupDispatch
               OpCapability DenormFlushToZero
               OpCapability RoundingModeRTE
               OpCapability RoundingModeRTZ
error: 12: Invalid capability operand: 5583

I attach example spv file:

ao.zip

oscarbg commented 4 years ago

Note I'm using almost latest SPIRV-Tools from upcoming Vulkan SDK 1.2.148: spirv-dis --version SPIRV-Tools v2020.4 unknown hash, 2020-07-27T20:17:04 Target: SPIR-V 1.5

kv-sc commented 4 years ago

Hi. We haven't upstreamed those extensions to SPIRV-Tools yet because spec is not finalized (and published only as draft on intel/llvm). You may assign this issue on me and I will come back with updates when we will put patches to SPIRV-Tools on review