| arena |
|
|
| back |
|
|
| common |
|
|
| compact |
|
|
| diagnostic_filter.rs |
[`DiagnosticFilter`]s and supporting functionality. |
9517 |
| error.rs |
|
5243 |
| front |
|
|
| ir |
|
|
| keywords |
|
|
| lib.rs |
!
Naga can be used to translate source code written in one shading language to another.
# Example
The following example translates WGSL to GLSL.
It requires the features `"wgsl-in"` and `"glsl-out"` to be enabled.
|
4560 |
| non_max_u32.rs |
[`NonMaxU32`], a 32-bit type that can represent any value except [`u32::MAX`].
Naga would like `Option<Handle<T>>` to be a 32-bit value, which means we
need to exclude some index value for use in representing [`None`]. We could
have [`Handle`] store a [`NonZeroU32`], but zero is a very useful value for
indexing. We could have a [`Handle`] store a value one greater than its index,
but it turns out that it's not uncommon to want to work with [`Handle`]s'
indices, so that bias of 1 becomes more visible than one would like.
This module defines the type [`NonMaxU32`], for which `Option<NonMaxU32>` is
still a 32-bit value, but which is directly usable as a [`Handle`] index
type. It still uses a bias of 1 under the hood, but that fact is isolated
within the implementation.
[`Handle`]: crate::arena::Handle
[`NonZeroU32`]: core::num::NonZeroU32 |
5499 |
| proc |
|
|
| racy_lock.rs |
|
780 |
| span.rs |
|
15026 |
| valid |
|
|