aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl/GrGLSLCaps.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@google.com>2016-01-08 12:11:39 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-08 12:11:39 -0800
commit3183a4136364cfe18b3584302e71ea528a018401 (patch)
tree00dc9f7509516757e84de9c311a413743af1275f /src/gpu/glsl/GrGLSLCaps.h
parentdefa0daa6a0f4e97a3527a522ae602c6771a7c80 (diff)
Revert of Add a class representing texture swizzle. (patchset #6 id:100001 of https://codereview.chromium.org/1567733005/ )
Reason for revert: Shader compilation failures when implicitly converting vec4 to float. https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win8-MSVC-ShuttleA-GPU-GTX960-x86_64-Debug/builds/3266/steps/dm/logs/stdio https://uberchromegw.corp.google.com/i/client.skia.android/builders/Test-Android-GCC-Nexus6-GPU-Adreno420-Arm7-Debug/builds/3154/steps/dm/logs/stdio Original issue's description: > Add a class representing texture swizzle. > > Store config swizzle GrGLCaps and shader swizzles in GrGLSLCaps. > > Remove GrTextureAccess's swizzle and update users of it to swizzle in their shader code. > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1567733005 > > Committed: https://skia.googlesource.com/skia/+/1a1efeacf7cc94a8c2977114dfe230fed3efc105 TBR=egdaniel@google.com,bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1569393002
Diffstat (limited to 'src/gpu/glsl/GrGLSLCaps.h')
-rwxr-xr-xsrc/gpu/glsl/GrGLSLCaps.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h
index eba9602e5a..21c59e7b16 100755
--- a/src/gpu/glsl/GrGLSLCaps.h
+++ b/src/gpu/glsl/GrGLSLCaps.h
@@ -11,7 +11,6 @@
#include "GrCaps.h"
#include "GrGLSL.h"
-#include "GrSwizzle.h"
class GrGLSLCaps : public GrShaderCaps {
public:
@@ -105,14 +104,14 @@ public:
return fExternalTextureExtensionString;
}
+ bool mustSwizzleInShader() const { return fMustSwizzleInShader; }
+
/**
- * Given a texture's config, this determines what swizzle must be appended to accesses to the
- * texture in generated shader code. Swizzling may be implemented in texture parameters or a
- * sampler rather than in the shader. In this case the shader swizzle will always be "rgba".
+ * 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 GrSwizzle& configTextureSwizzle(GrPixelConfig config) const {
- return fConfigTextureSwizzle[config];
- }
+ const char* getSwizzleMap(GrPixelConfig config) const { return fConfigSwizzle[config]; }
GrGLSLGeneration generation() const { return fGLSLGeneration; }
@@ -149,11 +148,13 @@ private:
AdvBlendEqInteraction fAdvBlendEqInteraction;
- GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt];
+ bool fMustSwizzleInShader;
+ const char* fConfigSwizzle[kGrPixelConfigCnt];
friend class GrGLCaps; // For initialization.
typedef GrShaderCaps INHERITED;
};
+
#endif