mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 16:37:08 +00:00
CopyTextureForBrowser: Use large triangle to avoid arithmetic precision
In previous internal shader, we draw a just fit-in rectangle to do the copy. But there is arithmetic precision issues in border pixels when copy from a large texture. ANGLE handle the same issue by drawing a large triangle. Dawn adopte the same idea here BUG=dawn:465 Change-Id: I2366e28b1e96e7a33116a170023a5138d8c9f770 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33900 Reviewed-by: Shaobo Yan <shaobo.yan@intel.com> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
This commit is contained in:
committed by
Commit Bot service account
parent
d1b65e0d32
commit
a827aa2c29
@@ -176,6 +176,66 @@ TEST_P(CopyTextureForBrowserTests, PassthroughCopy) {
|
||||
DoTest(textureSpec, textureSpec, {kWidth, kHeight, 1});
|
||||
}
|
||||
|
||||
TEST_P(CopyTextureForBrowserTests, VerifyCopyOnXDirection) {
|
||||
// These tests fails due to crbug.com/tint/63.
|
||||
DAWN_SKIP_TEST_IF(IsSwiftshader());
|
||||
DAWN_SKIP_TEST_IF(IsVulkan());
|
||||
DAWN_SKIP_TEST_IF(IsD3D12() && IsBackendValidationEnabled());
|
||||
|
||||
// OpenGL tests fails due to 'WriteTexture' unimplemented.
|
||||
// Related bug : crbug.com/dawn/483
|
||||
DAWN_SKIP_TEST_IF(IsOpenGL());
|
||||
|
||||
constexpr uint32_t kWidth = 1000;
|
||||
constexpr uint32_t kHeight = 1;
|
||||
|
||||
TextureSpec textureSpec;
|
||||
textureSpec.copyOrigin = {0, 0, 0};
|
||||
textureSpec.level = 0;
|
||||
textureSpec.textureSize = {kWidth, kHeight, 1};
|
||||
DoTest(textureSpec, textureSpec, {kWidth, kHeight, 1});
|
||||
}
|
||||
|
||||
TEST_P(CopyTextureForBrowserTests, VerifyCopyOnYDirection) {
|
||||
// These tests fails due to crbug.com/tint/63.
|
||||
DAWN_SKIP_TEST_IF(IsSwiftshader());
|
||||
DAWN_SKIP_TEST_IF(IsVulkan());
|
||||
DAWN_SKIP_TEST_IF(IsD3D12() && IsBackendValidationEnabled());
|
||||
|
||||
// OpenGL tests fails due to 'WriteTexture' unimplemented.
|
||||
// Related bug : crbug.com/dawn/483
|
||||
DAWN_SKIP_TEST_IF(IsOpenGL());
|
||||
|
||||
constexpr uint32_t kWidth = 1;
|
||||
constexpr uint32_t kHeight = 1000;
|
||||
|
||||
TextureSpec textureSpec;
|
||||
textureSpec.copyOrigin = {0, 0, 0};
|
||||
textureSpec.level = 0;
|
||||
textureSpec.textureSize = {kWidth, kHeight, 1};
|
||||
DoTest(textureSpec, textureSpec, {kWidth, kHeight, 1});
|
||||
}
|
||||
|
||||
TEST_P(CopyTextureForBrowserTests, VerifyCopyFromLargeTexture) {
|
||||
// These tests fails due to crbug.com/tint/63.
|
||||
DAWN_SKIP_TEST_IF(IsSwiftshader());
|
||||
DAWN_SKIP_TEST_IF(IsVulkan());
|
||||
DAWN_SKIP_TEST_IF(IsD3D12() && IsBackendValidationEnabled());
|
||||
|
||||
// OpenGL tests fails due to 'WriteTexture' unimplemented.
|
||||
// Related bug : crbug.com/dawn/483
|
||||
DAWN_SKIP_TEST_IF(IsOpenGL());
|
||||
|
||||
constexpr uint32_t kWidth = 899;
|
||||
constexpr uint32_t kHeight = 999;
|
||||
|
||||
TextureSpec textureSpec;
|
||||
textureSpec.copyOrigin = {0, 0, 0};
|
||||
textureSpec.level = 0;
|
||||
textureSpec.textureSize = {kWidth, kHeight, 1};
|
||||
DoTest(textureSpec, textureSpec, {kWidth, kHeight, 1});
|
||||
}
|
||||
|
||||
DAWN_INSTANTIATE_TEST(CopyTextureForBrowserTests,
|
||||
D3D12Backend(),
|
||||
MetalBackend(),
|
||||
|
||||
Reference in New Issue
Block a user