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

Strict WebGPU compliance mode #3274

Open
teoxoy opened this issue Dec 8, 2022 · 6 comments
Open

Strict WebGPU compliance mode #3274

teoxoy opened this issue Dec 8, 2022 · 6 comments
Assignees
Labels
area: api Issues related to API surface type: enhancement New feature or request

Comments

@teoxoy
Copy link
Member

teoxoy commented Dec 8, 2022

We seem to only issue a warning if we end up with a downlevel adapter/device.

if wgt::Backends::PRIMARY.contains(wgt::Backends::from(A::VARIANT))
&& !caps.downlevel.is_webgpu_compliant()
{
let missing_flags = wgt::DownlevelFlags::compliant() - caps.downlevel.flags;
log::warn!(
"Missing downlevel flags: {:?}\n{}",
missing_flags,
DOWNLEVEL_WARNING_MESSAGE
);
log::info!("{:#?}", caps.downlevel);
}

We need a mechanism that errors in such an event.
I was thinking a feature flag.

@teoxoy teoxoy added type: enhancement New feature or request area: api Issues related to API surface labels Dec 8, 2022
@teoxoy teoxoy added this to the WebGPU Specification V1 milestone Dec 8, 2022
@cwfitzgerald
Copy link
Member

What's the use case of this? You can view the downlevel flags on the adapter and error out if you only want compliant adapters.

@teoxoy
Copy link
Member Author

teoxoy commented Dec 12, 2022

You can view the downlevel flags on the adapter and error out if you only want compliant adapters.

That's indeed a possibility but I think we'll need this distinction anyway to support the proposed strict_extensions field on the WGSL Parser (see #4410).

@cwfitzgerald
Copy link
Member

Couldn't we automatically set that if all the native-only extensions are false on the device?

@cwfitzgerald
Copy link
Member

Hmm, I guess the error messages change - "feature X not enabled" vs "unknown feature X"

@teoxoy
Copy link
Member Author

teoxoy commented Jun 13, 2023

We should also use this mechanism to avoid exposing features that are not implemented in naga.

For example, SHADER_F16 is currently exposed due to it being available through spir-v passthrough (but not via WGSL).

@teoxoy
Copy link
Member Author

teoxoy commented Nov 23, 2023

This can now be added to InstanceFlags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api Issues related to API surface type: enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants