clspv icon indicating copy to clipboard operation
clspv copied to clipboard

Experimental: Support SPV_KHR_untyped_pointers

Open alan-baker opened this issue 1 year ago • 0 comments

SPV_KHR_untyped_pointers provides similar functionality in SPIR-V to opaque pointers in LLVM. There is currently no corresponding Vulkan extension, but work in clspv can begin in the interim.

Necessary changes:

  • Supported SPIR-V storage classes:
    • StorageBuffer/PhysicalStorageBuffer
    • Uniform
    • Workgroup
  • Implicit pointer casts in affected storage classes can be left in place
  • SPIRVProducer needs to layout Workgroup/local data types
    • Support SPV_KHR_workgroup_memory_explicit_layout
    • Add workgroup to 8- and 16-bit storage options
    • Add workgroup scalar layout option
  • SPIRVProducer needs to generate new instructions
  • Allocate descriptors can disregard types in most cases to share more descriptors
    • Probably the untyped variable should just use a placeholder data type (I expect Vulkan to require some type on the variable)
    • Maybe use uint4 for simplicity to work with every storage class
  • Direct resource access might be less necessary
  • Others?

alan-baker avatar Jul 18 '24 14:07 alan-baker