Skip to content

Add missing webgpu features#322

Merged
nical merged 1 commit intotrunkfrom
all-webgpu-features
Nov 23, 2023
Merged

Add missing webgpu features#322
nical merged 1 commit intotrunkfrom
all-webgpu-features

Conversation

@almarklein
Copy link
Copy Markdown
Collaborator

@almarklein almarklein commented Nov 23, 2023

The features specified by WebGPU (copied from https://gpuweb.github.io/gpuweb/#gpufeaturename):

enum GPUFeatureName {
    "depth-clip-control",
    "depth32float-stencil8",
    "texture-compression-bc",
    "texture-compression-etc2",
    "texture-compression-astc",
    "timestamp-query",
    "indirect-first-instance",
    "shader-f16",
    "rg11b10ufloat-renderable",
    "bgra8unorm-storage",
    "float32-filterable",
};

Features by wgpy-core: https://docs.rs/wgpu-types/0.18.0/wgpu_types/struct.Features.html

This PR adds one missing feature: "bgra8unorm-storage". (The "timestamp-query" was just moved so the order of the list is the same as in the spec.)

The final missing feature "float32-filterable" I cannot add because wgpu-core does not define it yet.

We are interested in having it, since we rely on it in pygfx because it's somewhat crucial in e.g. volume rendering. So I looked a bit into wgpu-core, and found the pr that adds bgra8unorm-storage. Seems like quite a bit of work, so for now I'm going to leave it at leaving the code for this feature commented here. We can keep using TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES (which includes float32-filterable) for now. 😅

@almarklein
Copy link
Copy Markdown
Collaborator Author

almarklein commented Nov 23, 2023

I wonder 🤔 if we can/should fake float32-filterable by enabling TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES instead?

@cwfitzgerald
Copy link
Copy Markdown
Member

FYI bgra8 storage was really hard because it was the first to need to use a special spirv tag for storage textures.

Flost32 filterable should just be some logic checks

@nical nical merged commit afc44ae into trunk Nov 23, 2023
@nical nical deleted the all-webgpu-features branch November 23, 2023 10:50
@almarklein
Copy link
Copy Markdown
Collaborator Author

Flost32 filterable should just be some logic checks

Ok, you nerd-sniped me now.

@almarklein
Copy link
Copy Markdown
Collaborator Author

gfx-rs/wgpu#4759

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.

3 participants