• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <ostream>
19 #include <string>
20 
21 namespace cuttlefish {
22 
23 struct GraphicsAvailability {
24   bool has_egl = false;
25   bool has_gles2 = false;
26   bool has_gles3 = false;
27   bool has_vulkan = false;
28 
29   std::string egl_client_extensions;
30   std::string egl_version;
31   std::string egl_vendor;
32   std::string egl_extensions;
33 
34   bool can_init_gles2_on_egl_surfaceless = false;
35   std::string gles2_vendor;
36   std::string gles2_version;
37   std::string gles2_renderer;
38   std::string gles2_extensions;
39 
40   bool can_init_gles3_on_egl_surfaceless = false;
41   std::string gles3_vendor;
42   std::string gles3_version;
43   std::string gles3_renderer;
44   std::string gles3_extensions;
45 
46   bool has_discrete_gpu = false;
47   std::string discrete_gpu_device_name;
48   std::string discrete_gpu_device_extensions;
49 
50   // See b/264575911.
51   bool vulkan_has_issue_with_precision_qualifiers_on_yuv_samplers = false;
52 };
53 
54 bool ShouldEnableAcceleratedRendering(const GraphicsAvailability& availability);
55 GraphicsAvailability GetGraphicsAvailabilityWithSubprocessCheck();
56 
57 std::ostream& operator<<(std::ostream& out, const GraphicsAvailability& info);
58 
59 }  // namespace cuttlefish
60