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

Unified Diff: src/gpu/gl/builders/GrGLShaderBuilder.h

Issue 1114813002: Add layout qualifiers to GrGLShaderBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_zzz2_texbar
Patch Set: rebase Created 5 years, 8 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/gl/builders/GrGLFragmentShaderBuilder.cpp ('k') | src/gpu/gl/builders/GrGLShaderBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLShaderBuilder.h
diff --git a/src/gpu/gl/builders/GrGLShaderBuilder.h b/src/gpu/gl/builders/GrGLShaderBuilder.h
index 3b06c05a00b32f6bb7471fef28cc64fcd5752246..0416dbeab6d91d0685b4d28f121b3133388093cf 100644
--- a/src/gpu/gl/builders/GrGLShaderBuilder.h
+++ b/src/gpu/gl/builders/GrGLShaderBuilder.h
@@ -139,6 +139,22 @@ protected:
*/
void addFeature(uint32_t featureBit, const char* extensionName);
+ enum InterfaceQualifier {
+ kOut_InterfaceQualifier,
+ kLastInterfaceQualifier = kOut_InterfaceQualifier
+ };
+
+ /*
+ * A low level function to build default layout qualifiers.
+ *
+ * e.g. layout(param1, param2, ...) out;
+ *
+ * GLSL allows default layout qualifiers for in, out, and uniform.
+ */
+ void addLayoutQualifier(const char* param, InterfaceQualifier);
+
+ void compileAndAppendLayoutQualifiers();
+
void nextStage() {
fShaderStrings.push_back();
fCompilerStrings.push_back(this->code().c_str());
@@ -149,6 +165,7 @@ protected:
SkString& versionDecl() { return fShaderStrings[kVersionDecl]; }
SkString& extensions() { return fShaderStrings[kExtensions]; }
SkString& precisionQualifier() { return fShaderStrings[kPrecisionQualifier]; }
+ SkString& layoutQualifiers() { return fShaderStrings[kLayoutQualifiers]; }
SkString& uniforms() { return fShaderStrings[kUniforms]; }
SkString& inputs() { return fShaderStrings[kInputs]; }
SkString& outputs() { return fShaderStrings[kOutputs]; }
@@ -161,6 +178,7 @@ protected:
kVersionDecl,
kExtensions,
kPrecisionQualifier,
+ kLayoutQualifiers,
kUniforms,
kInputs,
kOutputs,
@@ -180,6 +198,7 @@ protected:
VarArray fInputs;
VarArray fOutputs;
uint32_t fFeaturesAddedMask;
+ SkSTArray<1, SkString> fLayoutParams[kLastInterfaceQualifier + 1];
int fCodeIndex;
bool fFinalized;
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp ('k') | src/gpu/gl/builders/GrGLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698