microsoft / hlsl-specs

HLSL Specifications
MIT License
116 stars 29 forks source link

[0011] Allow vk::ext_capability and vk::ext_extension on fields #269

Closed s-perron closed 1 month ago

s-perron commented 2 months ago

Which proposal does this relate to?

https://github.com/microsoft/hlsl-specs/blob/main/proposals/0011-inline-spirv.md

Describe the issue or outstanding question.

The documentation for these attributes say they can only be used on certain functions. This worked for types that required capability and extensions because types were declared using a function, which was awkward.

In proposal 0011, we replaced the original way of declaring a spir-v type with the type vk::SprivType and vk::SpirvOpaqueType. I just realized we have no way of adding the required extension and capabilities that they types many require because you do not necessarily have a function.

We should allow the vk::ext_capability and vk::ext_extension attributes on any variable declaration (global, function scope, and field) I don't know if parameters are needed. So that the appropriate capabilities and extensions can be added when vk::Spriv*Type is used.