Vulkan: Fix 180 and 270 degree rotated resolve

Bug: angleproject:7197
Bug: b/235877059
Change-Id: I4d4ee622f49bb3218449414a1f0dd91fa4e4f541
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3708997
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
This commit is contained in:
Shahbaz Youssefi 2022-06-18 00:13:56 -04:00 коммит произвёл Angle LUCI CQ
Родитель 72f69e8470
Коммит 6d3c637052
5 изменённых файлов: 13 добавлений и 41 удалений

Просмотреть файл

@ -266,7 +266,7 @@
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayDraw.vert.00000000.inc":
"7c6873b4adbfd7ca626a2e2801a96a47",
"src/libANGLE/renderer/vulkan/shaders/src/BlitResolve.frag":
"0b16d3ad95d7dbc2ce7175462152e4f9",
"029da84d0083a96ad9a441d8c181b006",
"src/libANGLE/renderer/vulkan/shaders/src/BlitResolve.frag.json":
"353929c45304fe9c327b50a53c5f1918",
"src/libANGLE/renderer/vulkan/shaders/src/BlitResolveStencilNoExport.comp":

Просмотреть файл

@ -1146,7 +1146,7 @@ angle::Result FramebufferVk::blit(const gl::Context *context,
commonParams.srcExtents[0] = srcFramebufferDimensions.width;
commonParams.srcExtents[1] = srcFramebufferDimensions.height;
commonParams.blitArea = blitArea;
commonParams.linear = filter == GL_LINEAR;
commonParams.linear = filter == GL_LINEAR && !isResolve;
commonParams.flipX = flipX;
commonParams.flipY = flipY;
commonParams.rotation = rotation;

Просмотреть файл

@ -2427,40 +2427,30 @@ angle::Result UtilsVk::blitResolveImpl(ContextVk *contextVk,
switch (params.rotation)
{
case SurfaceRotation::Identity:
break;
case SurfaceRotation::Rotated90Degrees:
shaderParams.rotateXY = 1;
break;
case SurfaceRotation::Rotated180Degrees:
if (isResolve)
{
shaderParams.offset.resolve[0] += params.rotatedOffsetFactor[0];
shaderParams.offset.resolve[1] += params.rotatedOffsetFactor[1];
}
else
{
shaderParams.offset.blit[0] += params.rotatedOffsetFactor[0];
shaderParams.offset.blit[1] += params.rotatedOffsetFactor[1];
}
break;
case SurfaceRotation::Rotated270Degrees:
if (isResolve)
{
shaderParams.offset.resolve[0] += params.rotatedOffsetFactor[0];
shaderParams.offset.resolve[1] += params.rotatedOffsetFactor[1];
// Align the offset with minus 1, or the sample position near the edge will be
// wrong.
shaderParams.offset.resolve[0] += params.rotatedOffsetFactor[0] - 1;
shaderParams.offset.resolve[1] += params.rotatedOffsetFactor[1] - 1;
}
else
{
shaderParams.offset.blit[0] += params.rotatedOffsetFactor[0];
shaderParams.offset.blit[1] += params.rotatedOffsetFactor[1];
}
shaderParams.rotateXY = 1;
break;
default:
UNREACHABLE();
break;
}
shaderParams.rotateXY = IsRotatedAspectRatio(params.rotation);
bool blitColor = srcColorView != nullptr;
bool blitDepth = srcDepthView != nullptr;
bool blitStencil = srcStencilView != nullptr;
@ -2687,42 +2677,30 @@ angle::Result UtilsVk::stencilBlitResolveNoShaderExport(ContextVk *contextVk,
switch (params.rotation)
{
case SurfaceRotation::Identity:
break;
case SurfaceRotation::Rotated90Degrees:
shaderParams.rotateXY = 1;
break;
case SurfaceRotation::Rotated180Degrees:
case SurfaceRotation::Rotated270Degrees:
if (isResolve)
{
// Align the offset with minus 1, or the sample position near the edge will be
// wrong.
shaderParams.offset.resolve[0] += params.rotatedOffsetFactor[0] - 1;
shaderParams.offset.resolve[1] += params.rotatedOffsetFactor[1];
}
else
{
shaderParams.offset.blit[0] += params.rotatedOffsetFactor[0] - 1;
shaderParams.offset.blit[1] += params.rotatedOffsetFactor[1];
}
break;
case SurfaceRotation::Rotated270Degrees:
if (isResolve)
{
shaderParams.offset.resolve[0] += params.rotatedOffsetFactor[0] - 1;
shaderParams.offset.resolve[1] += params.rotatedOffsetFactor[1] - 1;
}
else
{
shaderParams.offset.blit[0] += params.rotatedOffsetFactor[0] - 1;
shaderParams.offset.blit[1] += params.rotatedOffsetFactor[1] - 1;
shaderParams.offset.blit[0] += params.rotatedOffsetFactor[0];
shaderParams.offset.blit[1] += params.rotatedOffsetFactor[1];
}
shaderParams.rotateXY = 1;
break;
default:
UNREACHABLE();
break;
}
shaderParams.rotateXY = IsRotatedAspectRatio(params.rotation);
// Linear sampling is only valid with color blitting.
ASSERT(!params.linear);

Просмотреть файл

@ -170,7 +170,6 @@ void main()
//
// Note that T is params.stretch and O is params.offset.
// X
CoordType srcImageCoords = CoordType(gl_FragCoord.xy); // X
#if !IsResolve
srcImageCoords *= params.stretch; // TX

Просмотреть файл

@ -48,17 +48,12 @@
6926 VULKAN : Texture2DTestES3.TextureRGBUpdateWithPBO/ES3_Vulkan* = SKIP
6730 VULKAN : GLSLTest_ES3.GLVertexIDIntegerTextureDrawElementsU8Line/* = SKIP
6730 VULKAN : GLSLTest_ES3.GLVertexIDIntegerTextureDrawElementsU8LineIds/* = SKIP
7197 VULKAN : BlitFramebufferTest.ResolveWithRotation/ES3_Vulkan_EmulatedPrerotation180 = SKIP
7197 VULKAN : BlitFramebufferTest.ResolveWithRotation/ES3_Vulkan_EmulatedPrerotation270 = SKIP
7197 VULKAN : BlitFramebufferTest.BlitMultisampleStencilToDefault/ES3_Vulkan_EmulatedPrerotation180 = SKIP
7198 VULKAN : BlitFramebufferTest.BlitMultisampleStencilToDefault/ES3_Vulkan_EmulatedPrerotation90 = SKIP
7198 VULKAN : BlitFramebufferTest.BlitMultisampleStencilToDefault/ES3_Vulkan_EmulatedPrerotation270 = SKIP
7291 VULKAN : BlitFramebufferTest.Blit3D/* = SKIP
7291 VULKAN : BlitFramebufferTest.Blit3DTo2DArray/* = SKIP
7291 VULKAN : BlitFramebufferTest.Blit2DArrayTo3D/* = SKIP
235523746 VULKAN : VulkanPerformanceCounterTest.CreateDestroyTextureDoesNotIncreaseDescriptporSetCache/* = SKIP
235877059 VULKAN : MultisampleTestES3.ResolveToFBO/ES3_Vulkan_EmulatedPrerotation180 = SKIP
235877059 VULKAN : MultisampleTestES3.ResolveToFBO/ES3_Vulkan_EmulatedPrerotation270 = SKIP
// Windows
3786 WIN NVIDIA D3D11 : BufferDataOverflowTest.VertexBufferIntegerOverflow/* = SKIP