summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2021-05-31 22:48:09 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-04 10:20:32 +0200
commitac576923870680b3d2faed7e07bf5a2f971f14cd (patch)
tree104c44be4a568fc006f75e999fa7ef37e6a91ceb
parent56e88f6732bf51e45810b97acc199d318011beed (diff)
downloadqtwebengine-chromium-ac576923870680b3d2faed7e07bf5a2f971f14cd.tar.gz
Enable in-process vulkan
Change-Id: I0cc4822112032d1fed7529d39c7f51684104840d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--chromium/gpu/command_buffer/service/shared_image_factory.cc4
-rw-r--r--chromium/gpu/ipc/service/gpu_init.cc13
2 files changed, 15 insertions, 2 deletions
diff --git a/chromium/gpu/command_buffer/service/shared_image_factory.cc b/chromium/gpu/command_buffer/service/shared_image_factory.cc
index a5828bd7577..99f152ce457 100644
--- a/chromium/gpu/command_buffer/service/shared_image_factory.cc
+++ b/chromium/gpu/command_buffer/service/shared_image_factory.cc
@@ -33,7 +33,7 @@
#include "ui/ozone/public/ozone_platform.h"
#endif
-#if (defined(OS_LINUX) || defined(OS_FUCHSIA) || defined(OS_WIN)) && \
+#if (defined(TOOLKIT_QT) || defined(OS_LINUX) || defined(OS_FUCHSIA) || defined(OS_WIN)) && \
BUILDFLAG(ENABLE_VULKAN)
#include "gpu/command_buffer/service/external_vk_image_factory.h"
#elif defined(OS_ANDROID) && BUILDFLAG(ENABLE_VULKAN)
@@ -153,7 +153,7 @@ SharedImageFactory::SharedImageFactory(
LOG(ERROR) << "ERROR: gr_context_type_ is GrContextType::kVulkan and "
"interop_backing_factory_ is not set";
}
-#elif defined(OS_FUCHSIA) || defined(OS_WIN)
+#elif defined(TOOLKIT_QT) || defined(OS_FUCHSIA) || defined(OS_WIN)
interop_backing_factory_ =
std::make_unique<ExternalVkImageFactory>(context_state);
#elif defined(OS_ANDROID)
diff --git a/chromium/gpu/ipc/service/gpu_init.cc b/chromium/gpu/ipc/service/gpu_init.cc
index 565b62ce4f6..64d11e65d7c 100644
--- a/chromium/gpu/ipc/service/gpu_init.cc
+++ b/chromium/gpu/ipc/service/gpu_init.cc
@@ -147,6 +147,7 @@ class GpuWatchdogInit {
GpuWatchdogThread* watchdog_ptr_ = nullptr;
};
+#ifndef TOOLKIT_QT // unused
// TODO(https://crbug.com/1095744): We currently do not handle
// VK_ERROR_DEVICE_LOST in in-process-gpu.
// Android WebView is allowed for now because it CHECKs on context loss.
@@ -162,6 +163,7 @@ void DisableInProcessGpuVulkan(GpuFeatureInfo* gpu_feature_info,
gpu_preferences->gr_context_type = GrContextType::kGL;
}
}
+#endif
#if BUILDFLAG(ENABLE_VULKAN)
bool MatchGLRenderer(const GPUInfo& gpu_info, const std::string& patterns) {
@@ -800,7 +802,18 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line,
}
#endif
+#ifdef TOOLKIT_QT
+ if (gpu_feature_info_.status_values[GPU_FEATURE_TYPE_VULKAN] !=
+ kGpuFeatureStatusEnabled ||
+ !InitializeVulkan()) {
+ gpu_preferences_.use_vulkan = VulkanImplementationName::kNone;
+ gpu_feature_info_.status_values[GPU_FEATURE_TYPE_VULKAN] =
+ kGpuFeatureStatusDisabled;
+ gpu_preferences_.gr_context_type = GrContextType::kGL;
+ }
+#else
DisableInProcessGpuVulkan(&gpu_feature_info_, &gpu_preferences_);
+#endif
#if defined(OS_WIN)
if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_DECODE_SWAP_CHAIN))