[naga] Remove uses of Handle::index
for identifier generation from backends
#5845
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 identifiersin
naga::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
withuses 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 aHandle<Expression>
and formats withstd::fmt::Display
as a bakedexpression identifier. Use this in all backends for generating baked
identifiers.
Delete
BAKE_PREFIX
, as it's no longer used outside ofBaked
'sDisplay
implementation.