Open teoxoy opened 1 year ago
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.
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 https://github.com/gfx-rs/wgpu/issues/4410).
Couldn't we automatically set that if all the native-only extensions are false on the device?
Hmm, I guess the error messages change - "feature X not enabled" vs "unknown feature X"
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).
This can now be added to InstanceFlags
.
We seem to only issue a warning if we end up with a downlevel adapter/device.
https://github.com/gfx-rs/wgpu/blob/3d33ace8d7f4c410894a6d63092870c7eab0388d/wgpu-core/src/instance.rs#L303-L313
We need a mechanism that errors in such an event. I was thinking a feature flag.