Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: gpu/command_buffer/service/shader_translator_cache.cc

Issue 23441050: Add driver bug workaround for SH_INIT_GL_POSITION. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_cache.h" 5 #include "gpu/command_buffer/service/shader_translator_cache.h"
6 6
7 namespace gpu { 7 namespace gpu {
8 namespace gles2 { 8 namespace gles2 {
9 9
10 ShaderTranslatorCache* ShaderTranslatorCache::GetInstance() { 10 ShaderTranslatorCache* ShaderTranslatorCache::GetInstance() {
(...skipping 16 matching lines...) Expand all
27 it++; 27 it++;
28 } 28 }
29 } 29 }
30 30
31 scoped_refptr<ShaderTranslator> ShaderTranslatorCache::GetTranslator( 31 scoped_refptr<ShaderTranslator> ShaderTranslatorCache::GetTranslator(
32 ShShaderType shader_type, 32 ShShaderType shader_type,
33 ShShaderSpec shader_spec, 33 ShShaderSpec shader_spec,
34 const ShBuiltInResources* resources, 34 const ShBuiltInResources* resources,
35 ShaderTranslatorInterface::GlslImplementationType 35 ShaderTranslatorInterface::GlslImplementationType
36 glsl_implementation_type, 36 glsl_implementation_type,
37 ShaderTranslatorInterface::GlslBuiltInFunctionBehavior 37 ShCompileOptions driver_bug_workarounds) {
38 glsl_built_in_function_behavior) {
39 ShaderTranslatorInitParams params(shader_type, 38 ShaderTranslatorInitParams params(shader_type,
40 shader_spec, 39 shader_spec,
41 *resources, 40 *resources,
42 glsl_implementation_type, 41 glsl_implementation_type,
43 glsl_built_in_function_behavior); 42 driver_bug_workarounds);
44 43
45 Cache::iterator it = cache_.find(params); 44 Cache::iterator it = cache_.find(params);
46 if (it != cache_.end()) 45 if (it != cache_.end())
47 return it->second; 46 return it->second;
48 47
49 ShaderTranslator* translator = new ShaderTranslator(); 48 ShaderTranslator* translator = new ShaderTranslator();
50 if (translator->Init(shader_type, shader_spec, resources, 49 if (translator->Init(shader_type, shader_spec, resources,
51 glsl_implementation_type, 50 glsl_implementation_type,
52 glsl_built_in_function_behavior)) { 51 driver_bug_workarounds)) {
53 cache_[params] = translator; 52 cache_[params] = translator;
54 translator->AddDestructionObserver(this); 53 translator->AddDestructionObserver(this);
55 return translator; 54 return translator;
56 } else { 55 } else {
57 return NULL; 56 return NULL;
58 } 57 }
59 } 58 }
60 59
61 } // namespace gles2 60 } // namespace gles2
62 } // namespace gpu 61 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/shader_translator_cache.h ('k') | gpu/command_buffer/service/shader_translator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698