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 shader-based image scaling modes #75

Open
ecton opened this issue Oct 10, 2024 · 0 comments
Open

Add shader-based image scaling modes #75

ecton opened this issue Oct 10, 2024 · 0 comments

Comments

@ecton
Copy link
Member

ecton commented Oct 10, 2024

Currently image sampling is controlled purely through wgpu::FilterMode. We should add support for some common resizing kernels.

To do this, we need to determine a list of kernels we want to support. Reserve N bits on the u32 flags on PushConstants.

Next, we need to add API surfaces to allow users to specify a custom scaling mode when using draw texture calls. We must ensure this setting is passed through to the PushConstants::flags.

Inside of fragment the flags can be decoded to determine the proper kernel to use when sampling the texture. Once the sampled color is chosen, the blend color can be applied and returned.

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

No branches or pull requests

1 participant