| Flutter Impeller |

workarounds_vk.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "impeller/renderer/backend/vulkan/workarounds_vk.h"
6 #include "impeller/renderer/backend/vulkan/driver_info_vk.h"
7
8 namespace impeller {
9
10 WorkaroundsVK GetWorkaroundsFromDriverInfo(DriverInfoVK& driver_info) {
11 WorkaroundsVK workarounds;
12
13 const auto& adreno_gpu = driver_info.GetAdrenoGPUInfo();
14 const auto& mali_gpu = driver_info.GetMaliGPUInfo();
15
16 workarounds.batch_submit_command_buffer_timeout = true;
17 if (adreno_gpu.has_value()) {
18 workarounds.slow_primitive_restart_performance = true;
19 workarounds.broken_mipmap_generation = true;
20
21 if (adreno_gpu.value() <= AdrenoGPU::kAdreno630) {
22 workarounds.input_attachment_self_dependency_broken = true;
23 }
24
25 if (adreno_gpu.value() >= AdrenoGPU::kAdreno702) {
26 workarounds.batch_submit_command_buffer_timeout = false;
27 }
28 } else if (mali_gpu.has_value()) {
29 workarounds.batch_submit_command_buffer_timeout = false;
30 }
31 return workarounds;
32 }
33
34 } // namespace impeller
impeller::DriverInfoVK
Get information about the Vulkan driver.
Definition: driver_info_vk.h:175
impeller::DriverInfoVK::GetAdrenoGPUInfo
std::optional< AdrenoGPU > GetAdrenoGPUInfo() const
Returns Adreno GPU info if this is a Adreno GPU, otherwise std::nullopt.
Definition: driver_info_vk.cc:369
impeller::DriverInfoVK::GetMaliGPUInfo
std::optional< MaliGPU > GetMaliGPUInfo() const
Returns Mali GPU info if this is a Mali GPU, otherwise std::nullopt.
Definition: driver_info_vk.cc:365
driver_info_vk.h
impeller
Definition: allocation.cc:12
impeller::AdrenoGPU::kAdreno630
@ kAdreno630
impeller::AdrenoGPU::kAdreno702
@ kAdreno702
impeller::GetWorkaroundsFromDriverInfo
WorkaroundsVK GetWorkaroundsFromDriverInfo(DriverInfoVK &driver_info)
Definition: workarounds_vk.cc:10
impeller::WorkaroundsVK
A non-exhaustive set of driver specific workarounds.
Definition: workarounds_vk.h:13
impeller::WorkaroundsVK::broken_mipmap_generation
bool broken_mipmap_generation
Definition: workarounds_vk.h:36
impeller::WorkaroundsVK::batch_submit_command_buffer_timeout
bool batch_submit_command_buffer_timeout
Definition: workarounds_vk.h:24
impeller::WorkaroundsVK::slow_primitive_restart_performance
bool slow_primitive_restart_performance
Definition: workarounds_vk.h:18
impeller::WorkaroundsVK::input_attachment_self_dependency_broken
bool input_attachment_self_dependency_broken
Definition: workarounds_vk.h:28
workarounds_vk.h