Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GrShaderCaps Class Reference
Inheritance diagram for GrShaderCaps:
SkRefCnt SkRefCntBase

Classes

struct  PrecisionInfo
 Info about shader variable precision within a given shader stage. More...
 

Public Types

enum  AdvBlendEqInteraction {
  kNotSupported_AdvBlendEqInteraction, kAutomatic_AdvBlendEqInteraction, kGeneralEnable_AdvBlendEqInteraction, kSpecificEnables_AdvBlendEqInteraction,
  kLast_AdvBlendEqInteraction = kSpecificEnables_AdvBlendEqInteraction
}
 Indicates how GLSL must interact with advanced blend equations. More...
 

Public Member Functions

 GrShaderCaps (const GrContextOptions &)
 
SkString dump () const
 
bool shaderDerivativeSupport () const
 
bool geometryShaderSupport () const
 
bool pathRenderingSupport () const
 
bool dstReadInShaderSupport () const
 
bool dualSourceBlendingSupport () const
 
bool integerSupport () const
 
bool texelBufferSupport () const
 
int imageLoadStoreSupport () const
 
const PrecisionInfogetFloatShaderPrecisionInfo (GrShaderType shaderType, GrSLPrecision precision) const
 Get the precision info for a variable of type kFloat_GrSLType, kVec2f_GrSLType, etc in a given shader type. More...
 
bool floatPrecisionVaries () const
 Is there any difference between the float shader variable precision types? If this is true then unless the shader type is not supported, any call to getFloatShaderPrecisionInfo() would report the same info for all precisions in all shader types.
 
bool fbFetchSupport () const
 Some helper functions for encapsulating various extensions to read FB Buffer on openglES. More...
 
bool fbFetchNeedsCustomOutput () const
 
bool bindlessTextureSupport () const
 
const char * versionDeclString () const
 
const char * fbFetchColorName () const
 
const char * fbFetchExtensionString () const
 
bool dropsTileOnZeroDivide () const
 
bool flatInterpolationSupport () const
 
bool noperspectiveInterpolationSupport () const
 
bool multisampleInterpolationSupport () const
 
bool sampleVariablesSupport () const
 
bool sampleMaskOverrideCoverageSupport () const
 
bool externalTextureSupport () const
 
bool texelFetchSupport () const
 
bool vertexIDSupport () const
 
AdvBlendEqInteraction advBlendEqInteraction () const
 
bool mustEnableAdvBlendEqs () const
 
bool mustEnableSpecificAdvBlendEqs () const
 
bool mustDeclareFragmentShaderOutput () const
 
bool usesPrecisionModifiers () const
 
bool canUseAnyFunctionInShader () const
 
bool canUseMinAndAbsTogether () const
 
bool mustForceNegatedAtanParamToFloat () const
 
bool atan2ImplementedAsAtanYOverX () const
 
bool requiresLocalOutputColorForFBFetch () const
 
bool mustImplementGSInvocationsWithLoop () const
 
bool mustObfuscateUniformColor () const
 
const char * shaderDerivativeExtensionString () const
 
const char * fragCoordConventionsExtensionString () const
 
const char * secondaryOutputExtensionString () const
 
const char * externalTextureExtensionString () const
 
const char * texelBufferExtensionString () const
 
const char * noperspectiveInterpolationExtensionString () const
 
const char * multisampleInterpolationExtensionString () const
 
const char * sampleVariablesExtensionString () const
 
const char * imageLoadStoreExtensionString () const
 
int maxVertexSamplers () const
 
int maxGeometrySamplers () const
 
int maxFragmentSamplers () const
 
int maxCombinedSamplers () const
 
int maxVertexImageStorages () const
 
int maxGeometryImageStorages () const
 
int maxFragmentImageStorages () const
 
int maxCombinedImageStorages () const
 
const GrSwizzle & configTextureSwizzle (GrPixelConfig config) const
 Given a texture's config, this determines what swizzle must be appended to accesses to the texture in generated shader code. More...
 
const GrSwizzle & configOutputSwizzle (GrPixelConfig config) const
 Swizzle that should occur on the fragment shader outputs for a given config. More...
 
GrSLPrecision samplerPrecision (GrPixelConfig config, GrShaderFlags visibility) const
 Precision qualifier that should be used with a sampler, given its config and visibility. More...
 
GrGLSLGeneration generation () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 Default construct, initializing the reference count to 1.
 
virtual ~SkRefCntBase ()
 Destruct, asserting that the reference count is 1.
 
int32_t getRefCnt () const
 Return the reference count. More...
 
void validate () const
 
bool unique () const
 May return true if the caller is the only owner. More...
 
void ref () const
 Increment the reference count. More...
 
void unref () const
 Decrement the reference count. More...
 

Private Member Functions

void initSamplerPrecisionTable ()
 GrCaps subclasses must call this after filling in the shader precision table. More...
 
void applyOptionsOverrides (const GrContextOptions &options)
 

Private Attributes

GrGLSLGeneration fGLSLGeneration
 
bool fShaderDerivativeSupport: 1
 
bool fGeometryShaderSupport: 1
 
bool fPathRenderingSupport: 1
 
bool fDstReadInShaderSupport: 1
 
bool fDualSourceBlendingSupport: 1
 
bool fIntegerSupport: 1
 
bool fTexelBufferSupport: 1
 
bool fImageLoadStoreSupport: 1
 
bool fShaderPrecisionVaries: 1
 
bool fDropsTileOnZeroDivide: 1
 
bool fFBFetchSupport: 1
 
bool fFBFetchNeedsCustomOutput: 1
 
bool fBindlessTextureSupport: 1
 
bool fUsesPrecisionModifiers: 1
 
bool fCanUseAnyFunctionInShader: 1
 
bool fFlatInterpolationSupport: 1
 
bool fNoPerspectiveInterpolationSupport: 1
 
bool fMultisampleInterpolationSupport: 1
 
bool fSampleVariablesSupport: 1
 
bool fSampleMaskOverrideCoverageSupport: 1
 
bool fExternalTextureSupport: 1
 
bool fTexelFetchSupport: 1
 
bool fVertexIDSupport: 1
 
bool fCanUseMinAndAbsTogether: 1
 
bool fMustForceNegatedAtanParamToFloat: 1
 
bool fAtan2ImplementedAsAtanYOverX: 1
 
bool fRequiresLocalOutputColorForFBFetch: 1
 
bool fMustImplementGSInvocationsWithLoop: 1
 
bool fMustObfuscateUniformColor: 1
 
PrecisionInfo fFloatPrecisions [kGrShaderTypeCount][kGrSLPrecisionCount]
 
const char * fVersionDeclString
 
const char * fShaderDerivativeExtensionString
 
const char * fFragCoordConventionsExtensionString
 
const char * fSecondaryOutputExtensionString
 
const char * fExternalTextureExtensionString
 
const char * fTexelBufferExtensionString
 
const char * fNoPerspectiveInterpolationExtensionString
 
const char * fMultisampleInterpolationExtensionString
 
const char * fSampleVariablesExtensionString
 
const char * fImageLoadStoreExtensionString
 
const char * fFBFetchColorName
 
const char * fFBFetchExtensionString
 
int fMaxVertexSamplers
 
int fMaxGeometrySamplers
 
int fMaxFragmentSamplers
 
int fMaxCombinedSamplers
 
int fMaxVertexImageStorages
 
int fMaxGeometryImageStorages
 
int fMaxFragmentImageStorages
 
int fMaxCombinedImageStorages
 
AdvBlendEqInteraction fAdvBlendEqInteraction
 
GrSwizzle fConfigTextureSwizzle [kGrPixelConfigCnt]
 
GrSwizzle fConfigOutputSwizzle [kGrPixelConfigCnt]
 
uint8_t fSamplerPrecisions [(1<< kGrShaderTypeCount)][kGrPixelConfigCnt]
 

Friends

class GrGLCaps
 
class GrVkCaps
 
class SkSL::ShaderCapsFactory
 

Additional Inherited Members

- Protected Member Functions inherited from SkRefCntBase
void internal_dispose_restore_refcnt_to_1 () const
 Allow subclasses to call this if they've overridden internal_dispose so they can reset fRefCnt before the destructor is called or if they choose not to call the destructor (e.g. More...
 

Member Enumeration Documentation

Indicates how GLSL must interact with advanced blend equations.

The KHR extension requires special layout qualifiers in the fragment shader.

Member Function Documentation

const GrSwizzle& GrShaderCaps::configOutputSwizzle ( GrPixelConfig  config) const
inline

Swizzle that should occur on the fragment shader outputs for a given config.

const GrSwizzle& GrShaderCaps::configTextureSwizzle ( GrPixelConfig  config) const
inline

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 returned swizzle will always be "rgba".

bool GrShaderCaps::fbFetchSupport ( ) const
inline

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

const PrecisionInfo& GrShaderCaps::getFloatShaderPrecisionInfo ( GrShaderType  shaderType,
GrSLPrecision  precision 
) const
inline

Get the precision info for a variable of type kFloat_GrSLType, kVec2f_GrSLType, etc in a given shader type.

If the shader type is not supported or the precision level is not supported in that shader type then the returned struct will report false when supported() is called.

void GrShaderCaps::initSamplerPrecisionTable ( )
private

GrCaps subclasses must call this after filling in the shader precision table.

GrSLPrecision GrShaderCaps::samplerPrecision ( GrPixelConfig  config,
GrShaderFlags  visibility 
) const
inline

Precision qualifier that should be used with a sampler, given its config and visibility.


The documentation for this class was generated from the following file: