Fix issues in end2end tests for enabling buffer lazy clear by default

This patch cleans up some issues in the end2end tests that will cause
test failures when we enable buffer lazy initialization by default.

This patch also skips a test that always fails with Vulkan validation
layer.

BUG=dawn:414
TEST=dawn_end2end_tests

Change-Id: I40f643615b3fec4e52c90d576285534a99950915
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26960
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
Jiawei Shao
2020-08-23 06:08:05 +00:00
committed by Commit Bot service account
parent ce78ce2e28
commit ef74473347
6 changed files with 56 additions and 12 deletions

View File

@@ -1011,13 +1011,15 @@ void DawnTestBase::FlushWire() {
DawnTestBase::ReadbackReservation DawnTestBase::ReserveReadback(uint64_t readbackSize) {
// For now create a new MapRead buffer for each readback
// TODO(cwallez@chromium.org): eventually make bigger buffers and allocate linearly?
wgpu::BufferDescriptor descriptor;
descriptor.size = readbackSize;
descriptor.usage = wgpu::BufferUsage::MapRead | wgpu::BufferUsage::CopyDst;
ReadbackSlot slot;
slot.bufferSize = readbackSize;
slot.buffer = device.CreateBuffer(&descriptor);
// Create and initialize the slot buffer so that it won't unexpectedly affect the count of
// resource lazy clear in the tests.
const std::vector<uint8_t> initialBufferData(readbackSize, 0u);
slot.buffer =
utils::CreateBufferFromData(device, initialBufferData.data(), readbackSize,
wgpu::BufferUsage::MapRead | wgpu::BufferUsage::CopyDst);
ReadbackReservation reservation;
reservation.buffer = slot.buffer;