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/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 2494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2505 resources.HashFunction = &CityHash64; | 2505 resources.HashFunction = &CityHash64; |
2506 #endif | 2506 #endif |
2507 else | 2507 else |
2508 resources.HashFunction = NULL; | 2508 resources.HashFunction = NULL; |
2509 ShaderTranslatorInterface::GlslImplementationType implementation_type = | 2509 ShaderTranslatorInterface::GlslImplementationType implementation_type = |
2510 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 ? | 2510 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 ? |
2511 ShaderTranslatorInterface::kGlslES : ShaderTranslatorInterface::kGlsl; | 2511 ShaderTranslatorInterface::kGlslES : ShaderTranslatorInterface::kGlsl; |
2512 int driver_bug_workarounds = 0; | 2512 int driver_bug_workarounds = 0; |
2513 if (workarounds().needs_glsl_built_in_function_emulation) | 2513 if (workarounds().needs_glsl_built_in_function_emulation) |
2514 driver_bug_workarounds |= SH_EMULATE_BUILT_IN_FUNCTIONS; | 2514 driver_bug_workarounds |= SH_EMULATE_BUILT_IN_FUNCTIONS; |
2515 // TODO(zmo): Uncomment the below two lines when ANGLE CL is rolled in. | 2515 if (workarounds().init_gl_position_in_vertex_shader) |
2516 // if (workarounds().init_gl_position_in_vertex_shader) | 2516 driver_bug_workarounds |= SH_INIT_GL_POSITION; |
2517 // driver_bug_workarounds |= SH_INIT_GL_POSITION; | |
2518 | 2517 |
2519 ShaderTranslatorCache* cache = ShaderTranslatorCache::GetInstance(); | 2518 ShaderTranslatorCache* cache = ShaderTranslatorCache::GetInstance(); |
2520 vertex_translator_ = cache->GetTranslator( | 2519 vertex_translator_ = cache->GetTranslator( |
2521 SH_VERTEX_SHADER, shader_spec, &resources, | 2520 SH_VERTEX_SHADER, shader_spec, &resources, |
2522 implementation_type, | 2521 implementation_type, |
2523 static_cast<ShCompileOptions>(driver_bug_workarounds)); | 2522 static_cast<ShCompileOptions>(driver_bug_workarounds)); |
2524 if (!vertex_translator_.get()) { | 2523 if (!vertex_translator_.get()) { |
2525 LOG(ERROR) << "Could not initialize vertex shader translator."; | 2524 LOG(ERROR) << "Could not initialize vertex shader translator."; |
2526 Destroy(true); | 2525 Destroy(true); |
2527 return false; | 2526 return false; |
(...skipping 7740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10268 return error::kNoError; | 10267 return error::kNoError; |
10269 } | 10268 } |
10270 | 10269 |
10271 // Include the auto-generated part of this file. We split this because it means | 10270 // Include the auto-generated part of this file. We split this because it means |
10272 // we can easily edit the non-auto generated parts right here in this file | 10271 // we can easily edit the non-auto generated parts right here in this file |
10273 // instead of having to edit some template or the code generator. | 10272 // instead of having to edit some template or the code generator. |
10274 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10273 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10275 | 10274 |
10276 } // namespace gles2 | 10275 } // namespace gles2 |
10277 } // namespace gpu | 10276 } // namespace gpu |
OLD | NEW |