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

bit_cast template #318

Open
llvm-beanz opened this issue Sep 12, 2024 · 3 comments
Open

bit_cast template #318

llvm-beanz opened this issue Sep 12, 2024 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@llvm-beanz
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
HLSL has a bunch of different casting builtins that are all spelled differently and not templated. That makes it difficult for template code to cast to the appropriate type if the type is a template parameter.

Describe the solution you'd like
It would be awesome to add a templated bit_cast operation. Such a casting operation was added as an implementation detail in:

llvm/llvm-project#107292

I suspect we could create a similar header-implemented interface for DXC as well using type traits.

@llvm-beanz llvm-beanz added enhancement New feature or request needs-triage labels Sep 12, 2024
@damyanp damyanp added this to the HLSL 202y milestone Sep 18, 2024
@damyanp damyanp moved this to Triaged in HLSL Triage Sep 18, 2024
@damyanp
Copy link
Member

damyanp commented Dec 3, 2024

(related to internal 30312655)

@devshgraphicsprogramming

btw since then we've learned that SPIR-V is a bit "special" and you can't bit-cast everything, only between fundametal types (scalar, vector, matrix) and sometimes Physical Pointer and uint64_t.

One would need some special memcpy for this otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Triaged
Development

No branches or pull requests

3 participants