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

Add TextureOptions::wrap_mode #3954

Merged
merged 4 commits into from
Feb 5, 2024
Merged

Add TextureOptions::wrap_mode #3954

merged 4 commits into from
Feb 5, 2024

Conversation

CodedNil
Copy link
Contributor

@CodedNil CodedNil commented Feb 2, 2024

Exposes support in both glow and wgpu for texture wrap modes

This would be breaking for manual creations of TextureOptions but would work with the current TextureOptions::NEAREST and LINEAR without change, keeping those clamp to edge

I wasn't sure how best to expose the options to the user and added consts for LINEAR_REPEAT LINEAR_MIRRORED_REPEAT NEAREST_REPEAT NEAREST_MIRRORED_REPEAT

This does not include wrap mode clamp to border as it worked fine with glow but with wgpu it panics due to Features Features(ADDRESS_MODE_CLAMP_TO_BORDER) are required but not enabled on the device, and I thought it was probably best not to try to enable that feature, but happy to include that functionality also if that is okay to be toggled

image

@YgorSouza
Copy link
Contributor

Link to #3481 so people know it's being worked on.

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Great!

crates/epaint/src/textures.rs Outdated Show resolved Hide resolved
@emilk emilk added the egui label Feb 5, 2024
@emilk emilk changed the title Texture wrap Add TextureOptions::wrap_mode Feb 5, 2024
@emilk emilk merged commit a5973e5 into emilk:master Feb 5, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants