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_; |