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

Unified Diff: src/gpu/glsl/GrGLSLVarying.h

Issue 1682703003: Add some backend flexibility for shader declarations in ProgramBuilding. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix dtor Created 4 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 | « src/gpu/glsl/GrGLSLProgramBuilder.h ('k') | src/gpu/glsl/GrGLSLVarying.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLVarying.h
diff --git a/src/gpu/glsl/GrGLSLVarying.h b/src/gpu/glsl/GrGLSLVarying.h
index 116ba09b99bd9d2b797a328494bd49b903d5ca81..22431978c859666d57d33dcc0619c51694420c0e 100644
--- a/src/gpu/glsl/GrGLSLVarying.h
+++ b/src/gpu/glsl/GrGLSLVarying.h
@@ -79,6 +79,8 @@ public:
, fFragOutputs(kVaryingsPerBlock)
, fProgramBuilder(program) {}
+ virtual ~GrGLSLVaryingHandler() {}
+
typedef GrTAllocator<GrGLSLShaderVar> VarArray;
typedef GrGLSLProgramDataManager::VaryingHandle VaryingHandle;
@@ -106,6 +108,10 @@ public:
void emitAttributes(const GrGeometryProcessor& gp);
+ // This should be called once all attributes and varyings have been added to the
+ // GrGLSLVaryingHanlder and before getting/adding any of the declarations to the shaders.
+ void finalize();
+
void getVertexDecls(SkString* inputDecls, SkString* outputDecls) const;
void getGeomDecls(SkString* inputDecls, SkString* outputDecls) const;
void getFragDecls(SkString* inputDecls, SkString* outputDecls) const;
@@ -127,6 +133,8 @@ private:
void addAttribute(const GrShaderVar& var);
+ virtual void onFinalize() = 0;
+
// helper function for get*Decls
void appendDecls(const VarArray& vars, SkString* out) const;
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.h ('k') | src/gpu/glsl/GrGLSLVarying.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698