Skip to content

Add shader-based image scaling modes #75

@ecton

Description

@ecton

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions