| 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& powervr_gpu = driver_info.GetPowerVRGPUInfo();
15
16 if (adreno_gpu.has_value()) {
17 workarounds.slow_primitive_restart_performance = true;
18 workarounds.broken_mipmap_generation = true;
19
20 if (adreno_gpu.value() <= AdrenoGPU::kAdreno630) {
21 workarounds.input_attachment_self_dependency_broken = true;
22 workarounds.batch_submit_command_buffer_timeout = true;
23 }
24 } else if (powervr_gpu.has_value()) {
25 workarounds.input_attachment_self_dependency_broken = true;
26 }
27 return workarounds;
28 }
29
30 } // namespace impeller
impeller::DriverInfoVK
Get information about the Vulkan driver.
Definition: driver_info_vk.h:195
impeller::DriverInfoVK::GetPowerVRGPUInfo
std::optional< PowerVRGPU > GetPowerVRGPUInfo() const
Returns PowerVR GPU info if this is a PowerVR GPU, otherwise std::nullopt.
Definition: driver_info_vk.cc:405
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:401
driver_info_vk.h
impeller
Definition: allocation.cc:12
impeller::AdrenoGPU::kAdreno630
@ kAdreno630
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:38
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:30
workarounds_vk.h