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

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

Issue 295803002: Moves responsibility for shader resource string generation to ANGLE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporate changes from landed ANGLE patch Created 6 years, 7 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 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 {
« no previous file with comments | « gpu/command_buffer/service/shader_translator.h ('k') | gpu/command_buffer/service/shader_translator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698