Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIR-V] vk::ext_capability can only tag vk::SpirvType aliases and typedefs, not other types #6958

Open
devshgraphicsprogramming opened this issue Oct 12, 2024 · 1 comment
Labels
bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V

Comments

@devshgraphicsprogramming

Description

I have a templated struct (nbl::hlsl::bda::__ptr<T>) that uses vk::SpirvType internally to declare a PhysicalStoragePointer of another type T.

I put [[vk::ext_capability(spv::CapabilityStorageBuffer8BitAccess)]] in the typedef for a __ptr<uint16_t> (is supposed to be uint8_t later), and I expect the usage of that type to propagate the capability.

My argument for why I need extensions and capabilities to propagate is because for example CapabilityStorageBuffer8BitAccess is a specific capability of using a (u)int8 AND PhysicalStorageBuffer storage class, so I'd have to manually declare a fairly complicated SpirvType (two nested) just to be able to stick the capability on it.

This gets especially annoying for capabilities/extensions dealing with images, as an inline SPIR-V declaration for a combined image sampler or similar can be a chain of 4-5 SpirV types.

Steps to Reproduce

My own Godbolt instance with a few more headers: https://tinyurl.com/ydhdncw3

Can produce preprocessed full source and make a repro on godbolt with vanilla DXC

Actual Behavior

No OpCapability CapabilityStorageBuffer8BitAccess emitted

Environment

  • DXC version more or less commit f810e92
  • Host Operating System Windows
@devshgraphicsprogramming
Copy link
Author

Seems that microsoft/hlsl-specs#191 and microsoft/hlsl-specs#270 didn't foresee such a use in their design.

@s-perron s-perron moved this to For Google in HLSL Triage Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V
Projects
Status: For Google
Development

No branches or pull requests

1 participant