From d56b69f115e25f7e76adaa2724952ce44280f9d6 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Thu, 9 Apr 2020 08:16:30 +0000 Subject: [PATCH] Skip Float16 TextureFormatTests on Swiftshader Rendering +-INIFNITY with these formats results in a NaN when using Swiftshader. Temporarily disable these tests while the Swiftshader issue if being resolved. Bug: dawn:283 Bug: swiftshader:147 Change-Id: I6e7c91ff72d0b4b6423175f5ab8586fdea42bb53 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19083 Commit-Queue: Corentin Wallez Reviewed-by: Austin Eng --- src/common/GPUInfo.cpp | 3 +++ src/common/GPUInfo.h | 7 ++++++- src/tests/DawnTest.cpp | 4 ++++ src/tests/DawnTest.h | 1 + src/tests/end2end/TextureFormatTests.cpp | 12 ++++++++++++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/common/GPUInfo.cpp b/src/common/GPUInfo.cpp index 5d80fde75c..60076d2830 100644 --- a/src/common/GPUInfo.cpp +++ b/src/common/GPUInfo.cpp @@ -33,4 +33,7 @@ namespace gpu_info { bool IsQualcomm(PCIVendorID vendorId) { return vendorId == kVendorID_Qualcomm; } + bool IsSwiftshader(PCIVendorID vendorId, PCIDeviceID deviceId) { + return vendorId == kVendorID_Google && deviceId == kDeviceID_Swiftshader; + } } // namespace gpu_info diff --git a/src/common/GPUInfo.h b/src/common/GPUInfo.h index 29d6bb9b86..d16c89b9b9 100644 --- a/src/common/GPUInfo.h +++ b/src/common/GPUInfo.h @@ -18,6 +18,7 @@ #include using PCIVendorID = uint32_t; +using PCIDeviceID = uint32_t; namespace gpu_info { @@ -27,6 +28,9 @@ namespace gpu_info { static constexpr PCIVendorID kVendorID_Intel = 0x8086; static constexpr PCIVendorID kVendorID_Nvidia = 0x10DE; static constexpr PCIVendorID kVendorID_Qualcomm = 0x5143; + static constexpr PCIVendorID kVendorID_Google = 0x1AE0; + + static constexpr PCIDeviceID kDeviceID_Swiftshader = 0xC0DE; bool IsAMD(PCIVendorID vendorId); bool IsARM(PCIVendorID vendorId); @@ -34,6 +38,7 @@ namespace gpu_info { bool IsIntel(PCIVendorID vendorId); bool IsNvidia(PCIVendorID vendorId); bool IsQualcomm(PCIVendorID vendorId); + bool IsSwiftshader(PCIVendorID vendorId, PCIDeviceID deviceId); } // namespace gpu_info -#endif // COMMON_GPUINFO_H \ No newline at end of file +#endif // COMMON_GPUINFO_H diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp index 9a9879692f..0d4a87839e 100644 --- a/src/tests/DawnTest.cpp +++ b/src/tests/DawnTest.cpp @@ -488,6 +488,10 @@ bool DawnTestBase::IsQualcomm() const { return gpu_info::IsQualcomm(mAdapterProperties.vendorID); } +bool DawnTestBase::IsSwiftshader() const { + return gpu_info::IsSwiftshader(mAdapterProperties.vendorID, mAdapterProperties.deviceID); +} + bool DawnTestBase::IsWindows() const { #ifdef DAWN_PLATFORM_WINDOWS return true; diff --git a/src/tests/DawnTest.h b/src/tests/DawnTest.h index 7cbe5398a7..72e0b92327 100644 --- a/src/tests/DawnTest.h +++ b/src/tests/DawnTest.h @@ -190,6 +190,7 @@ class DawnTestBase { bool IsIntel() const; bool IsNvidia() const; bool IsQualcomm() const; + bool IsSwiftshader() const; bool IsWindows() const; bool IsLinux() const; diff --git a/src/tests/end2end/TextureFormatTests.cpp b/src/tests/end2end/TextureFormatTests.cpp index da3b57aa19..24304a3435 100644 --- a/src/tests/end2end/TextureFormatTests.cpp +++ b/src/tests/end2end/TextureFormatTests.cpp @@ -582,16 +582,28 @@ TEST_P(TextureFormatTest, RGBA32Float) { // Test the R16Float format TEST_P(TextureFormatTest, R16Float) { + // TODO(https://crbug.com/swiftshader/147) Rendering INFINITY isn't handled correctly by + // swiftshader + DAWN_SKIP_TEST_IF(IsVulkan() && IsSwiftshader()); + DoFloat16Test({wgpu::TextureFormat::R16Float, 2, wgpu::TextureComponentType::Float, 1}); } // Test the RG16Float format TEST_P(TextureFormatTest, RG16Float) { + // TODO(https://crbug.com/swiftshader/147) Rendering INFINITY isn't handled correctly by + // swiftshader + DAWN_SKIP_TEST_IF(IsVulkan() && IsSwiftshader()); + DoFloat16Test({wgpu::TextureFormat::RG16Float, 4, wgpu::TextureComponentType::Float, 2}); } // Test the RGBA16Float format TEST_P(TextureFormatTest, RGBA16Float) { + // TODO(https://crbug.com/swiftshader/147) Rendering INFINITY isn't handled correctly by + // swiftshader + DAWN_SKIP_TEST_IF(IsVulkan() && IsSwiftshader()); + DoFloat16Test({wgpu::TextureFormat::RGBA16Float, 8, wgpu::TextureComponentType::Float, 4}); }