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

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

Issue 1716813002: Use GpuPreferences to avoid directly accessing switches in gpu related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 10 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 291b5d4ee1a63d125e9a641d0e616f09dc3f597f..6536db4d6c6ef98abf1705f6ce85f18ffe9fd6e6 100644
--- a/gpu/command_buffer/service/shader_translator.cc
+++ b/gpu/command_buffer/service/shader_translator.cc
@@ -15,7 +15,6 @@
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/trace_event/trace_event.h"
-#include "gpu/command_buffer/service/gpu_switches.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_version_info.h"
@@ -162,14 +161,16 @@ ShaderTranslator::DestructionObserver::~DestructionObserver() {
ShaderTranslator::ShaderTranslator()
: compiler_(NULL),
- driver_bug_workarounds_(static_cast<ShCompileOptions>(0)) {
+ driver_bug_workarounds_(static_cast<ShCompileOptions>(0)),
+ gl_shader_interm_output_(false) {
}
bool ShaderTranslator::Init(GLenum shader_type,
ShShaderSpec shader_spec,
const ShBuiltInResources* resources,
ShShaderOutput shader_output_language,
- ShCompileOptions driver_bug_workarounds) {
+ ShCompileOptions driver_bug_workarounds,
+ bool gl_shader_interm_output) {
// Make sure Init is called only once.
DCHECK(compiler_ == NULL);
DCHECK(shader_type == GL_FRAGMENT_SHADER || shader_type == GL_VERTEX_SHADER);
@@ -186,6 +187,7 @@ bool ShaderTranslator::Init(GLenum shader_type,
shader_output_language, resources);
}
driver_bug_workarounds_ = driver_bug_workarounds;
+ gl_shader_interm_output_ = gl_shader_interm_output;
return compiler_ != NULL;
}
@@ -195,8 +197,7 @@ int ShaderTranslator::GetCompileOptions() const {
SH_LIMIT_EXPRESSION_COMPLEXITY | SH_LIMIT_CALL_STACK_DEPTH |
SH_CLAMP_INDIRECT_ARRAY_BOUNDS;
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kGLShaderIntermOutput))
+ if (gl_shader_interm_output_)
compile_options |= SH_INTERMEDIATE_TREE;
compile_options |= driver_bug_workarounds_;
« no previous file with comments | « gpu/command_buffer/service/shader_translator.h ('k') | gpu/command_buffer/service/shader_translator_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698