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

Rework optix_stubs.c #174

Merged
merged 3 commits into from
Mar 21, 2025
Merged

Rework optix_stubs.c #174

merged 3 commits into from
Mar 21, 2025

Conversation

jorge-ortega
Copy link
Collaborator

@jorge-ortega jorge-ortega commented Mar 20, 2025

Doing a diff of optix_stubs.c in tree with optix_stubs.h from the SDK showed only whitespace differences and removal of inline from all the stubs so they end up in the binary when compiling them. This change instead includes optix_stubs.h and uses the preprocessor to erase inline in the header.

This should make it easier to support newer optix versions without having to update the stubs to match.

Edit: CI won't build this, but this does still build and run the path_tracer example for me on Windows.

The stubs were a copy of optix_stubs.h, but without `inline` so they end up in the binary when compiling them. This change instead includes optix_stubs.h and uses the preprocessor to erase `inline` in the header.
`cc` already sets rustc-link-search and rustc-link-lib after compiling. Since other rerun-if-changed instructions are emitted, specifying build.rs is redudant.
@LegNeato
Copy link
Contributor

Learned about CargoCallbacks, neat! Nice and straightforward PR 👍

@LegNeato LegNeato merged commit 6d79a12 into Rust-GPU:main Mar 21, 2025
4 checks passed
@jorge-ortega jorge-ortega deleted the optix-stubs branch March 21, 2025 02:19
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.

2 participants