Flutter Engine
The Flutter Engine
GrShaderCaps.h
Go to the documentation of this file.
1/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrShaderCaps_DEFINED
9#define GrShaderCaps_DEFINED
10
12#include "src/sksl/SkSLUtil.h"
13
14struct GrContextOptions;
15class SkJSONWriter;
16
19
20 void dumpJSON(SkJSONWriter*) const;
21
25 }
26
27 const char* sampleVariablesExtensionString() const {
30 }
31
33
36 bool fVertexIDSupport = false;
37 // Returns true if `expr` in `myArray[expr]` can be any integer expression. If false, `expr`
38 // must be a constant-index-expression as defined in the OpenGL ES2 specification, Appendix A.5.
40 // frexp(), ldexp(), findMSB(), findLSB().
42 bool fHalfIs32Bits = false;
44 // Use a reduced set of rendering algorithms or less optimal effects in order to reduce the
45 // number of unique shaders generated.
46 bool fReducedShaderMode = false;
47
48 // Used for specific driver bug workarounds
50 // Workaround for Mali GPU opacity bug with uniform colors.
52 // On Nexus 6, the GL context can get lost if a shader does not write a value to gl_FragColor.
53 // https://bugs.chromium.org/p/chromium/issues/detail?id=445377
55 // When we have the option of using either dFdx or dfDy in a shader, this returns whether we
56 // should avoid using dFdx. We have found some drivers have bugs or lower precision when using
57 // dFdx.
59
60 // This contains the name of an extension that must be enabled in the shader, if such a thing is
61 // required in order to use a secondary output in the shader. This returns a nullptr if no such
62 // extension is required. However, the return value of this function does not say whether dual
63 // source blending is supported.
64 const char* fSecondaryOutputExtensionString = nullptr;
65
67 const char* fSampleVariablesExtensionString = nullptr;
68
69 const char* fFBFetchExtensionString = nullptr;
70
72};
73
74#endif
const char * options
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool fDstReadInShaderSupport
Definition: GrShaderCaps.h:34
void applyOptionsOverrides(const GrContextOptions &options)
bool fHalfIs32Bits
Definition: GrShaderCaps.h:42
const char * fSecondaryOutputExtensionString
Definition: GrShaderCaps.h:64
bool fBitManipulationSupport
Definition: GrShaderCaps.h:41
const char * fSampleVariablesExtensionString
Definition: GrShaderCaps.h:67
int fMaxFragmentSamplers
Definition: GrShaderCaps.h:71
const char * sampleVariablesExtensionString() const
Definition: GrShaderCaps.h:27
bool fMustObfuscateUniformColor
Definition: GrShaderCaps.h:51
bool fAvoidDfDxForGradientsWhenPossible
Definition: GrShaderCaps.h:58
bool fPreferFlatInterpolation
Definition: GrShaderCaps.h:35
bool fVertexIDSupport
Definition: GrShaderCaps.h:36
const char * fNoPerspectiveInterpolationExtensionString
Definition: GrShaderCaps.h:66
bool fRequiresLocalOutputColorForFBFetch
Definition: GrShaderCaps.h:49
bool fMustWriteToFragColor
Definition: GrShaderCaps.h:54
void dumpJSON(SkJSONWriter *) const
const char * fFBFetchExtensionString
Definition: GrShaderCaps.h:69
bool fReducedShaderMode
Definition: GrShaderCaps.h:46
const char * noperspectiveInterpolationExtensionString() const
Definition: GrShaderCaps.h:22
bool fHasLowFragmentPrecision
Definition: GrShaderCaps.h:43
bool fNonconstantArrayIndexSupport
Definition: GrShaderCaps.h:39
bool fSampleMaskSupport
Definition: SkSLUtil.h:98
bool fNoPerspectiveInterpolationSupport
Definition: SkSLUtil.h:97