Add InjectValidationError to command encoder

Needed to implement bytesPerRow/rowsPerImage validation
in Blink.

Bug: dawn:566
Change-Id: I60e9ebd57e40d5043e7277cdc560cbf673bc2576
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32582
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng
2020-11-14 01:24:03 +00:00
committed by Commit Bot service account
parent b38a9c3ee7
commit 464aaeb558
6 changed files with 32 additions and 2 deletions

View File

@@ -180,3 +180,10 @@ TEST_F(CommandBufferValidationTest, CallsAfterAFailedFinish) {
ASSERT_DEVICE_ERROR(encoder.CopyBufferToBuffer(copyBuffer, 0, copyBuffer, 0, 0));
}
// Test that calling inject validation error produces an error.
TEST_F(CommandBufferValidationTest, InjectValidationError) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
encoder.InjectValidationError("my error");
ASSERT_DEVICE_ERROR(encoder.Finish());
}