dawn-cmake/src/dawn/tests/end2end/MemoryAllocationStressTests.cpp
Peng Huang 34d52ffa4c Revert "d3d11: add d3d11 backend in end2end tests"
This reverts commit 3fcf96dd8c262c69029a47ce6ad85314fcd3d69b.

Reason for revert: want to enable end2end test piece by piece on bots for d3d11

Original change's description:
> d3d11: add d3d11 backend in end2end tests
>
> Right now, many tests are not passed becasue unimplemented
> features in d3d11 backend. HoweverD3D11 backend is disabled on
> bots by default, so this CL will not break out bots.
>
> Bug: dawn:1705
> Change-Id: I57321b86a404bc245b71c467479fdee0464dee9b
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126260
> Commit-Queue: Peng Huang <penghuang@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>
> Kokoro: Kokoro <noreply+kokoro@google.com>

Bug: dawn:1705
Change-Id: I95a1cc9a0962b01a6b31ea32b6129f109f4b3e42
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127240
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2023-04-13 22:45:28 +00:00

46 lines
1.8 KiB
C++

// Copyright 2021 The Dawn Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "dawn/tests/DawnTest.h"
class MemoryAllocationStressTests : public DawnTest {};
// Test memory allocation is freed correctly when creating and destroying large buffers.
// It will consume a total of 100G of memory, 1G each time. Expect not to trigger out of memory on
// devices with gpu memory less than 100G.
TEST_P(MemoryAllocationStressTests, LargeBuffer) {
// TODO(crbug.com/dawn/957): Memory leak on D3D12, the memory of destroyed buffer cannot be
// released.
DAWN_TEST_UNSUPPORTED_IF(IsD3D12());
// TODO(crbug.com/dawn/957): Check whether it can be reproduced on each backend.
DAWN_TEST_UNSUPPORTED_IF(IsMetal() || IsOpenGL() || IsOpenGLES() || IsVulkan());
uint32_t count = 100;
for (uint32_t i = 0; i < count; i++) {
wgpu::BufferDescriptor descriptor;
descriptor.size = 1024 * 1024 * 1024; // 1G
descriptor.usage = wgpu::BufferUsage::Storage;
wgpu::Buffer buffer = device.CreateBuffer(&descriptor);
buffer.Destroy();
}
}
DAWN_INSTANTIATE_TEST(MemoryAllocationStressTests,
D3D12Backend(),
MetalBackend(),
OpenGLBackend(),
OpenGLESBackend(),
VulkanBackend());