When the appropriate features are enabled, manually implement
`serde::Serialize` and `serde::Deserialize`, such that the serialized
form of `NonMaxU32::new(n).unwrap()` is the same as that of `n`.
This eliminates the last trace of 1-based indices from Naga's snapshot
tests, and aligns `std::fmt::Debug` with the serialized form.
Remove the phrase "zero-based" from comments and function names. Now
that there is no mix of zero-based and one-based indices, there's no
need to call out the distinction.
Define a new type, `NonMaxU32`, that can represent any `u32` value
except `u32::MAX`, defined such that `Option<NonMaxU32>` is still a
32-bit value.
Change `Handle` to use `NonMaxU32`. Adjust all code that works
directly with handle indices to assume zero-based indices, not
one-based indices.
This replaces all uses of `Handle::index` for generating identifiers
in `naga:🔙:msl` with uses of `Handle::write_prefixed`.
There are still some uses of `Handle::index` remaining.
Make the HLSL backend more like other backends by using `back::Baked`
to generate names for baked expression identifiers. This removes the
final uses of `Handle::index` from the HLSL backend.
This is separated out from the previous commit because it changes lots
of snapshot tests, whereas the previous commit has no effect on Naga's
output.
Introduce a newtype `naga:🔙:Baked` that wraps a
`Handle<Expression>` and formats with `std::fmt::Display` as a baked
expression identifier. Use this in all backends for generating baked
identifiers.
Delete `BAKE_PREFIX`, as it's no longer used outside of `Baked`'s
`Display` implementation.
This is a step towards making `Handle::index` less prominent in the
code base.
* Ensure webgl example build only contains webgl and webgpu example build only contains webgpu
* fix ip printed on run-wasm
* Update examples on running examples on the web
- Improve logging in `StatelessTracker::remove_abandoned` to show the
outcome of the call.
- Add similar logging to `BufferTracker` and `TextureTracker`.
- Let `device_create_buffer`'s log only the new buffer's label, id,
and whether it's mapped at creation. It used to show the whole
descriptor, which is too much detail.
- Have `queue_submit` log the submission id, and have `device_poll`
log what it was waiting for, and what actually got done.
- Have `Device::drop` log the destruction of the raw device when it
actually happens, so it's properly ordered with respect to logging
from other parts of the device, like `Device::command_allocator`.
Otherwise, the emojis aren't parsed on Crates.io, leaving the table without much utility unless a user navigates to GitHub.
Fixes like these are very simple, but super helpful for some users! :)