diff --git a/src/dawn/native/vulkan/AdapterVk.cpp b/src/dawn/native/vulkan/AdapterVk.cpp index a4dc1ddf94..3779f9b68c 100644 --- a/src/dawn/native/vulkan/AdapterVk.cpp +++ b/src/dawn/native/vulkan/AdapterVk.cpp @@ -135,13 +135,11 @@ MaybeError Adapter::InitializeSupportedFeaturesImpl() { mSupportedFeatures.EnableFeature(Feature::TextureCompressionBC); } - // TODO(dawn:1549) Fails on Qualcomm-based Android devices. - if (mDeviceInfo.features.textureCompressionETC2 == VK_TRUE && !IsAndroidQualcomm()) { + if (mDeviceInfo.features.textureCompressionETC2 == VK_TRUE) { mSupportedFeatures.EnableFeature(Feature::TextureCompressionETC2); } - // TODO(dawn:1549) Fails on Qualcomm-based Android devices. - if (mDeviceInfo.features.textureCompressionASTC_LDR == VK_TRUE && !IsAndroidQualcomm()) { + if (mDeviceInfo.features.textureCompressionASTC_LDR == VK_TRUE) { mSupportedFeatures.EnableFeature(Feature::TextureCompressionASTC); } diff --git a/src/dawn/tests/DawnTest.cpp b/src/dawn/tests/DawnTest.cpp index 0f0312468b..4a6f9eab66 100644 --- a/src/dawn/tests/DawnTest.cpp +++ b/src/dawn/tests/DawnTest.cpp @@ -1581,6 +1581,20 @@ testing::AssertionResult CheckImpl(const T& expected, const U& actual, const T& return testing::AssertionSuccess(); } +template <> +testing::AssertionResult CheckImpl(const utils::RGBA8& expected, + const utils::RGBA8& actual, + const utils::RGBA8& tolerance) { + if (abs(expected.r - actual.r) > tolerance.r || abs(expected.g - actual.g) > tolerance.g || + abs(expected.b - actual.b) > tolerance.b || abs(expected.a - actual.a) > tolerance.a) { + return tolerance == utils::RGBA8{} + ? testing::AssertionFailure() << expected << ", actual " << actual + : testing::AssertionFailure() + << "within " << tolerance << " of " << expected << ", actual " << actual; + } + return testing::AssertionSuccess(); +} + template <> testing::AssertionResult CheckImpl(const float& expected, const float& actual, diff --git a/src/dawn/tests/DawnTest.h b/src/dawn/tests/DawnTest.h index e1dfe09e9d..b81acc8fcf 100644 --- a/src/dawn/tests/DawnTest.h +++ b/src/dawn/tests/DawnTest.h @@ -360,10 +360,11 @@ class DawnTestBase { wgpu::Extent3D extent, uint32_t level = 0, wgpu::TextureAspect aspect = wgpu::TextureAspect::All, - uint32_t bytesPerRow = 0) { + uint32_t bytesPerRow = 0, + T tolerance = {}) { // No device passed explicitly. Default it, and forward the rest of the args. return AddTextureExpectation(file, line, this->device, expectedData, texture, origin, - extent, level, aspect, bytesPerRow); + extent, level, aspect, bytesPerRow, tolerance); } template @@ -376,11 +377,12 @@ class DawnTestBase { wgpu::Extent3D extent, uint32_t level = 0, wgpu::TextureAspect aspect = wgpu::TextureAspect::All, - uint32_t bytesPerRow = 0) { + uint32_t bytesPerRow = 0, + T tolerance = {}) { return AddTextureExpectationImpl( file, line, std::move(targetDevice), - new detail::ExpectEq(expectedData, - extent.width * extent.height * extent.depthOrArrayLayers), + new detail::ExpectEq( + expectedData, extent.width * extent.height * extent.depthOrArrayLayers, tolerance), texture, origin, extent, level, aspect, sizeof(U), bytesPerRow); } diff --git a/src/dawn/tests/end2end/CompressedTextureFormatTests.cpp b/src/dawn/tests/end2end/CompressedTextureFormatTests.cpp index aea386914c..923237d8bb 100644 --- a/src/dawn/tests/end2end/CompressedTextureFormatTests.cpp +++ b/src/dawn/tests/end2end/CompressedTextureFormatTests.cpp @@ -219,8 +219,13 @@ class CompressedTextureFormatTest : public DawnTestWithParams