mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +00:00
Check if allocation is valid before deallocating.
Ensure deallocate does not assert should allocation fail but still be used. BUG=dawn:227 Change-Id: I5edd4c160bced7934970c5d59e541a3a8f7a8afb Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11380 Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com> Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
ae4dbeb178
commit
bdd88a7dc1
@@ -627,6 +627,17 @@ TEST_P(CreateBufferMappedTests, CreateThenMapBeforeUnmapFailureAsync) {
|
||||
EXPECT_BUFFER_U32_EQ(myData, result.buffer, 0);
|
||||
}
|
||||
|
||||
// Test that creating a very large buffers fails gracefully.
|
||||
TEST_P(CreateBufferMappedTests, LargeBufferFails) {
|
||||
// TODO(http://crbug.com/dawn/27): Missing support.
|
||||
DAWN_SKIP_TEST_IF(IsMetal() || IsOpenGL());
|
||||
|
||||
dawn::BufferDescriptor descriptor;
|
||||
descriptor.size = std::numeric_limits<uint64_t>::max();
|
||||
descriptor.usage = dawn::BufferUsage::MapRead | dawn::BufferUsage::CopyDst;
|
||||
ASSERT_DEVICE_ERROR(device.CreateBuffer(&descriptor));
|
||||
}
|
||||
|
||||
DAWN_INSTANTIATE_TEST(CreateBufferMappedTests,
|
||||
D3D12Backend,
|
||||
MetalBackend,
|
||||
|
||||
Reference in New Issue
Block a user