Weaken our dependence on the `once_cell` crate by using functionality
from `std` instead that was upstreamed from `once_cell`.
It's not yet possible to eliminate this dependency entirely, but do what
we can for now.
* Change the signature of `wgpu_core::Global::queue_submit` to return
a `(SubmissionIndex, …)` in addition to its current error type.
* Change the control flow of errors in `Queue::submit` to break to the
end of a block. This is similar to what we already do in many APIs in
`wgpu_core`.
* Hoist the scope of the local `submit_index` binding so it can be used
at the point where we need to convert current error paths to also
return the submission index.
Later, we will likely want to avoid actually retrieving a new submission
index so we can minimize the critical section of code. We'll need to
figure out a strategy for returning a valid (but not necessarily unique)
index in the case of failures that prevent successful submission.
This is just an API change for all the "set_bind_group" calls. Calls
that pass a Some() argument should have unchanged behavior. The None
cases are left as TODOs.
* chore: remove `Context` methods detected as dead code
This is detected by `rustc` as of Rust 1.79.0.
* refactor: satisfy `clippy::manual_inspect`
Detected as of Rust 1.81.0.
* refactor: satisfy `clippy::needless_borrows_for_generic_args`
Detected as of Rust 1.81.0.
* refactor: suppress false-positive `dead_code` lint for `SubmissionIndex`
* chore: eliminate `dead_code` when `target_os = "emscripten"`
Currently, we only increment the internal buffer/texture counters when creating them in the regular way (not when creating them from externally built hal objects (create_texture_from_hal/create_buffer_from_hal). However we decrement the counter in all cases, which makes the counters incorrect when these externally created resources are involved.
This commit fixes it by adding hooks (add_raw_buffer and add_raw_texture) in the hal device abstractions to inform when buffer or textures are created externally.