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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1273693002: command_buffer: Use GLSL core version that matches the OpenGL version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android compile problem and rebase Created 5 years, 4 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 6e8c92cee9050b963c8cd3deaf8e8ee6fec6e88e..db91adffc8aeb47aa9fc43e733c8386914bd8bfa 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3273,9 +3273,7 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
resources.HashFunction = &CityHash64;
else
resources.HashFunction = NULL;
- ShaderTranslatorInterface::GlslImplementationType implementation_type =
- gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 ?
- ShaderTranslatorInterface::kGlslES : ShaderTranslatorInterface::kGlsl;
+
int driver_bug_workarounds = 0;
if (workarounds().needs_glsl_built_in_function_emulation)
driver_bug_workarounds |= SH_EMULATE_BUILT_IN_FUNCTIONS;
@@ -3299,11 +3297,12 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
switches::kEmulateShaderPrecision))
resources.WEBGL_debug_shader_precision = true;
+ ShShaderOutput shader_output_language =
+ ShaderTranslator::GetShaderOutputLanguageForContext(
+ feature_info_->gl_version_info());
+
vertex_translator_ = shader_translator_cache()->GetTranslator(
- GL_VERTEX_SHADER,
- shader_spec,
- &resources,
- implementation_type,
+ GL_VERTEX_SHADER, shader_spec, &resources, shader_output_language,
static_cast<ShCompileOptions>(driver_bug_workarounds));
if (!vertex_translator_.get()) {
LOG(ERROR) << "Could not initialize vertex shader translator.";
@@ -3312,10 +3311,7 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
}
fragment_translator_ = shader_translator_cache()->GetTranslator(
- GL_FRAGMENT_SHADER,
- shader_spec,
- &resources,
- implementation_type,
+ GL_FRAGMENT_SHADER, shader_spec, &resources, shader_output_language,
static_cast<ShCompileOptions>(driver_bug_workarounds));
if (!fragment_translator_.get()) {
LOG(ERROR) << "Could not initialize fragment shader translator.";
« 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