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

Unified Diff: gpu/command_buffer/service/shader_translator.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
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 e6378b8067598560afae95d15a7e5a1e00fc04d2..37e2dc64d33c4c5d94ba7974b6393c82b06b1688 100644
--- a/gpu/command_buffer/service/shader_translator.cc
+++ b/gpu/command_buffer/service/shader_translator.cc
@@ -118,7 +118,7 @@ ShaderTranslator::DestructionObserver::~DestructionObserver() {
ShaderTranslator::ShaderTranslator()
: compiler_(NULL),
implementation_is_glsl_es_(false),
- needs_built_in_function_emulation_(false) {
+ driver_bug_workarounds_(static_cast<ShCompileOptions>(0)) {
}
bool ShaderTranslator::Init(
@@ -126,8 +126,7 @@ bool ShaderTranslator::Init(
ShShaderSpec shader_spec,
const ShBuiltInResources* resources,
ShaderTranslatorInterface::GlslImplementationType glsl_implementation_type,
- ShaderTranslatorInterface::GlslBuiltInFunctionBehavior
- glsl_built_in_function_behavior) {
+ ShCompileOptions driver_bug_workarounds) {
// Make sure Init is called only once.
DCHECK(compiler_ == NULL);
DCHECK(shader_type == SH_FRAGMENT_SHADER || shader_type == SH_VERTEX_SHADER);
@@ -147,8 +146,7 @@ bool ShaderTranslator::Init(
}
compiler_options_ = *resources;
implementation_is_glsl_es_ = (glsl_implementation_type == kGlslES);
- needs_built_in_function_emulation_ =
- (glsl_built_in_function_behavior == kGlslBuiltInFunctionEmulated);
+ driver_bug_workarounds_ = driver_bug_workarounds;
return compiler_ != NULL;
}
@@ -160,8 +158,7 @@ int ShaderTranslator::GetCompileOptions() const {
compile_options |= SH_CLAMP_INDIRECT_ARRAY_BOUNDS;
- if (needs_built_in_function_emulation_)
- compile_options |= SH_EMULATE_BUILT_IN_FUNCTIONS;
+ compile_options |= driver_bug_workarounds_;
return compile_options;
}
« 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