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

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

Issue 903273002: Update from https://crrev.com/315085 (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
« no previous file with comments | « gpu/command_buffer/service/program_manager.cc ('k') | gpu/command_buffer/service/shader_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c726767f348fb5a3928f7ad84767ae025f96f85a..11f567d4f06dada6a3faa29e99ade20034e6fd2c 100644
--- a/gpu/command_buffer/service/shader_manager.h
+++ b/gpu/command_buffer/service/shader_manager.h
@@ -29,9 +29,21 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
kGL, // GL or GLES
};
+ enum ShaderState {
+ kShaderStateWaiting,
+ kShaderStateCompileRequested,
+ kShaderStateCompiled, // Signifies compile happened, not valid compile.
+ };
+
+ void RequestCompile();
+
void DoCompile(ShaderTranslatorInterface* translator,
TranslatedShaderSourceType type);
+ ShaderState shader_state() const {
+ return shader_state_;
+ }
+
GLuint service_id() const {
return service_id_;
}
@@ -52,8 +64,8 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
return translated_source_;
}
- const std::string& signature_source() const {
- return signature_source_;
+ const std::string& last_compiled_source() const {
+ return last_compiled_source_;
}
const sh::Attribute* GetAttribInfo(const std::string& name) const;
@@ -73,7 +85,7 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
}
bool valid() const {
- return valid_;
+ return shader_state_ == kShaderStateCompiled && valid_;
}
bool IsDeleted() const {
@@ -131,8 +143,12 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
int use_count_;
+ // The current state of the shader.
+ ShaderState shader_state_;
+
// The shader this Shader is tracking.
GLuint service_id_;
+
// Type of shader - GL_VERTEX_SHADER or GL_FRAGMENT_SHADER.
GLenum shader_type_;
@@ -143,7 +159,7 @@ class GPU_EXPORT Shader : public base::RefCounted<Shader> {
std::string source_;
// The source the last compile used.
- std::string signature_source_;
+ std::string last_compiled_source_;
// The translated shader source.
std::string translated_source_;
« no previous file with comments | « gpu/command_buffer/service/program_manager.cc ('k') | gpu/command_buffer/service/shader_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698