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

Unified Diff: gpu/command_buffer/service/shader_translator.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: 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
Index: gpu/command_buffer/service/shader_translator.cc
diff --git a/gpu/command_buffer/service/shader_translator.cc b/gpu/command_buffer/service/shader_translator.cc
index 04e12276afb372a6707355e912ab5ae04a24ae3a..ecd2358bf77d66ef5ab69b674a39a088cd5a4c0d 100644
--- a/gpu/command_buffer/service/shader_translator.cc
+++ b/gpu/command_buffer/service/shader_translator.cc
@@ -98,16 +98,14 @@ ShaderTranslator::DestructionObserver::~DestructionObserver() {
ShaderTranslator::ShaderTranslator()
: compiler_(NULL),
- implementation_is_glsl_es_(false),
driver_bug_workarounds_(static_cast<ShCompileOptions>(0)) {
}
-bool ShaderTranslator::Init(
- GLenum shader_type,
- ShShaderSpec shader_spec,
- const ShBuiltInResources* resources,
- ShaderTranslatorInterface::GlslImplementationType glsl_implementation_type,
- ShCompileOptions driver_bug_workarounds) {
+bool ShaderTranslator::Init(GLenum shader_type,
+ ShShaderSpec shader_spec,
+ const ShBuiltInResources* resources,
+ ShShaderOutput shader_output_language,
+ ShCompileOptions driver_bug_workarounds) {
// Make sure Init is called only once.
DCHECK(compiler_ == NULL);
DCHECK(shader_type == GL_FRAGMENT_SHADER || shader_type == GL_VERTEX_SHADER);
@@ -117,27 +115,12 @@ bool ShaderTranslator::Init(
g_translator_initializer.Get();
- ShShaderOutput shader_output;
- if (glsl_implementation_type == kGlslES) {
- shader_output = SH_ESSL_OUTPUT;
- } else {
- // TODO(kbr): clean up the tests of shader_spec and
- // gfx::GetGLImplementation(). crbug.com/471960
- if (shader_spec == SH_WEBGL2_SPEC ||
- gfx::GetGLImplementation() ==
- gfx::kGLImplementationDesktopGLCoreProfile) {
- shader_output = SH_GLSL_410_CORE_OUTPUT;
- } else {
- shader_output = SH_GLSL_COMPATIBILITY_OUTPUT;
- }
- }
{
TRACE_EVENT0("gpu", "ShConstructCompiler");
- compiler_ = ShConstructCompiler(
- shader_type, shader_spec, shader_output, resources);
+ compiler_ = ShConstructCompiler(shader_type, shader_spec,
+ shader_output_language, resources);
}
- implementation_is_glsl_es_ = (glsl_implementation_type == kGlslES);
driver_bug_workarounds_ = driver_bug_workarounds;
return compiler_ != NULL;
}

Powered by Google App Engine
This is Rietveld 408576698