mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Tweak error behavior for unbalanced passes, and update CTS (#8543)
This commit is contained in:
parent
836c97056f
commit
6043b059c4
@ -1 +1 @@
|
||||
cf8d39399889ae8324f77b6017071b3e1bfe3467
|
||||
ca488e91d0bace04c9c393bd733053da0b84ce11
|
||||
|
||||
@ -491,22 +491,21 @@ impl Global {
|
||||
|
||||
let base = pass.base.take();
|
||||
|
||||
if matches!(
|
||||
base,
|
||||
Err(ComputePassError {
|
||||
inner: ComputePassErrorInner::EncoderState(EncoderStateError::Ended),
|
||||
scope: _,
|
||||
})
|
||||
) {
|
||||
// If the encoder was already finished at time of pass creation,
|
||||
// then it was not put in the locked state, so we need to
|
||||
// generate a validation error here and now due to the encoder not
|
||||
// being locked. The encoder already holds an error from when the
|
||||
// pass was opened, or earlier.
|
||||
if let Err(ComputePassError {
|
||||
inner:
|
||||
ComputePassErrorInner::EncoderState(
|
||||
err @ (EncoderStateError::Locked | EncoderStateError::Ended),
|
||||
),
|
||||
scope: _,
|
||||
}) = base
|
||||
{
|
||||
// Most encoding errors are detected and raised within `finish()`.
|
||||
//
|
||||
// All other errors are propagated to the encoder within `push_with`,
|
||||
// and will be reported later.
|
||||
return Err(EncoderStateError::Ended);
|
||||
// However, we raise a validation error here if the pass was opened
|
||||
// within another pass, or on a finished encoder. The latter is
|
||||
// particularly important, because in that case reporting errors via
|
||||
// `CommandEncoder::finish` is not possible.
|
||||
return Err(err.clone());
|
||||
}
|
||||
|
||||
cmd_buf_data.push_with(|| -> Result<_, ComputePassError> {
|
||||
|
||||
@ -1823,22 +1823,21 @@ impl Global {
|
||||
|
||||
let base = pass.base.take();
|
||||
|
||||
if matches!(
|
||||
base,
|
||||
Err(RenderPassError {
|
||||
inner: RenderPassErrorInner::EncoderState(EncoderStateError::Ended),
|
||||
scope: _,
|
||||
})
|
||||
) {
|
||||
// If the encoder was already finished at time of pass creation,
|
||||
// then it was not put in the locked state, so we need to
|
||||
// generate a validation error here and now due to the encoder not
|
||||
// being locked. The encoder already holds an error from when the
|
||||
// pass was opened, or earlier.
|
||||
if let Err(RenderPassError {
|
||||
inner:
|
||||
RenderPassErrorInner::EncoderState(
|
||||
err @ (EncoderStateError::Locked | EncoderStateError::Ended),
|
||||
),
|
||||
scope: _,
|
||||
}) = base
|
||||
{
|
||||
// Most encoding errors are detected and raised within `finish()`.
|
||||
//
|
||||
// All other errors are propagated to the encoder within `push_with`,
|
||||
// and will be reported later.
|
||||
return Err(EncoderStateError::Ended);
|
||||
// However, we raise a validation error here if the pass was opened
|
||||
// within another pass, or on a finished encoder. The latter is
|
||||
// particularly important, because in that case reporting errors via
|
||||
// `CommandEncoder::finish` is not possible.
|
||||
return Err(err.clone());
|
||||
}
|
||||
|
||||
cmd_buf_data.push_with(|| -> Result<_, RenderPassError> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user