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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 ShGetInfoLog(compiler_, info_log_.get()); | 192 ShGetInfoLog(compiler_, info_log_.get()); |
193 } else { | 193 } else { |
194 info_log_.reset(); | 194 info_log_.reset(); |
195 } | 195 } |
196 | 196 |
197 return success; | 197 return success; |
198 } | 198 } |
199 | 199 |
200 std::string ShaderTranslator::GetStringForOptionsThatWouldEffectCompilation() | 200 std::string ShaderTranslator::GetStringForOptionsThatWouldEffectCompilation() |
201 const { | 201 const { |
202 const size_t kNumIntFields = 15; | 202 const size_t kNumIntFields = 16; |
203 const size_t kNumEnumFields = 1; | 203 const size_t kNumEnumFields = 1; |
204 const size_t kNumFunctionPointerFields = 1; | 204 const size_t kNumFunctionPointerFields = 1; |
205 struct MustMatchShBuiltInResource { | 205 struct MustMatchShBuiltInResource { |
206 typedef khronos_uint64_t (*FunctionPointer)(const char*, size_t); | 206 typedef khronos_uint64_t (*FunctionPointer)(const char*, size_t); |
207 enum Enum { | 207 enum Enum { |
208 kFirst, | 208 kFirst, |
209 }; | 209 }; |
210 int int_fields[kNumIntFields]; | 210 int int_fields[kNumIntFields]; |
211 FunctionPointer pointer_fields[kNumFunctionPointerFields]; | 211 FunctionPointer pointer_fields[kNumFunctionPointerFields]; |
212 Enum enum_fields[kNumEnumFields]; | 212 Enum enum_fields[kNumEnumFields]; |
(...skipping 28 matching lines...) Expand all Loading... |
241 base::IntToString(compiler_options_.OES_EGL_image_external) + | 241 base::IntToString(compiler_options_.OES_EGL_image_external) + |
242 ":ARB_texture_rectangle:" + | 242 ":ARB_texture_rectangle:" + |
243 base::IntToString(compiler_options_.ARB_texture_rectangle) + | 243 base::IntToString(compiler_options_.ARB_texture_rectangle) + |
244 ":EXT_draw_buffers:" + | 244 ":EXT_draw_buffers:" + |
245 base::IntToString(compiler_options_.EXT_draw_buffers) + | 245 base::IntToString(compiler_options_.EXT_draw_buffers) + |
246 ":FragmentPrecisionHigh:" + | 246 ":FragmentPrecisionHigh:" + |
247 base::IntToString(compiler_options_.FragmentPrecisionHigh) + | 247 base::IntToString(compiler_options_.FragmentPrecisionHigh) + |
248 ":MaxExpressionComplexity:" + | 248 ":MaxExpressionComplexity:" + |
249 base::IntToString(compiler_options_.MaxExpressionComplexity) + | 249 base::IntToString(compiler_options_.MaxExpressionComplexity) + |
250 ":MaxCallStackDepth:" + | 250 ":MaxCallStackDepth:" + |
251 base::IntToString(compiler_options_.MaxCallStackDepth)); | 251 base::IntToString(compiler_options_.MaxCallStackDepth) + |
| 252 ":EXT_frag_depth:" + |
| 253 base::IntToString(compiler_options_.EXT_frag_depth)); |
252 } | 254 } |
253 | 255 |
254 const char* ShaderTranslator::translated_shader() const { | 256 const char* ShaderTranslator::translated_shader() const { |
255 return translated_shader_.get(); | 257 return translated_shader_.get(); |
256 } | 258 } |
257 | 259 |
258 const char* ShaderTranslator::info_log() const { | 260 const char* ShaderTranslator::info_log() const { |
259 return info_log_.get(); | 261 return info_log_.get(); |
260 } | 262 } |
261 | 263 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 translated_shader_.reset(); | 299 translated_shader_.reset(); |
298 info_log_.reset(); | 300 info_log_.reset(); |
299 attrib_map_.clear(); | 301 attrib_map_.clear(); |
300 uniform_map_.clear(); | 302 uniform_map_.clear(); |
301 name_map_.clear(); | 303 name_map_.clear(); |
302 } | 304 } |
303 | 305 |
304 } // namespace gles2 | 306 } // namespace gles2 |
305 } // namespace gpu | 307 } // namespace gpu |
306 | 308 |
OLD | NEW |