diff options
author | egdaniel <egdaniel@google.com> | 2015-11-03 10:33:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-03 10:33:14 -0800 |
commit | 0c2999974d189ea257f82c9b7672d9afda52f6c2 (patch) | |
tree | 96a31dd38b3252f3aadafde6d43dc2ab96167b73 /src/gpu/glsl | |
parent | 0575131e579641e76798e58a8bb6786f9eebd5f2 (diff) |
Revert of Create swizzle table inside of glsl caps (patchset #12 id:210001 of https://codereview.chromium.org/1420033005/ )
Reason for revert:
Breaking gm's on nexus7 and s3
Original issue's description:
> Create swizzle table inside of glsl caps
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4036674952f341dab0695c3b054fefa5bb8cdec1
TBR=bsalomon@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1426653008
Diffstat (limited to 'src/gpu/glsl')
-rwxr-xr-x | src/gpu/glsl/GrGLSLCaps.cpp | 11 | ||||
-rwxr-xr-x | src/gpu/glsl/GrGLSLCaps.h | 14 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLTextureSampler.h | 9 |
3 files changed, 5 insertions, 29 deletions
diff --git a/src/gpu/glsl/GrGLSLCaps.cpp b/src/gpu/glsl/GrGLSLCaps.cpp index 140cb11494..54d041e3a0 100755 --- a/src/gpu/glsl/GrGLSLCaps.cpp +++ b/src/gpu/glsl/GrGLSLCaps.cpp @@ -8,8 +8,6 @@ #include "GrGLSLCaps.h" -#include "GrContextOptions.h" - //////////////////////////////////////////////////////////////////////////////////////////// GrGLSLCaps::GrGLSLCaps(const GrContextOptions& options) { @@ -27,9 +25,6 @@ GrGLSLCaps::GrGLSLCaps(const GrContextOptions& options) { fFBFetchColorName = nullptr; fFBFetchExtensionString = nullptr; fAdvBlendEqInteraction = kNotSupported_AdvBlendEqInteraction; - - fMustSwizzleInShader = false; - memset(fConfigSwizzle, 0, sizeof(fConfigSwizzle)); } SkString GrGLSLCaps::dump() const { @@ -61,9 +56,3 @@ SkString GrGLSLCaps::dump() const { return r; } -void GrGLSLCaps::onApplyOptionsOverrides(const GrContextOptions& options) { - if (options.fUseShaderSwizzling) { - fMustSwizzleInShader = true; - } -} - diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h index e703fb8523..f93ef2766d 100755 --- a/src/gpu/glsl/GrGLSLCaps.h +++ b/src/gpu/glsl/GrGLSLCaps.h @@ -82,15 +82,6 @@ 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; } /** @@ -99,8 +90,6 @@ public: SkString dump() const override; private: - void onApplyOptionsOverrides(const GrContextOptions& options) override; - GrGLSLGeneration fGLSLGeneration; bool fDropsTileOnZeroDivide : 1; @@ -120,9 +109,6 @@ private: AdvBlendEqInteraction fAdvBlendEqInteraction; - bool fMustSwizzleInShader; - const char* fConfigSwizzle[kGrPixelConfigCnt]; - friend class GrGLCaps; // For initialization. typedef GrShaderCaps INHERITED; diff --git a/src/gpu/glsl/GrGLSLTextureSampler.h b/src/gpu/glsl/GrGLSLTextureSampler.h index 2de0431f58..2f14cd1013 100644 --- a/src/gpu/glsl/GrGLSLTextureSampler.h +++ b/src/gpu/glsl/GrGLSLTextureSampler.h @@ -19,18 +19,19 @@ public: GrGLSLTextureSampler(UniformHandle uniform, const GrTextureAccess& access) : fSamplerUniform(uniform) - , fConfig(access.getTexture()->config()) { - SkASSERT(kUnknown_GrPixelConfig != fConfig); + , fConfigComponentMask(GrPixelConfigComponentMask(access.getTexture()->config())) { + SkASSERT(0 != fConfigComponentMask); memcpy(fSwizzle, access.getSwizzle(), 5); } - GrPixelConfig config() const { return fConfig; } + // bitfield of GrColorComponentFlags present in the texture's config. + uint32_t configComponentMask() const { return fConfigComponentMask; } // this is .abcd const char* swizzle() const { return fSwizzle; } private: UniformHandle fSamplerUniform; - GrPixelConfig fConfig; + uint32_t fConfigComponentMask; char fSwizzle[5]; friend class GrGLShaderBuilder; |