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 f719f7d99760a825b37ae1188e0e40d316c3021b..576c7c8df5b93b44785bfa5e03d67f1f2b11ca44 100644 |
--- a/gpu/command_buffer/service/shader_translator.cc |
+++ b/gpu/command_buffer/service/shader_translator.cc |
@@ -9,10 +9,12 @@ |
#include <algorithm> |
#include "base/at_exit.h" |
+#include "base/command_line.h" |
#include "base/debug/trace_event.h" |
#include "base/lazy_instance.h" |
#include "base/logging.h" |
#include "base/strings/string_number_conversions.h" |
+#include "ui/gl/gl_switches.h" |
namespace gpu { |
namespace gles2 { |
@@ -133,6 +135,10 @@ int ShaderTranslator::GetCompileOptions() const { |
SH_LIMIT_EXPRESSION_COMPLEXITY | SH_LIMIT_CALL_STACK_DEPTH | |
SH_CLAMP_INDIRECT_ARRAY_BOUNDS; |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kGLShaderIntermOutput)) |
+ compile_options |= SH_INTERMEDIATE_TREE; |
+ |
compile_options |= driver_bug_workarounds_; |
return compile_options; |