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 <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 ShGetInfoLog(compiler_, info_log_.get()); | 202 ShGetInfoLog(compiler_, info_log_.get()); |
203 } else { | 203 } else { |
204 info_log_.reset(); | 204 info_log_.reset(); |
205 } | 205 } |
206 | 206 |
207 return success; | 207 return success; |
208 } | 208 } |
209 | 209 |
210 std::string ShaderTranslator::GetStringForOptionsThatWouldEffectCompilation() | 210 std::string ShaderTranslator::GetStringForOptionsThatWouldEffectCompilation() |
211 const { | 211 const { |
212 const size_t kNumIntFields = 15; | 212 const size_t kNumIntFields = 16; |
213 const size_t kNumEnumFields = 1; | 213 const size_t kNumEnumFields = 1; |
214 const size_t kNumFunctionPointerFields = 1; | 214 const size_t kNumFunctionPointerFields = 1; |
215 struct MustMatchShBuiltInResource { | 215 struct MustMatchShBuiltInResource { |
216 typedef khronos_uint64_t (*FunctionPointer)(const char*, size_t); | 216 typedef khronos_uint64_t (*FunctionPointer)(const char*, size_t); |
217 enum Enum { | 217 enum Enum { |
218 kFirst, | 218 kFirst, |
219 }; | 219 }; |
220 int int_fields[kNumIntFields]; | 220 int int_fields[kNumIntFields]; |
221 FunctionPointer pointer_fields[kNumFunctionPointerFields]; | 221 FunctionPointer pointer_fields[kNumFunctionPointerFields]; |
222 Enum enum_fields[kNumEnumFields]; | 222 Enum enum_fields[kNumEnumFields]; |
(...skipping 28 matching lines...) Expand all Loading... |
251 base::IntToString(compiler_options_.OES_EGL_image_external) + | 251 base::IntToString(compiler_options_.OES_EGL_image_external) + |
252 ":ARB_texture_rectangle:" + | 252 ":ARB_texture_rectangle:" + |
253 base::IntToString(compiler_options_.ARB_texture_rectangle) + | 253 base::IntToString(compiler_options_.ARB_texture_rectangle) + |
254 ":EXT_draw_buffers:" + | 254 ":EXT_draw_buffers:" + |
255 base::IntToString(compiler_options_.EXT_draw_buffers) + | 255 base::IntToString(compiler_options_.EXT_draw_buffers) + |
256 ":FragmentPrecisionHigh:" + | 256 ":FragmentPrecisionHigh:" + |
257 base::IntToString(compiler_options_.FragmentPrecisionHigh) + | 257 base::IntToString(compiler_options_.FragmentPrecisionHigh) + |
258 ":MaxExpressionComplexity:" + | 258 ":MaxExpressionComplexity:" + |
259 base::IntToString(compiler_options_.MaxExpressionComplexity) + | 259 base::IntToString(compiler_options_.MaxExpressionComplexity) + |
260 ":MaxCallStackDepth:" + | 260 ":MaxCallStackDepth:" + |
261 base::IntToString(compiler_options_.MaxCallStackDepth)); | 261 base::IntToString(compiler_options_.MaxCallStackDepth) + |
| 262 ":EXT_frag_depth:" + |
| 263 base::IntToString(compiler_options_.EXT_frag_depth)); |
262 } | 264 } |
263 | 265 |
264 const char* ShaderTranslator::translated_shader() const { | 266 const char* ShaderTranslator::translated_shader() const { |
265 return translated_shader_.get(); | 267 return translated_shader_.get(); |
266 } | 268 } |
267 | 269 |
268 const char* ShaderTranslator::info_log() const { | 270 const char* ShaderTranslator::info_log() const { |
269 return info_log_.get(); | 271 return info_log_.get(); |
270 } | 272 } |
271 | 273 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 translated_shader_.reset(); | 309 translated_shader_.reset(); |
308 info_log_.reset(); | 310 info_log_.reset(); |
309 attrib_map_.clear(); | 311 attrib_map_.clear(); |
310 uniform_map_.clear(); | 312 uniform_map_.clear(); |
311 name_map_.clear(); | 313 name_map_.clear(); |
312 } | 314 } |
313 | 315 |
314 } // namespace gles2 | 316 } // namespace gles2 |
315 } // namespace gpu | 317 } // namespace gpu |
316 | 318 |
OLD | NEW |