d3d11: fix ASSERT() crash in d3d11::BindGroupTracker::unApplyNindGroup()

Bug: dawn:1705
Change-Id: I87d464c5321375a96aa4926a0968e6acab7194e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133760
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Peng Huang <penghuang@chromium.org>
This commit is contained in:
Peng Huang 2023-05-19 23:21:44 +00:00 committed by Dawn LUCI CQ
parent 3d3584793b
commit 956a2fc780
1 changed files with 4 additions and 3 deletions

View File

@ -101,10 +101,11 @@ MaybeError BindGroupTracker::Apply() {
// conflict, we need to unbind groups which are not used by the new pipeline. and unbind groups
// which are not inherited by the new pipeline.
if (mLastAppliedPipelineLayout) {
BindGroupLayoutMask unusedGroups = mLastAppliedPipelineLayout->GetBindGroupLayoutsMask() &
~mPipelineLayout->GetBindGroupLayoutsMask();
BindGroupLayoutMask lastGroups = mLastAppliedPipelineLayout->GetBindGroupLayoutsMask();
BindGroupLayoutMask currentGroups = mPipelineLayout->GetBindGroupLayoutsMask();
BindGroupLayoutMask unApplyGroups = (mDirtyBindGroups | ~currentGroups) & lastGroups;
// Unset bind groups which are not used by the new pipeline and are not inherited.
for (BindGroupIndex index : IterateBitSet(mDirtyBindGroups | unusedGroups)) {
for (BindGroupIndex index : IterateBitSet(unApplyGroups)) {
UnApplyBindGroup(index);
}
}