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/shader_translator.h" | 5 #include "gpu/command_buffer/service/shader_translator.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 driver_bug_workarounds_ = driver_bug_workarounds; | 128 driver_bug_workarounds_ = driver_bug_workarounds; |
129 return compiler_ != NULL; | 129 return compiler_ != NULL; |
130 } | 130 } |
131 | 131 |
132 int ShaderTranslator::GetCompileOptions() const { | 132 int ShaderTranslator::GetCompileOptions() const { |
133 int compile_options = | 133 int compile_options = |
134 SH_OBJECT_CODE | SH_VARIABLES | SH_ENFORCE_PACKING_RESTRICTIONS | | 134 SH_OBJECT_CODE | SH_VARIABLES | SH_ENFORCE_PACKING_RESTRICTIONS | |
135 SH_LIMIT_EXPRESSION_COMPLEXITY | SH_LIMIT_CALL_STACK_DEPTH | | 135 SH_LIMIT_EXPRESSION_COMPLEXITY | SH_LIMIT_CALL_STACK_DEPTH | |
136 SH_CLAMP_INDIRECT_ARRAY_BOUNDS; | 136 SH_CLAMP_INDIRECT_ARRAY_BOUNDS; |
137 | 137 |
138 if (CommandLine::ForCurrentProcess()->HasSwitch( | 138 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
139 switches::kGLShaderIntermOutput)) | 139 switches::kGLShaderIntermOutput)) |
140 compile_options |= SH_INTERMEDIATE_TREE; | 140 compile_options |= SH_INTERMEDIATE_TREE; |
141 | 141 |
142 compile_options |= driver_bug_workarounds_; | 142 compile_options |= driver_bug_workarounds_; |
143 | 143 |
144 return compile_options; | 144 return compile_options; |
145 } | 145 } |
146 | 146 |
147 bool ShaderTranslator::Translate(const std::string& shader_source, | 147 bool ShaderTranslator::Translate(const std::string& shader_source, |
148 std::string* info_log, | 148 std::string* info_log, |
149 std::string* translated_source, | 149 std::string* translated_source, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 destruction_observers_, | 205 destruction_observers_, |
206 OnDestruct(this)); | 206 OnDestruct(this)); |
207 | 207 |
208 if (compiler_ != NULL) | 208 if (compiler_ != NULL) |
209 ShDestruct(compiler_); | 209 ShDestruct(compiler_); |
210 } | 210 } |
211 | 211 |
212 } // namespace gles2 | 212 } // namespace gles2 |
213 } // namespace gpu | 213 } // namespace gpu |
214 | 214 |
OLD | NEW |