aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-03-21 09:48:44 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-21 14:28:53 +0000
commita3b6a551510eccf8bee95c739a1f1c7c70356608 (patch)
treeba52a3d689055d11b34d834db83df52769d61eea
parent1683f786cadf57a56fb1983ab8bb6df91c50d0ef (diff)
In Vulkan make sure to add barriers between write operations
BUG=skia:6396 Change-Id: I60faf6ad9095f18c64e33a0359e30239efbac79f Reviewed-on: https://skia-review.googlesource.com/9963 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
-rw-r--r--infra/bots/recipe_modules/sktest/api.py1
-rw-r--r--infra/bots/recipe_modules/sktest/example.expected/Test-Win10-MSVC-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-Vulkan.json1
-rw-r--r--src/gpu/vk/GrVkImage.cpp11
3 files changed, 6 insertions, 7 deletions
diff --git a/infra/bots/recipe_modules/sktest/api.py b/infra/bots/recipe_modules/sktest/api.py
index 8a2eee7e31..73df2c3fa4 100644
--- a/infra/bots/recipe_modules/sktest/api.py
+++ b/infra/bots/recipe_modules/sktest/api.py
@@ -401,7 +401,6 @@ def dm_flags(bot):
match.append('~ComposedImageFilterBounds_Gpu')
match.append('~CopySurface')
match.append('~ImageFilterZeroBlurSigma_Gpu')
- match.append('~ReadWriteAlpha')
match.append('~XfermodeImageFilterCroppedInput_Gpu')
if 'Vulkan' in bot and 'IntelIris540' in bot and 'Ubuntu' in bot:
diff --git a/infra/bots/recipe_modules/sktest/example.expected/Test-Win10-MSVC-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-Vulkan.json b/infra/bots/recipe_modules/sktest/example.expected/Test-Win10-MSVC-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-Vulkan.json
index 4c69425f24..71576986ce 100644
--- a/infra/bots/recipe_modules/sktest/example.expected/Test-Win10-MSVC-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-Vulkan.json
+++ b/infra/bots/recipe_modules/sktest/example.expected/Test-Win10-MSVC-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-Vulkan.json
@@ -373,7 +373,6 @@
"~ComposedImageFilterBounds_Gpu",
"~CopySurface",
"~ImageFilterZeroBlurSigma_Gpu",
- "~ReadWriteAlpha",
"~XfermodeImageFilterCroppedInput_Gpu"
],
"env": {
diff --git a/src/gpu/vk/GrVkImage.cpp b/src/gpu/vk/GrVkImage.cpp
index d0457ca28b..c3302a2b04 100644
--- a/src/gpu/vk/GrVkImage.cpp
+++ b/src/gpu/vk/GrVkImage.cpp
@@ -33,11 +33,12 @@ void GrVkImage::setImageLayout(const GrVkGpu* gpu, VkImageLayout newLayout,
VK_IMAGE_LAYOUT_PREINITIALIZED != newLayout);
VkImageLayout currentLayout = this->currentLayout();
- // If the old and new layout are the same, there is no reason to put in a barrier since the
- // operations used for each layout are implicitly synchronized with eachother. The one exception
- // is if the layout is GENERAL. In this case the image could have been used for any operation so
- // we must respect the barrier.
- if (newLayout == currentLayout && VK_IMAGE_LAYOUT_GENERAL != currentLayout) {
+ // If the old and new layout are the same and the layout is a read only layout, there is no need
+ // to put in a barrier.
+ if (newLayout == currentLayout &&
+ (VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL == currentLayout ||
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL == currentLayout ||
+ VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL == currentLayout)) {
return;
}