Commit 31e0a1f2 authored by Klaus Weidner's avatar Klaus Weidner Committed by Commit Bot

Revert "Fill in usage flags and sample fields on skia GrVkImageInfo."

This reverts commit f2038e2b.

Reason for revert: causes crashes on Android 10+: https://crbug.com/1138664

Original change's description:
> Fill in usage flags and sample fields on skia GrVkImageInfo.
>
> Change-Id: I1da7035e84173f5e9d8021ec3d2639f2ba96bf89
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2469261
> Reviewed-by: Peng Huang <penghuang@chromium.org>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Cr-Commit-Position: refs/heads/master@{#817141}

TBR=penghuang@chromium.org,egdaniel@google.com

Change-Id: Ide84d237760384033a83e71137602cd6718d5683
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2473439Reviewed-by: default avatarKlaus Weidner <klausw@chromium.org>
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817278}
parent bdde456e
...@@ -200,8 +200,6 @@ SkSurface* SkiaOutputDeviceVulkan::BeginPaint( ...@@ -200,8 +200,6 @@ SkSurface* SkiaOutputDeviceVulkan::BeginPaint(
vk_image_info.fImageTiling = VK_IMAGE_TILING_OPTIMAL; vk_image_info.fImageTiling = VK_IMAGE_TILING_OPTIMAL;
vk_image_info.fImageLayout = scoped_write_->image_layout(); vk_image_info.fImageLayout = scoped_write_->image_layout();
vk_image_info.fFormat = surface_format; vk_image_info.fFormat = surface_format;
vk_image_info.fImageUsageFlags = scoped_write_->image_usage();
vk_image_info.fSampleCount = 1;
vk_image_info.fLevelCount = 1; vk_image_info.fLevelCount = 1;
vk_image_info.fCurrentQueueFamily = VK_QUEUE_FAMILY_IGNORED; vk_image_info.fCurrentQueueFamily = VK_QUEUE_FAMILY_IGNORED;
vk_image_info.fProtected = vk_image_info.fProtected =
......
...@@ -227,12 +227,6 @@ std::unique_ptr<ExternalVkImageBacking> ExternalVkImageBacking::Create( ...@@ -227,12 +227,6 @@ std::unique_ptr<ExternalVkImageBacking> ExternalVkImageBacking::Create(
VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT; VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
} }
if (usage & SHARED_IMAGE_USAGE_DISPLAY) {
// Skia currently requires all VkImages it uses to support transfers
vk_usage |=
VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
}
auto* vulkan_implementation = auto* vulkan_implementation =
context_state->vk_context_provider()->GetVulkanImplementation(); context_state->vk_context_provider()->GetVulkanImplementation();
VkImageCreateFlags vk_flags = 0; VkImageCreateFlags vk_flags = 0;
......
...@@ -208,7 +208,6 @@ TEST_F(ExternalVkImageFactoryTest, DawnWrite_SkiaVulkanRead) { ...@@ -208,7 +208,6 @@ TEST_F(ExternalVkImageFactoryTest, DawnWrite_SkiaVulkanRead) {
auto sk_image = SkImage::MakeFromTexture( auto sk_image = SkImage::MakeFromTexture(
context_state_->gr_context(), backend_texture, kTopLeft_GrSurfaceOrigin, context_state_->gr_context(), backend_texture, kTopLeft_GrSurfaceOrigin,
kRGBA_8888_SkColorType, kOpaque_SkAlphaType, nullptr); kRGBA_8888_SkColorType, kOpaque_SkAlphaType, nullptr);
EXPECT_TRUE(sk_image);
const SkImageInfo dst_info = const SkImageInfo dst_info =
SkImageInfo::Make(size.width(), size.height(), kRGBA_8888_SkColorType, SkImageInfo::Make(size.width(), size.height(), kRGBA_8888_SkColorType,
......
...@@ -219,8 +219,6 @@ GrVkImageInfo CreateGrVkImageInfo(VulkanImage* image) { ...@@ -219,8 +219,6 @@ GrVkImageInfo CreateGrVkImageInfo(VulkanImage* image) {
image_info.fImageTiling = image->image_tiling(); image_info.fImageTiling = image->image_tiling();
image_info.fImageLayout = image->image_layout(); image_info.fImageLayout = image->image_layout();
image_info.fFormat = image->format(); image_info.fFormat = image->format();
image_info.fImageUsageFlags = image->usage();
image_info.fSampleCount = 1;
image_info.fLevelCount = 1; image_info.fLevelCount = 1;
image_info.fCurrentQueueFamily = image->queue_family_index(); image_info.fCurrentQueueFamily = image->queue_family_index();
image_info.fProtected = is_protected ? GrProtected::kYes : GrProtected::kNo; image_info.fProtected = is_protected ? GrProtected::kYes : GrProtected::kNo;
......
...@@ -120,8 +120,6 @@ void VulkanDemo::CreateSkSurface() { ...@@ -120,8 +120,6 @@ void VulkanDemo::CreateSkSurface() {
vk_image_info.fImageLayout = scoped_write_->image_layout(); vk_image_info.fImageLayout = scoped_write_->image_layout();
vk_image_info.fImageTiling = VK_IMAGE_TILING_OPTIMAL; vk_image_info.fImageTiling = VK_IMAGE_TILING_OPTIMAL;
vk_image_info.fFormat = VK_FORMAT_B8G8R8A8_UNORM; vk_image_info.fFormat = VK_FORMAT_B8G8R8A8_UNORM;
vk_image_info.fImageUsageFlags = scoped_write_->image_usage();
vk_image_info.fSampleCount = 1;
vk_image_info.fLevelCount = 1; vk_image_info.fLevelCount = 1;
const auto& size = vulkan_surface_->image_size(); const auto& size = vulkan_surface_->image_size();
GrBackendRenderTarget render_target(size.width(), size.height(), 0, GrBackendRenderTarget render_target(size.width(), size.height(), 0,
......
...@@ -234,8 +234,6 @@ bool VulkanSwapChain::InitializeSwapChain( ...@@ -234,8 +234,6 @@ bool VulkanSwapChain::InitializeSwapChain(
base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()}); base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()});
} }
image_usage_ = image_usage_flags;
return true; return true;
} }
...@@ -292,7 +290,6 @@ void VulkanSwapChain::DestroySwapImages() { ...@@ -292,7 +290,6 @@ void VulkanSwapChain::DestroySwapImages() {
bool VulkanSwapChain::BeginWriteCurrentImage(VkImage* image, bool VulkanSwapChain::BeginWriteCurrentImage(VkImage* image,
uint32_t* image_index, uint32_t* image_index,
VkImageLayout* image_layout, VkImageLayout* image_layout,
VkImageUsageFlags* image_usage,
VkSemaphore* begin_semaphore, VkSemaphore* begin_semaphore,
VkSemaphore* end_semaphore) { VkSemaphore* end_semaphore) {
base::AutoLock auto_lock(lock_); base::AutoLock auto_lock(lock_);
...@@ -300,7 +297,6 @@ bool VulkanSwapChain::BeginWriteCurrentImage(VkImage* image, ...@@ -300,7 +297,6 @@ bool VulkanSwapChain::BeginWriteCurrentImage(VkImage* image,
DCHECK(image); DCHECK(image);
DCHECK(image_index); DCHECK(image_index);
DCHECK(image_layout); DCHECK(image_layout);
DCHECK(image_usage);
DCHECK(begin_semaphore); DCHECK(begin_semaphore);
DCHECK(end_semaphore); DCHECK(end_semaphore);
DCHECK(!is_writing_); DCHECK(!is_writing_);
...@@ -331,7 +327,6 @@ bool VulkanSwapChain::BeginWriteCurrentImage(VkImage* image, ...@@ -331,7 +327,6 @@ bool VulkanSwapChain::BeginWriteCurrentImage(VkImage* image,
*image = current_image_data.image; *image = current_image_data.image;
*image_index = *acquired_image_; *image_index = *acquired_image_;
*image_layout = current_image_data.image_layout; *image_layout = current_image_data.image_layout;
*image_usage = image_usage_;
*begin_semaphore = current_image_data.acquire_semaphore; *begin_semaphore = current_image_data.acquire_semaphore;
*end_semaphore = current_image_data.present_semaphore; *end_semaphore = current_image_data.present_semaphore;
is_writing_ = true; is_writing_ = true;
...@@ -573,7 +568,7 @@ void VulkanSwapChain::ReturnFenceAndSemaphores( ...@@ -573,7 +568,7 @@ void VulkanSwapChain::ReturnFenceAndSemaphores(
VulkanSwapChain::ScopedWrite::ScopedWrite(VulkanSwapChain* swap_chain) VulkanSwapChain::ScopedWrite::ScopedWrite(VulkanSwapChain* swap_chain)
: swap_chain_(swap_chain) { : swap_chain_(swap_chain) {
success_ = swap_chain_->BeginWriteCurrentImage( success_ = swap_chain_->BeginWriteCurrentImage(
&image_, &image_index_, &image_layout_, &image_usage_, &begin_semaphore_, &image_, &image_index_, &image_layout_, &begin_semaphore_,
&end_semaphore_); &end_semaphore_);
if (LIKELY(success_)) { if (LIKELY(success_)) {
DCHECK(begin_semaphore_ != VK_NULL_HANDLE); DCHECK(begin_semaphore_ != VK_NULL_HANDLE);
......
...@@ -42,7 +42,6 @@ class COMPONENT_EXPORT(VULKAN) VulkanSwapChain { ...@@ -42,7 +42,6 @@ class COMPONENT_EXPORT(VULKAN) VulkanSwapChain {
VkImage image() const { return image_; } VkImage image() const { return image_; }
uint32_t image_index() const { return image_index_; } uint32_t image_index() const { return image_index_; }
VkImageLayout image_layout() const { return image_layout_; } VkImageLayout image_layout() const { return image_layout_; }
VkImageUsageFlags image_usage() const { return image_usage_; }
VkSemaphore begin_semaphore() const { return begin_semaphore_; } VkSemaphore begin_semaphore() const { return begin_semaphore_; }
VkSemaphore end_semaphore() const { return end_semaphore_; } VkSemaphore end_semaphore() const { return end_semaphore_; }
...@@ -52,7 +51,6 @@ class COMPONENT_EXPORT(VULKAN) VulkanSwapChain { ...@@ -52,7 +51,6 @@ class COMPONENT_EXPORT(VULKAN) VulkanSwapChain {
VkImage image_ = VK_NULL_HANDLE; VkImage image_ = VK_NULL_HANDLE;
uint32_t image_index_ = 0; uint32_t image_index_ = 0;
VkImageLayout image_layout_ = VK_IMAGE_LAYOUT_UNDEFINED; VkImageLayout image_layout_ = VK_IMAGE_LAYOUT_UNDEFINED;
VkImageUsageFlags image_usage_ = 0;
VkSemaphore begin_semaphore_ = VK_NULL_HANDLE; VkSemaphore begin_semaphore_ = VK_NULL_HANDLE;
VkSemaphore end_semaphore_ = VK_NULL_HANDLE; VkSemaphore end_semaphore_ = VK_NULL_HANDLE;
...@@ -136,7 +134,6 @@ class COMPONENT_EXPORT(VULKAN) VulkanSwapChain { ...@@ -136,7 +134,6 @@ class COMPONENT_EXPORT(VULKAN) VulkanSwapChain {
bool BeginWriteCurrentImage(VkImage* image, bool BeginWriteCurrentImage(VkImage* image,
uint32_t* image_index, uint32_t* image_index,
VkImageLayout* layout, VkImageLayout* layout,
VkImageUsageFlags* usage,
VkSemaphore* begin_semaphore, VkSemaphore* begin_semaphore,
VkSemaphore* end_semaphore); VkSemaphore* end_semaphore);
void EndWriteCurrentImage(); void EndWriteCurrentImage();
...@@ -166,8 +163,6 @@ class COMPONENT_EXPORT(VULKAN) VulkanSwapChain { ...@@ -166,8 +163,6 @@ class COMPONENT_EXPORT(VULKAN) VulkanSwapChain {
// Images in the swap chain. // Images in the swap chain.
std::vector<ImageData> images_ GUARDED_BY(lock_); std::vector<ImageData> images_ GUARDED_BY(lock_);
VkImageUsageFlags image_usage_ = 0;
// True if BeginWriteCurrentImage() is called, but EndWriteCurrentImage() is // True if BeginWriteCurrentImage() is called, but EndWriteCurrentImage() is
// not. // not.
bool is_writing_ GUARDED_BY(lock_) = false; bool is_writing_ GUARDED_BY(lock_) = false;
......
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