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

Unified Diff: gpu/command_buffer/service/shader_manager.h

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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_manager.h
diff --git a/gpu/command_buffer/service/shader_manager.h b/gpu/command_buffer/service/shader_manager.h
index 11f567d4f06dada6a3faa29e99ade20034e6fd2c..82fd2887b8f1e1e470a689fa790611f7589379df 100644
--- a/gpu/command_buffer/service/shader_manager.h
+++ b/gpu/command_buffer/service/shader_manager.h
@@ -35,10 +35,10 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
kShaderStateCompiled, // Signifies compile happened, not valid compile.
};
- void RequestCompile();
+ void RequestCompile(scoped_refptr<ShaderTranslatorInterface> translator,
+ TranslatedShaderSourceType type);
- void DoCompile(ShaderTranslatorInterface* translator,
- TranslatedShaderSourceType type);
+ void DoCompile();
ShaderState shader_state() const {
return shader_state_;
@@ -64,7 +64,15 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
return translated_source_;
}
- const std::string& last_compiled_source() const {
+ std::string last_compiled_source() const {
+ return last_compiled_source_;
+ }
+
+ std::string last_compiled_signature() const {
+ if (translator_.get()) {
+ return last_compiled_source_ +
+ translator_->GetStringForOptionsThatWouldAffectCompilation();
+ }
return last_compiled_source_;
}
@@ -152,6 +160,12 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
// Type of shader - GL_VERTEX_SHADER or GL_FRAGMENT_SHADER.
GLenum shader_type_;
+ // Translated source type when shader was last requested to be compiled.
+ TranslatedShaderSourceType source_type_;
+
+ // Translator to use, set when shader was last requested to be compiled.
+ scoped_refptr<ShaderTranslatorInterface> translator_;
+
// True if compilation succeeded.
bool valid_;
« no previous file with comments | « gpu/command_buffer/service/program_manager_unittest.cc ('k') | gpu/command_buffer/service/shader_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698