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

WIP: User imports #15

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

BrainBacon
Copy link
Contributor

@BrainBacon BrainBacon commented Feb 15, 2025

Work in progress, but functional.

make a library module, make functions, static consts, and helper types public then use the module inside of your wgsl module.

Limitations:

  • will only accept use statements in the glob format, e.g.
use foo::bar::*;
  • will not work with qualified functions and types, e.g.
foo::bar::helper_function()

In Progress:

  • Tests
  • Documentation
  • Error messages
  • Example
  • Formatting
  • Checking if libraries imported from other crates works
  • leading colon support ::
  • commit clean up

… but refactored to follow the structure of the newly refactored proc macro crate.
… but refactored to follow the structure of the newly refactored proc macro crate.
@BrainBacon BrainBacon marked this pull request as draft February 15, 2025 16:19
@BrainBacon BrainBacon force-pushed the feature/user-imports branch 5 times, most recently from a52cd57 to 7f9332f Compare February 16, 2025 01:08
Copy link
Owner

@Sheldonfrith Sheldonfrith left a comment

Choose a reason for hiding this comment

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

Have reviewed commit 7deaf49, all good. Will proceed to next commit.

Copy link
Owner

@Sheldonfrith Sheldonfrith left a comment

Choose a reason for hiding this comment

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

Looking at all the source code changes everything looks good. I think if we could add a quick example to the examples which uses this new import functionality in order to confirm it runs as expected that would be best, probably just copy existing example code but move some of the shader code to a different module that we then import.

@Sheldonfrith
Copy link
Owner

As mentioned above it would be ideal to have a new example in the examples directory which utilizes this new functionality. Feel free to copy an existing example, since the theoretically correct outputs for those have already been determined. And then just run bash pre-commit-tasks in the root directory and fix any clippy or fmt errors that come up and I'll merge it. Great work!

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