Skip to content

Commit

Permalink
Implement bgl_diff for compute
Browse files Browse the repository at this point in the history
  • Loading branch information
scoopr committed Dec 17, 2023
1 parent 88dfad7 commit 5cd3c58
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions wgpu-core/src/command/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,8 @@ pub struct ComputePassDescriptor<'a> {
pub enum DispatchError {
#[error("Compute pipeline must be set")]
MissingPipeline,
#[error("The pipeline layout, associated with the current compute pipeline, contains a bind group layout at index {index} which is incompatible with the bind group layout associated with the bind group at {index}")]
IncompatibleBindGroup {
index: u32,
//expected: BindGroupLayoutId,
//provided: Option<(BindGroupLayoutId, BindGroupId)>,
},
#[error("Incompatible bind group at index {index} in the current compute pipeline")]
IncompatibleBindGroup { index: u32, diff: Vec<String> },
#[error(
"Each current dispatch group size dimension ({current:?}) must be less or equal to {limit}"
)]
Expand Down Expand Up @@ -245,6 +241,11 @@ impl PrettyError for ComputePassErrorInner {
Self::InvalidIndirectBuffer(id) => {
fmt.buffer_label(&id);
}
Self::Dispatch(DispatchError::IncompatibleBindGroup { ref diff, .. }) => {
for d in diff {
fmt.note(&d);
}
}
_ => {}
};
}
Expand Down Expand Up @@ -291,8 +292,11 @@ impl<A: HalApi> State<A> {
let bind_mask = self.binder.invalid_mask();
if bind_mask != 0 {
//let (expected, provided) = self.binder.entries[index as usize].info();
let index = bind_mask.trailing_zeros();

return Err(DispatchError::IncompatibleBindGroup {
index: bind_mask.trailing_zeros(),
index,
diff: self.binder.bgl_diff(),
});
}
if self.pipeline.is_none() {
Expand Down

0 comments on commit 5cd3c58

Please sign in to comment.