Commit 111a4d97 by Antonio Maiorano Committed by Commit Bot

Fix copy texture to sRGB in ANGLE/VK

Like the GL backend, use the CPU copy path rather than the draw path when the target is sRGB. Fixes the following WebGL tests: conformance2/textures/canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html conformance2/textures/canvas/tex-2d-srgb8-rgb-unsigned_byte.html conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html conformance2/textures/image_bitmap_from_canvas/tex-2d-srgb8-rgb-unsigned_byte.html Re-enable CopyTextureTestES3.ES3UnormFormats for Vulkan as they now pass with this change. Bug: b/157934810 Bug: angleproject:4092 Change-Id: I6b76e5f4345d204a084f5483e206c5bb4ff2f139 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2233405Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
parent 8e2b4fef
...@@ -507,7 +507,8 @@ angle::Result TextureVk::copySubTextureImpl(ContextVk *contextVk, ...@@ -507,7 +507,8 @@ angle::Result TextureVk::copySubTextureImpl(ContextVk *contextVk,
sourceLevel, 0, sourceArea, &source->getImage()); sourceLevel, 0, sourceArea, &source->getImage());
} }
bool forceCPUPath = ForceCPUPathForCopy(renderer, *mImage); bool forceCPUPath =
(destFormat.colorEncoding == GL_SRGB) || ForceCPUPathForCopy(renderer, *mImage);
// If it's possible to perform the copy with a draw call, do that. // If it's possible to perform the copy with a draw call, do that.
if (CanCopyWithDraw(renderer, sourceVkFormat, destVkFormat) && !forceCPUPath) if (CanCopyWithDraw(renderer, sourceVkFormat, destVkFormat) && !forceCPUPath)
......
...@@ -1682,7 +1682,7 @@ TEST_P(CopyTextureTestES3, ES3UnormFormats) ...@@ -1682,7 +1682,7 @@ TEST_P(CopyTextureTestES3, ES3UnormFormats)
return; return;
} }
// http://anglebug.com/4092 // http://anglebug.com/4092
ANGLE_SKIP_TEST_IF(IsAndroid() || IsVulkan()); ANGLE_SKIP_TEST_IF(IsAndroid());
auto testOutput = [this](GLuint texture, const GLColor &expectedColor) { auto testOutput = [this](GLuint texture, const GLColor &expectedColor) {
constexpr char kVS[] = constexpr char kVS[] =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment