-
Notifications
You must be signed in to change notification settings - Fork 45
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
Allocation of implementation-specific enum values #214
Comments
* New enum values for wgpu-native specific enums. webgpu-native/webgpu-headers#214 * update comment Co-authored-by: Almar Klein <[email protected]> --------- Co-authored-by: Almar Klein <[email protected]>
|
Shouldn't this be reserved for native-only and not upstream WebGPU (as in the JS spec) features? If we need another reserved block Dawn can move to |
Good idea. We don't really need another reserved block so I'll just change what |
We need to decide where WebGPU Compat values live (for |
meeting: Decided tentatively to do that: make a block for Compat so the whole block can be treated specially. If either compat isn't enabled, on the implementation doesn't implement compat at all (but knows that it exists), it should ignore chained structs in this block, rather than error on them. This raises the question of what to do in an implementation that implements compat, if an SType is passed that's in the compat block but not recognized. This is an edge case since we don't provide ABI compatibility. But I think it should error, regardless of whether compat is enabled on the device. I'm going to make 0x0002 Compat, and move Dawn to 0x0005 since we haven't started using it yet. |
For bitflags enums, which are becoming 64 bits, the first 10-11 extensions should be allocated (still ad hoc) in the top 11 bits that JS can't represent. (10 because might need to skip the MSB because if C enums don't like being u64.) |
Mar 14 meeting:
|
Updated top post. |
Do we need a block for multi-implementation wasm-only extensions? |
(Relatedly we are assuming |
Jul 18 meeting:
|
See also the Jul 18 notes for #212 (comment) I have updated the top comment on this issue for both resolutions. |
Closing, nothing to do in this repo until we start using block (except for add docs, so we keep the |
We should have a "registry" of allocated ranges to use for enums, especially WGPUSType and WGPUFeatureName
Per #212 the end of the name of the new values will be the name of the implementation ("...Dawn" or "...Wgpu")
In the webgpu.h meeting we agreed to use the top 16 bits for the implementation namespace. I think we can use this for all of the (non-bitflag) enums.
No one really cares about the actual IDs so here's an arbitrary assignment of ranges:
0x0000_????
: coreSuffix: none.
Should be in all implementations, both native and Wasm. Used for features added to WebGPU core after this header stabilizes.
0x0001_????
: multi-implementation C-specific extensionsSuffix: none.
May be native-specific or Wasm-specific, both can go in this block.
0x0002_????
: WebGPU CompatSuffix: none? TBD.
Special: implementations that don't support compat should ignore these instead of error. This is to be used only for Compat additions, which don't affect semantics of a valid program if a non-compat implementation ignores them.
0x0003_????
: wgpu-nativeSuffix:
_WGPU
0x0004_????
: EmscriptenSuffix:
_Emscripten
0x0005_????
: DawnSuffix:
_Dawn
EDIT: For bitflags (becoming
uint64_t
in #273):The text was updated successfully, but these errors were encountered: