/* * Copyright 2012 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef GrGLSLCaps_DEFINED #define GrGLSLCaps_DEFINED #include "GrCaps.h" #include "GrGLSL.h" class GrGLSLCaps : public GrShaderCaps { public: /** * Indicates how GLSL must interact with advanced blend equations. The KHR extension requires * special layout qualifiers in the fragment shader. */ enum AdvBlendEqInteraction { kNotSupported_AdvBlendEqInteraction, //= 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: 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