Skip to content

Add support for "float32-filterable" feature. #4848

@HymnsForDisco

Description

@HymnsForDisco

Is your feature request related to a problem? Please describe.
Without this feature, float32 type textures don't support sampling. Practically, this means you must use FilterMode::Nearest for samplers of such textures, which is rather limiting.

Describe the solution you'd like
I'd like to be able to enable the "float32-filterable" feature in the device descriptor

Makes textures with formats r32float, rg32float, and rgba32float filterable.

Presumably, this would join the other features enumerated in https://docs.rs/wgpu/latest/wgpu/struct.Features.html

Describe alternatives you've considered
The alternatives AFAIK are:

  1. Don't use float32 textures when you want sampling
  2. If you need to sample from a float32 texture, first copy/convert it into a sample-able format. (This may be workable in some cases, but bad for frequently updating textures, and doesn't support the full range of values that float32 textures do).

Additional context
I originally asked about this feature here, before deciding a feature request was appropriate.
#4846

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