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 c3279e25ec6c501fb9830f08e76b8093a1103a04..b9399ac120e625b51a51ce35007941baf1fb4bcf 100644 |
--- a/gpu/command_buffer/service/shader_translator.cc |
+++ b/gpu/command_buffer/service/shader_translator.cc |
@@ -201,9 +201,22 @@ bool ShaderTranslator::Translate(const char* shader) { |
return success; |
} |
-std::string ShaderTranslator::GetStringForOptionsThatWouldEffectCompilation() |
+std::string ShaderTranslator::GetStringForOptionsThatWouldAffectCompilation() |
const { |
+#if ANGLE_SH_VERSION >= 124 |
+ DCHECK(compiler_ != NULL); |
Zhenyao Mo
2014/05/20 21:48:55
I think returning "None" instead of DCHECK is safe
Ken Russell (switch to Gerrit)
2014/05/20 21:58:00
Not sure. If we really expect the compiler to be n
Zhenyao Mo
2014/05/20 22:22:01
If we prefer DCHECK, then below we should also DCH
Shannon Woods
2014/05/20 22:24:29
From what I can see, all paths to this function le
|
+ |
+ ANGLEGetInfoType resource_len = 0; |
+ ShGetInfo(compiler_, SH_RESOURCES_STRING_LENGTH, &resource_len); |
+ if (resource_len <= 1) return std::string("None"); |
+ scoped_ptr<char[]> resource_str(new char[resource_len]); |
Zhenyao Mo
2014/05/20 21:48:55
this should be scoped_array<char> instead.
Zhenyao Mo
2014/05/20 23:15:24
Oops, http://src.chromium.org/viewvc/chrome?view=r
|
+ |
+ ShGetBuiltInResourcesString(compiler_, resource_len, resource_str.get()); |
+ return std::string(":CompileOptions:" + |
+ base::IntToString(GetCompileOptions())) + |
+ std::string(resource_str.get()); |
+#else |
Zhenyao Mo
2014/05/20 21:48:55
this can be #elif, so you don't need the extra #en
Zhenyao Mo
2014/05/20 21:50:55
Never mind this. I need a pair of glasses apparen
|
#if ANGLE_SH_VERSION >= 123 |
const size_t kNumIntFields = 21; |
#elif ANGLE_SH_VERSION >= 122 |
@@ -278,6 +291,7 @@ std::string ShaderTranslator::GetStringForOptionsThatWouldEffectCompilation() |
#else // ANGLE_SH_VERSION < 122 |
base::IntToString(compiler_options_.EXT_frag_depth)); |
#endif |
+#endif |
} |
const char* ShaderTranslator::translated_shader() const { |