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

Initial SPIRV no_std implementation #85

Merged
merged 20 commits into from Dec 1, 2020

Conversation

repi
Copy link
Contributor

@repi repi commented Oct 26, 2020

This is a first early test implementation for our new spriv-unknown-unknown target that we have in our Rust GPU compiler backend and to bring up glam to support it, this overall effort is tracked and discussed in EmbarkStudios/rust-gpu#134

We currently require no_std so this enables no_std (related discussion: #5) when building glam for that target but then defines a small extension trait to bring in the f32 functionality from std. This is right now defined directly in glam here in a separate spirv.rs and is missing some intrinsic like tan that we'll need we'll need to add to Rust core.

Pretty happy that did get most things to compile this way, but some glam functionality has been stubbed out. Not too complex.

Expect this to live as a draft PR here for quite a while until we have settled on some of these intrinsics implementations, where they should live, and fixed some compiler backend issues with the this for now also. But having it as an open draft PR makes it more visible and easier to discuss approaches.

@repi repi changed the title Draft: Initial SPIRV no_std implementation Initial SPIRV no_std implementation Oct 26, 2020
src/f32/spirv.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
build.rs Outdated Show resolved Hide resolved
src/f32/funcs.rs Outdated Show resolved Hide resolved
@bitshifter
Copy link
Owner

I'm not sure it's of use to your SPIRV efforts but I fixed no_std in this branch https://github.com/bitshifter/glam-rs/tree/no_std. Needs a little tidying up, but I might merge it to master soon.

It requires --no-default-features --features libm

@repi
Copy link
Contributor Author

repi commented Oct 28, 2020

@bitshifter thanks will check out!

@bitshifter bitshifter mentioned this pull request Nov 18, 2020
23 tasks
Copy link
Owner

@bitshifter bitshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean I can't printf debug on the GPU :)

src/lib.rs Show resolved Hide resolved
@repi repi marked this pull request as ready for review December 1, 2020 12:36
Copy link
Owner

@bitshifter bitshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bitshifter bitshifter merged commit fd4c47e into bitshifter:master Dec 1, 2020
@repi
Copy link
Contributor Author

repi commented Dec 2, 2020

Wooho! 🎉🚀

@khyperia khyperia deleted the spirv branch June 1, 2021 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants