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

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

Issue 1420033005: Create swizzle table inside of glsl caps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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: src/gpu/glsl/GrGLSLCaps.h
diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h
index f93ef2766d18f376a0e65c1399ebf6151fbb4502..65f5f6cef24171411d5cd8e35fad39a614d2aaa4 100755
--- a/src/gpu/glsl/GrGLSLCaps.h
+++ b/src/gpu/glsl/GrGLSLCaps.h
@@ -82,6 +82,14 @@ public:
return fShaderDerivativeExtensionString;
}
+ bool mustSwizzleInShader() const { return fMustSwizzleInShader; }
+
+ /**
+ * Returns a string which represents how to map from an internal GLFormat to a given
+ * GrPixelConfig. A draw side swizzle will then use this mapping to correctly set components.
+ */
+ const char* getSwizzleMap(GrPixelConfig config) const { return fConfigSwizzle[config]; }
bsalomon 2015/11/03 14:45:51 Maybe change the last sentence to something like "
egdaniel 2015/11/03 15:23:56 Done.
+
GrGLSLGeneration generation() const { return fGLSLGeneration; }
/**
@@ -90,6 +98,8 @@ public:
SkString dump() const override;
private:
+ void onApplyOptionsOverrides(const GrContextOptions& options) override;
+
GrGLSLGeneration fGLSLGeneration;
bool fDropsTileOnZeroDivide : 1;
@@ -109,6 +119,9 @@ private:
AdvBlendEqInteraction fAdvBlendEqInteraction;
+ bool fMustSwizzleInShader;
+ const char* fConfigSwizzle[kGrPixelConfigCnt];
+
friend class GrGLCaps; // For initialization.
typedef GrShaderCaps INHERITED;

Powered by Google App Engine
This is Rietveld 408576698