mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-16 20:31:20 +00:00
This patch fixes a Dawn crash issue when using textures in error state in the copy commands of CommandEncoder. In Dawn's copy commands (copyBufferToTexture and CopyTextureToBuffer), we should check if the texture is in error state or not, or the assert ASSERT(!IsError()) in texture->GetFormat() will fail and a crash will occur. In current Dawn code the validations on the buffer and texture objects in the copy commands are executed in CommandEncoder::Finish(), which is too late for textures according to the previous investigation. This patch moves all these validations to the call of copy commands. The checks on buffers are also moved away to keep the consistency of the ones on textures. BUG=chromium:937628 TEST=dawn_unittests Change-Id: I0bc44e76262fba5927df20c6a7551b107bad5ca1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5240 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>