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

Allow setting a sampler for an Image asset #156

Merged
merged 7 commits into from
Oct 31, 2023

Conversation

st0rmbtw
Copy link
Contributor

No description provided.

Copy link
Owner

@NiklasEi NiklasEi left a comment

Choose a reason for hiding this comment

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

Hey, thank you for the PR. I like the idea!
One general concern: What happens currently when we load the same path with different samplers? Looking through the code, I would expect that both fields would point to the same handle and that the sampler annotation from the last field would "win". Maybe we can check if the current sampler is the same and if not, clone the asset and replace the handle with a new one pointing to the modified copy?
Please run cargo fmt in the derive crate to get the CI green.

bevy_asset_loader/examples/image_asset.rs Outdated Show resolved Hide resolved
bevy_asset_loader/examples/image_asset.rs Outdated Show resolved Hide resolved
bevy_asset_loader/examples/image_asset.rs Show resolved Hide resolved
bevy_asset_loader_derive/src/assets.rs Outdated Show resolved Hide resolved
bevy_asset_loader_derive/src/assets.rs Outdated Show resolved Hide resolved
bevy_asset_loader_derive/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Owner

@NiklasEi NiklasEi left a comment

Choose a reason for hiding this comment

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

It would also be nice to add a few sentences in the readme about the new annotation.

Copy link
Owner

@NiklasEi NiklasEi left a comment

Choose a reason for hiding this comment

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

Thank you very much

@NiklasEi NiklasEi merged commit bb19f04 into NiklasEi:main Oct 31, 2023
10 checks passed
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