Move GLSL-specific routines/classes to separate glsl directory
The purpose is to begin separating our GLSL-specific code from
our GL-specific code, so it can be used with the GL45 platform
Review URL: https://codereview.chromium.org/1202293002
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 3d33199..fd03da5 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -10,7 +10,7 @@
#define GrGLCaps_DEFINED
#include "GrCaps.h"
-#include "GrGLSL.h"
+#include "glsl/GrGLSL.h"
#include "GrGLStencilAttachment.h"
#include "SkChecksum.h"
#include "SkTHash.h"
@@ -328,6 +328,10 @@
bool doReadPixelsSupported(const GrGLInterface* intf, GrGLenum format, GrGLenum type) const;
+ void initShaderPrecisionTable(const GrGLContextInfo& ctxInfo,
+ const GrGLInterface* intf,
+ GrGLSLCaps* glslCaps);
+
// tracks configs that have been verified to pass the FBO completeness when
// used as a color attachment
VerifiedColorConfigs fVerifiedColorConfigs;
@@ -387,88 +391,4 @@
typedef GrCaps INHERITED;
};
-class GrGLSLCaps : public GrShaderCaps {
-public:
- SK_DECLARE_INST_COUNT(GrGLSLCaps)
-
- /**
- * Indicates how GLSL must interact with advanced blend equations. The KHR extension requires
- * special layout qualifiers in the fragment shader.
- */
- enum AdvBlendEqInteraction {
- kNotSupported_AdvBlendEqInteraction, //<! No _blend_equation_advanced extension
- kAutomatic_AdvBlendEqInteraction, //<! No interaction required
- kGeneralEnable_AdvBlendEqInteraction, //<! layout(blend_support_all_equations) out
- kSpecificEnables_AdvBlendEqInteraction, //<! Specific layout qualifiers per equation
-
- kLast_AdvBlendEqInteraction = kSpecificEnables_AdvBlendEqInteraction
- };
-
- /**
- * Initializes the GrGLSLCaps to the set of features supported in the current
- * OpenGL context accessible via ctxInfo.
- */
- GrGLSLCaps(const GrContextOptions&, const GrGLContextInfo&, const GrGLInterface*,
- const GrGLCaps&);
-
- /**
- * Some helper functions for encapsulating various extensions to read FB Buffer on openglES
- *
- * TODO(joshualitt) On desktop opengl 4.2+ we can achieve something similar to this effect
- */
- bool fbFetchSupport() const { return fFBFetchSupport; }
-
- bool fbFetchNeedsCustomOutput() const { return fFBFetchNeedsCustomOutput; }
-
- bool bindlessTextureSupport() const { return fBindlessTextureSupport; }
-
- const char* fbFetchColorName() const { return fFBFetchColorName; }
-
- const char* fbFetchExtensionString() const { return fFBFetchExtensionString; }
-
- bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; }
-
- AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInteraction; }
-
- bool mustEnableAdvBlendEqs() const {
- return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction;
- }
-
- bool mustEnableSpecificAdvBlendEqs() const {
- return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction;
- }
-
- bool mustDeclareFragmentShaderOutput() const {
- return fGLSLGeneration > k110_GrGLSLGeneration;
- }
-
- GrGLSLGeneration generation() const { return fGLSLGeneration; }
-
- /**
- * Returns a string containing the caps info.
- */
- SkString dump() const override;
-
-private:
- // Must be called after fGeometryShaderSupport is initialized.
- void initShaderPrecisionTable(const GrGLContextInfo&, const GrGLInterface*);
-
- GrGLSLGeneration fGLSLGeneration;
-
- bool fDropsTileOnZeroDivide : 1;
- bool fFBFetchSupport : 1;
- bool fFBFetchNeedsCustomOutput : 1;
- bool fBindlessTextureSupport : 1;
-
- const char* fFBFetchColorName;
- const char* fFBFetchExtensionString;
-
- AdvBlendEqInteraction fAdvBlendEqInteraction;
-
- friend class GrGLCaps; // For initialization.
-
- typedef GrShaderCaps INHERITED;
-};
-
-
#endif