Closed devshgraphicsprogramming closed 4 months ago
Requests for changes to the HLSL language (including Vulkan-specific attributes) now fall under the scope of the microsoft/hlsl-specs repository. Please consider submitting a proposal there instead.
That said, adding complexity to the API for the support of extensive template metaprogramming is not a high-priority and unlikely to be strongly considered at this time.
Btw a little note after the fact, it seems that
[[vk::ext_capability(conditional_capability_v<SomeCondition,CapabilityEnum>)]]
wasn't possible in the first place wher SomeCondition
depends on a typename T
.
https://godbolt.org/z/58Y7fTdf7
I don't know if its a DXC or general Clang thing that attributes can't depend on templates
I guess a ext_extension(string,bool)
would have suffered from the same problem
Is your feature request related to a problem? Please describe.
I'm autogenerating large amounts of templates SPIR-V intrinsics, and as you know depending on their argument types extensions or capabilities might be required (i.e. atomicIAdd on a 64bit value needs 64-bit atomic capability).
Describe the solution you'd like
Since I would have used a template metaprogramming
conditional
to choose between the extension string and some other ubiquitous string, it would save everyone legwork, if theext_extension
attribute just took a literal boolean whether to enable it or not.Describe alternatives you've considered
For capabilities its easy to do:
where upon false I just default to the
Shader
capability which everyone needs to have.but because
vk::ext_extension
takes a string, it makes any of these impossible