In `wgpu_core::pipeline`, delete `ShaderMetaData` and turn
`ShaderModuleState` into the equivalent enum, giving both the
`NagaModule` and `Passthrough` variants their own `raw` field.
Arrange for uses of `ShaderModuleState` to extract the raw `wgpu_hal`
module in the `match` expression that handles the two variants.
In isolation, this change looks like mere rearrangement, not a
cleanup, but hopefully either way it's easy to see that it has no
effect on behavior. Subsequent commits will remove `raw` from the
`NagaModule` variant; this refactor will allow that to affect only the
`NagaModule` `match` arms, leaving the passthrough code unaffected.
Move the definitions of `ShaderMetaData` and `PassthroughInterface`
from `wgpu_core::validation`, which does not use them, to
`wgpu_core::pipeline`, where they are used in `ShaderModuleState`, and
created.
Slightly reorder the sites that consume `ShaderMetaData` values, so
that the code for the `NagaModule` and `Passthrough` cases can be
gathered into `match` statements.
Rename the `ShaderMetaData::Interface` variant to `NagaModule`,
and make it a struct-like variant.
Delete `ShaderMetaData::interface`, and update its call sites to use a
`match` expression directly on the enum instead. This makes the use
sites clearer, by making it apparent which style of module we're
processing.
this is important as we need to return Abort error instead of Operation error which is raised on invalid buffer
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Now that we force the compiler to eagerly evaluate `Send + Sync` for
types that have had problems with `recursion_limit`s, we should be able
to use the compiler's defaults. Remove the attributes raising the
default.
Co-authored-by: Nazar Mokrynskyi <nazar@mokrynskyi.com>
Every resource holds an `Arc<Device>`, so evaluating their auto traits
used to walk all of `Device`. This exceeded the default recursion limit
on nightly for `wgpu::CoreCommandEncoder`.
- `RwLockReadGuard::forget` was not actually forgetting the
`LockStateGuard`, resulting in a "double unlock" error when
`SnatchableResourceGuard` later called `force_unlock_read`.
- Adjust both the test and the lock graph to avoid lock
rank errors.