| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 use_arb_occlusion_query_for_occlusion_query_boolean(false), | 120 use_arb_occlusion_query_for_occlusion_query_boolean(false), |
| 121 native_vertex_array_object(false), | 121 native_vertex_array_object(false), |
| 122 enable_shader_name_hashing(false), | 122 enable_shader_name_hashing(false), |
| 123 enable_samplers(false), | 123 enable_samplers(false), |
| 124 ext_draw_buffers(false), | 124 ext_draw_buffers(false), |
| 125 ext_frag_depth(false), | 125 ext_frag_depth(false), |
| 126 use_async_readpixels(false), | 126 use_async_readpixels(false), |
| 127 map_buffer_range(false), | 127 map_buffer_range(false), |
| 128 ext_discard_framebuffer(false), | 128 ext_discard_framebuffer(false), |
| 129 angle_depth_texture(false), | 129 angle_depth_texture(false), |
| 130 is_angle(false) { | 130 is_angle(false), |
| 131 is_swiftshader(false) { |
| 131 } | 132 } |
| 132 | 133 |
| 133 FeatureInfo::Workarounds::Workarounds() : | 134 FeatureInfo::Workarounds::Workarounds() : |
| 134 #define GPU_OP(type, name) name(false), | 135 #define GPU_OP(type, name) name(false), |
| 135 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 136 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
| 136 #undef GPU_OP | 137 #undef GPU_OP |
| 137 max_texture_size(0), | 138 max_texture_size(0), |
| 138 max_cube_map_texture_size(0) { | 139 max_cube_map_texture_size(0) { |
| 139 } | 140 } |
| 140 | 141 |
| 141 FeatureInfo::FeatureInfo() { | 142 FeatureInfo::FeatureInfo() { |
| 142 InitializeBasicState(*CommandLine::ForCurrentProcess()); | 143 InitializeBasicState(*CommandLine::ForCurrentProcess()); |
| 143 } | 144 } |
| 144 | 145 |
| 145 FeatureInfo::FeatureInfo(const CommandLine& command_line) { | 146 FeatureInfo::FeatureInfo(const CommandLine& command_line) { |
| 146 InitializeBasicState(command_line); | 147 InitializeBasicState(command_line); |
| 147 } | 148 } |
| 148 | 149 |
| 149 void FeatureInfo::InitializeBasicState(const CommandLine& command_line) { | 150 void FeatureInfo::InitializeBasicState(const CommandLine& command_line) { |
| 150 if (command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)) { | 151 if (command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)) { |
| 151 std::string types = command_line.GetSwitchValueASCII( | 152 std::string types = command_line.GetSwitchValueASCII( |
| 152 switches::kGpuDriverBugWorkarounds); | 153 switches::kGpuDriverBugWorkarounds); |
| 153 StringToWorkarounds(types, &workarounds_); | 154 StringToWorkarounds(types, &workarounds_); |
| 154 } | 155 } |
| 155 feature_flags_.enable_shader_name_hashing = | 156 feature_flags_.enable_shader_name_hashing = |
| 156 !command_line.HasSwitch(switches::kDisableShaderNameHashing); | 157 !command_line.HasSwitch(switches::kDisableShaderNameHashing); |
| 157 | 158 |
| 159 feature_flags_.is_swiftshader = |
| 160 (command_line.GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); |
| 161 |
| 158 static const GLenum kAlphaTypes[] = { | 162 static const GLenum kAlphaTypes[] = { |
| 159 GL_UNSIGNED_BYTE, | 163 GL_UNSIGNED_BYTE, |
| 160 }; | 164 }; |
| 161 static const GLenum kRGBTypes[] = { | 165 static const GLenum kRGBTypes[] = { |
| 162 GL_UNSIGNED_BYTE, | 166 GL_UNSIGNED_BYTE, |
| 163 GL_UNSIGNED_SHORT_5_6_5, | 167 GL_UNSIGNED_SHORT_5_6_5, |
| 164 }; | 168 }; |
| 165 static const GLenum kRGBATypes[] = { | 169 static const GLenum kRGBATypes[] = { |
| 166 GL_UNSIGNED_BYTE, | 170 GL_UNSIGNED_BYTE, |
| 167 GL_UNSIGNED_SHORT_4_4_4_4, | 171 GL_UNSIGNED_SHORT_4_4_4_4, |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 if (extensions_.find(str) == std::string::npos) { | 727 if (extensions_.find(str) == std::string::npos) { |
| 724 extensions_ += (extensions_.empty() ? "" : " ") + str; | 728 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 725 } | 729 } |
| 726 } | 730 } |
| 727 | 731 |
| 728 FeatureInfo::~FeatureInfo() { | 732 FeatureInfo::~FeatureInfo() { |
| 729 } | 733 } |
| 730 | 734 |
| 731 } // namespace gles2 | 735 } // namespace gles2 |
| 732 } // namespace gpu | 736 } // namespace gpu |
| OLD | NEW |