Remove all uses of Handle::index for generating identifiers from Naga backends.
This is a step towards making Handle::index less prominent in the code base. Eventually, I'd like to use well-typed collections for everything, and have Handle::index be private to arena.rs.
[naga msl-out] Use Handle::write_prefixed instead of index.
This replaces all uses of Handle::index for generating identifiers
in naga::back::msl with uses of Handle::write_prefixed.
There are still some uses of Handle::index remaining.
[naga dot-out] Use Handle::write_prefixed instead of index.
This replaces all uses of Handle::index in naga::back::dot with
uses of Handle::write_prefixed.
[naga hlsl-out] Use Baked for baked expressions.
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.
[naga] Introduce Baked newtype for writing baked expression names.
Introduce a newtype naga::back::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.
Remove all uses of
Handle::index
for generating identifiers from Naga backends.This is a step towards making
Handle::index
less prominent in the code base. Eventually, I'd like to use well-typed collections for everything, and haveHandle::index
be private toarena.rs
.[naga msl-out] Use
Handle::write_prefixed
instead ofindex
.This replaces all uses of
Handle::index
for generating identifiers innaga::back::msl
with uses ofHandle::write_prefixed
.There are still some uses of
Handle::index
remaining.[naga dot-out] Use
Handle::write_prefixed
instead ofindex
.This replaces all uses of
Handle::index
innaga::back::dot
with uses ofHandle::write_prefixed
.[naga hlsl-out] Use
Baked
for baked expressions.Make the HLSL backend more like other backends by using
back::Baked
to generate names for baked expression identifiers. This removes the final uses ofHandle::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.
[naga] Introduce
Baked
newtype for writing baked expression names.Introduce a newtype
naga::back::Baked
that wraps aHandle<Expression>
and formats withstd::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 ofBaked
'sDisplay
implementation.