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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/mocks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 050010f2933319dedd454a64c2f5b8bedb554c32..c8d9f9f8cf3367db4f872a3b8b8cde9f2ff6682b 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2509,15 +2509,18 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
ShaderTranslatorInterface::GlslImplementationType implementation_type =
gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 ?
ShaderTranslatorInterface::kGlslES : ShaderTranslatorInterface::kGlsl;
- ShaderTranslatorInterface::GlslBuiltInFunctionBehavior function_behavior =
- workarounds().needs_glsl_built_in_function_emulation ?
- ShaderTranslatorInterface::kGlslBuiltInFunctionEmulated :
- ShaderTranslatorInterface::kGlslBuiltInFunctionOriginal;
+ int driver_bug_workarounds = 0;
+ if (workarounds().needs_glsl_built_in_function_emulation)
+ driver_bug_workarounds |= SH_EMULATE_BUILT_IN_FUNCTIONS;
+ // TODO(zmo): Uncomment the below two lines when ANGLE CL is rolled in.
+ // if (workarounds().init_gl_position_in_vertex_shader)
+ // driver_bug_workarounds |= SH_INIT_GL_POSITION;
ShaderTranslatorCache* cache = ShaderTranslatorCache::GetInstance();
vertex_translator_ = cache->GetTranslator(
SH_VERTEX_SHADER, shader_spec, &resources,
- implementation_type, function_behavior);
+ implementation_type,
+ static_cast<ShCompileOptions>(driver_bug_workarounds));
if (!vertex_translator_.get()) {
LOG(ERROR) << "Could not initialize vertex shader translator.";
Destroy(true);
@@ -2526,7 +2529,8 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
fragment_translator_ = cache->GetTranslator(
SH_FRAGMENT_SHADER, shader_spec, &resources,
- implementation_type, function_behavior);
+ implementation_type,
+ static_cast<ShCompileOptions>(driver_bug_workarounds));
if (!fragment_translator_.get()) {
LOG(ERROR) << "Could not initialize fragment shader translator.";
Destroy(true);
« no previous file with comments | « no previous file | gpu/command_buffer/service/mocks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698