MaikKlein / rlsl

Rust to SPIR-V compiler
Apache License 2.0
557 stars 14 forks source link

Generating storage buffers #54

Closed MaikKlein closed 6 years ago

MaikKlein commented 6 years ago

Currently glslang decorates a struct with BufferBlock. But BufferBlock has been deprecated.

BufferBlock Deprecated (use Block-decorated StorageBuffer Storage Class objects). Apply to a structure type to establish it is an SSBO-like shader-interface block.

The spec recommends to use the StorageBuffer storage class, but this requires the following extensions SPV_KHR_storage_buffer_storage_class, SPV_KHR_variable_pointers

Only ~30% of the gpus support those extensions pre 1.1, but they have been made core in 1.1.

Now what should rlsl target? BufferBlock or StorageBuffer or both?

MaikKlein commented 6 years ago

I'll probably still implement the deprecated BufferBlock variant. We can still feature gate the StorageBuffer class later.

minecrawler commented 6 years ago

I'd say always go with the latest spec. If anyone needs older functionality, they should use an older LTS version. That way, you keep open for future improvements, but enable people to go back to older version if needed.

MaikKlein commented 6 years ago

I am going to support both, the change appears to be trivial. For now I am going with the deprecated version because gfx still uses an Vulkan 1.0 context. I also need to push ash to version 1.1.