aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl/GrGLSLCaps.h
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-11-03 08:15:28 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-03 08:15:29 -0800
commit4036674952f341dab0695c3b054fefa5bb8cdec1 (patch)
tree73629dadb61dff6ce5c730ce71e883b919a73027 /src/gpu/glsl/GrGLSLCaps.h
parent501b7344f116ccc821d437d324aa7883d7ce97bf (diff)
Create swizzle table inside of glsl caps
Diffstat (limited to 'src/gpu/glsl/GrGLSLCaps.h')
-rwxr-xr-xsrc/gpu/glsl/GrGLSLCaps.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h
index f93ef2766d..e703fb8523 100755
--- a/src/gpu/glsl/GrGLSLCaps.h
+++ b/src/gpu/glsl/GrGLSLCaps.h
@@ -82,6 +82,15 @@ public:
return fShaderDerivativeExtensionString;
}
+ bool mustSwizzleInShader() const { return fMustSwizzleInShader; }
+
+ /**
+ * Returns a string which represents how to map from an internal GLFormat to a given
+ * GrPixelConfig. The function mustSwizzleInShader determines whether this swizzle is applied
+ * in the generated shader code or using sample state in the 3D API.
+ */
+ const char* getSwizzleMap(GrPixelConfig config) const { return fConfigSwizzle[config]; }
+
GrGLSLGeneration generation() const { return fGLSLGeneration; }
/**
@@ -90,6 +99,8 @@ public:
SkString dump() const override;
private:
+ void onApplyOptionsOverrides(const GrContextOptions& options) override;
+
GrGLSLGeneration fGLSLGeneration;
bool fDropsTileOnZeroDivide : 1;
@@ -109,6 +120,9 @@ private:
AdvBlendEqInteraction fAdvBlendEqInteraction;
+ bool fMustSwizzleInShader;
+ const char* fConfigSwizzle[kGrPixelConfigCnt];
+
friend class GrGLCaps; // For initialization.
typedef GrShaderCaps INHERITED;