D3D11: Enable compat mode in end2end tests
Bug: 345280232
Change-Id: I5ada513ef3587ed168ad55e9ea8b3b4c6ee9493f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/219215
Reviewed-by: Loko Kung <lokokung@google.com>
Auto-Submit: Quyen Le <lehoangquyen@chromium.org>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
diff --git a/src/dawn/native/d3d11/TextureD3D11.cpp b/src/dawn/native/d3d11/TextureD3D11.cpp
index f0f6776..09d0019 100644
--- a/src/dawn/native/d3d11/TextureD3D11.cpp
+++ b/src/dawn/native/d3d11/TextureD3D11.cpp
@@ -1122,7 +1122,7 @@
return {};
};
- // TODO(dawn:1705): Work out a way of GPU-GPU copy, rather than the CPU-GPU round trip.
+ // TODO(383779503): Work out a way of GPU-GPU copy, rather than the CPU-GPU round trip.
GetDevice()->EmitWarningOnce("Sampling the stencil component is rather slow now.");
DAWN_TRY(Read(commandContext, singleRange, {0, 0, 0}, size, bytesPerRow, rowsPerImage,
callback));
diff --git a/src/dawn/tests/DawnTest.cpp b/src/dawn/tests/DawnTest.cpp
index 9e828f8..8755860 100644
--- a/src/dawn/tests/DawnTest.cpp
+++ b/src/dawn/tests/DawnTest.cpp
@@ -484,11 +484,10 @@
wgpu::AdapterInfo info;
adapter.GetInfo(&info);
- // Skip non-OpenGLES compat adapters. Metal/Vulkan/D3D12 support
+ // Skip non-OpenGLES/D3D11 compat adapters. Metal/Vulkan/D3D12 support
// core WebGPU.
- // D3D11 is in an experimental state where it may support core.
- // See crbug.com/dawn/1820 for determining d3d11 capabilities.
- if (info.compatibilityMode && info.backendType != wgpu::BackendType::OpenGLES) {
+ if (info.compatibilityMode && info.backendType != wgpu::BackendType::OpenGLES &&
+ info.backendType != wgpu::BackendType::D3D11) {
continue;
}
diff --git a/src/dawn/tests/end2end/DepthBiasTests.cpp b/src/dawn/tests/end2end/DepthBiasTests.cpp
index 2ed4f5f..8bbe56c 100644
--- a/src/dawn/tests/end2end/DepthBiasTests.cpp
+++ b/src/dawn/tests/end2end/DepthBiasTests.cpp
@@ -187,6 +187,10 @@
DAWN_TEST_UNSUPPORTED_IF(IsOpenGL());
DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES());
+ // Depth bias clamp is not supported in compat mode.
+ // https://github.com/gpuweb/gpuweb/blob/main/proposals/compatibility-mode.md#9-depth-bias-clamp-must-be-zero
+ DAWN_TEST_UNSUPPORTED_IF(IsCompatibilityMode());
+
// Draw quad flat on z = 0.25 with 0.25 bias clamped at 0.125.
RunDepthBiasTest(wgpu::TextureFormat::Depth32Float, 0, QuadAngle::Flat,
kPointTwoFiveBiasForPointTwoFiveZOnFloat, 0, 0.125);
@@ -225,6 +229,10 @@
DAWN_TEST_UNSUPPORTED_IF(IsOpenGL());
DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES());
+ // Depth bias clamp is not supported in compat mode.
+ // https://github.com/gpuweb/gpuweb/blob/main/proposals/compatibility-mode.md#9-depth-bias-clamp-must-be-zero
+ DAWN_TEST_UNSUPPORTED_IF(IsCompatibilityMode());
+
// Draw quad flat on z = 0.25 with -0.25 bias clamped at -0.125.
RunDepthBiasTest(wgpu::TextureFormat::Depth32Float, 0, QuadAngle::Flat,
-kPointTwoFiveBiasForPointTwoFiveZOnFloat, 0, -0.125);
@@ -344,6 +352,10 @@
DAWN_TEST_UNSUPPORTED_IF(IsOpenGL());
DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES());
+ // Depth bias clamp is not supported in compat mode.
+ // https://github.com/gpuweb/gpuweb/blob/main/proposals/compatibility-mode.md#9-depth-bias-clamp-must-be-zero
+ DAWN_TEST_UNSUPPORTED_IF(IsCompatibilityMode());
+
// Draw quad flat on z = 0.25 with 0.25 bias clamped at 0.125.
RunDepthBiasTest(wgpu::TextureFormat::Depth24PlusStencil8, 0.4f, QuadAngle::Flat,
0.25f * (1 << 25), 0, 0.1f);
diff --git a/src/dawn/tests/end2end/MultisampledRenderingTests.cpp b/src/dawn/tests/end2end/MultisampledRenderingTests.cpp
index 2ec4169..d73afa7 100644
--- a/src/dawn/tests/end2end/MultisampledRenderingTests.cpp
+++ b/src/dawn/tests/end2end/MultisampledRenderingTests.cpp
@@ -1717,6 +1717,9 @@
// with DawnLoadResolveTexture feature if there are more than one attachment.
DAWN_TEST_UNSUPPORTED_IF(HasResolveMultipleAttachmentInSeparatePassesToggle());
+ // TODO(383731610): multiple outputs are not working in compat mode.
+ DAWN_SUPPRESS_TEST_IF(IsCompatibilityMode());
+
auto multiSampledTexture1 = CreateTextureForRenderAttachment(kColorFormat, 4, 1, 1,
/*transientAttachment=*/false,
/*supportsTextureBinding=*/false);
@@ -1798,6 +1801,9 @@
// with DawnLoadResolveTexture feature if there are more than one attachment.
DAWN_TEST_UNSUPPORTED_IF(HasResolveMultipleAttachmentInSeparatePassesToggle());
+ // TODO(383731610): multiple outputs are not working in compat mode.
+ DAWN_SUPPRESS_TEST_IF(IsCompatibilityMode());
+
auto multiSampledTexture1 = CreateTextureForRenderAttachment(kColorFormat, 4, 1, 1,
/*transientAttachment=*/false,
/*supportsTextureBinding=*/false);
@@ -2134,6 +2140,9 @@
// Test rendering into a layer of a 2D array texture and load op=LoadOp::ExpandResolveTexture.
TEST_P(DawnLoadResolveTextureTest, DrawThenLoad2DArrayTextureLayer) {
+ // Creating 2D view from 2D array texture is not supported in compat mode.
+ DAWN_TEST_UNSUPPORTED_IF(IsCompatibilityMode());
+
auto multiSampledTexture = CreateTextureForRenderAttachment(kColorFormat, 4, 1, 1,
/*transientAttachment=*/false,
/*supportsTextureBinding=*/false);
diff --git a/src/dawn/tests/end2end/QueueTests.cpp b/src/dawn/tests/end2end/QueueTests.cpp
index 4f3c25c..5248242 100644
--- a/src/dawn/tests/end2end/QueueTests.cpp
+++ b/src/dawn/tests/end2end/QueueTests.cpp
@@ -636,6 +636,10 @@
// TODO(crbug.com/dawn/42241333): diagnose stencil8 failure on Angle Swiftshader
DAWN_SUPPRESS_TEST_IF(format == wgpu::TextureFormat::Stencil8 && IsANGLESwiftShader());
+ // TODO(383765096): D3D11 doesn't allow calling Gather() on R8_UINT
+ DAWN_SUPPRESS_TEST_IF(format == wgpu::TextureFormat::Stencil8 && IsD3D11() &&
+ IsCompatibilityMode());
+
constexpr uint32_t kWidth = 257;
constexpr uint32_t kHeight = 257;
@@ -691,6 +695,9 @@
// TODO(crbug.com/dawn/2095): Failing on ANGLE + SwiftShader, needs investigation.
DAWN_SUPPRESS_TEST_IF(IsANGLESwiftShader());
+ // TODO(383779503): reading stencil texture is too slow on D3D11.
+ DAWN_SUPPRESS_TEST_IF(IsD3D11() && GetParam().mTextureFormat == wgpu::TextureFormat::Stencil8);
+
constexpr uint32_t kWidth = 257;
constexpr uint32_t kHeight = 129;
constexpr uint32_t kLayers = 65;
diff --git a/src/dawn/tests/end2end/RenderPassLoadOpTests.cpp b/src/dawn/tests/end2end/RenderPassLoadOpTests.cpp
index eff93a6..20b48ea 100644
--- a/src/dawn/tests/end2end/RenderPassLoadOpTests.cpp
+++ b/src/dawn/tests/end2end/RenderPassLoadOpTests.cpp
@@ -486,6 +486,10 @@
// Test clearing multiple color attachments with different big signed and unsigned integers can
// still work correctly.
TEST_P(RenderPassLoadOpTests, LoadOpClearWithBig32BitIntegralValuesOnMultipleColorAttachments) {
+ // TODO(383733873): ApplyClearBigIntegerColorValueWithDraw workaround doesn't work with multiple
+ // outputs in compat mode.
+ DAWN_TEST_UNSUPPORTED_IF(IsD3D11() && IsCompatibilityMode());
+
constexpr int32_t kMaxInt32RepresentableInFloat = 1 << std::numeric_limits<float>::digits;
constexpr int32_t kMinInt32RepresentableInFloat = -kMaxInt32RepresentableInFloat;
@@ -685,6 +689,10 @@
// TODO(crbug.com/dawn/2295): diagnose this failure on Pixel 4 OpenGLES
DAWN_SUPPRESS_TEST_IF(IsOpenGLES() && IsAndroid() && IsQualcomm());
+ // TODO(383733873): ApplyClearBigIntegerColorValueWithDraw workaround doesn't work with multiple
+ // outputs in compat mode.
+ DAWN_TEST_UNSUPPORTED_IF(IsD3D11() && IsCompatibilityMode());
+
constexpr int32_t kMaxUInt32RepresentableInFloat = 1 << std::numeric_limits<float>::digits;
wgpu::TextureDescriptor textureDescriptor = {};
diff --git a/src/dawn/tests/end2end/TextureCorruptionTests.cpp b/src/dawn/tests/end2end/TextureCorruptionTests.cpp
index 903d0e9..ad5ec8b 100644
--- a/src/dawn/tests/end2end/TextureCorruptionTests.cpp
+++ b/src/dawn/tests/end2end/TextureCorruptionTests.cpp
@@ -316,6 +316,10 @@
uint32_t sampleCount = GetParam().mSampleCount;
wgpu::Extent3D textureSize = {width, height, depthOrArrayLayerCount};
+ // Compat mode's max texture size is 4096.
+ // https://github.com/gpuweb/gpuweb/blob/main/proposals/compatibility-mode.md#10-lower-limits
+ DAWN_TEST_UNSUPPORTED_IF(IsCompatibilityMode() && (width > 4096 || height > 4096));
+
// Pre-allocate textures. The incorrect write type may corrupt neighboring textures or
// layers.
std::vector<wgpu::Texture> textures;
diff --git a/src/dawn/tests/end2end/VideoViewsTests.cpp b/src/dawn/tests/end2end/VideoViewsTests.cpp
index 5011f05..e3bd954 100644
--- a/src/dawn/tests/end2end/VideoViewsTests.cpp
+++ b/src/dawn/tests/end2end/VideoViewsTests.cpp
@@ -524,6 +524,10 @@
DAWN_TEST_UNSUPPORTED_IF(UsesWire());
DAWN_TEST_UNSUPPORTED_IF(!IsMultiPlanarFormatsSupported());
DAWN_TEST_UNSUPPORTED_IF(!IsFormatSupported());
+ // TODO(382071071): compat mode doesn't allow different texture views to be used in
+ // a draw call. But the tests need texture views to sample and render to separate planes of
+ // a multiplanar texture.
+ DAWN_TEST_UNSUPPORTED_IF(IsCompatibilityMode());
mBackend = VideoViewsTestBackend::Create();
mBackend->OnSetUp(device);
diff --git a/src/dawn/tests/white_box/SharedTextureMemoryTests.cpp b/src/dawn/tests/white_box/SharedTextureMemoryTests.cpp
index 1268a20..070f447 100644
--- a/src/dawn/tests/white_box/SharedTextureMemoryTests.cpp
+++ b/src/dawn/tests/white_box/SharedTextureMemoryTests.cpp
@@ -122,6 +122,10 @@
!SupportsFeatures(GetParam().mBackend->RequiredFeatures(GetAdapter().Get())));
// TODO(crbug.com/342213634): Crashes on ChromeOS volteer devices.
DAWN_SUPPRESS_TEST_IF(IsChromeOS() && IsVulkan() && IsIntel() && IsBackendValidationEnabled());
+
+ // Compat cannot create 2D texture view from a 2D array texture.
+ DAWN_TEST_UNSUPPORTED_IF(IsCompatibilityMode() && GetParam().mLayerCount > 1);
+
GetParam().mBackend->SetUp();
}