jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 9 | #include "src/gpu/GrShaderCaps.h" |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 10 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/gpu/GrContextOptions.h" |
| 12 | #include "src/utils/SkJSONWriter.h" |
egdaniel | b7e7d57 | 2015-11-04 04:23:53 -0800 | [diff] [blame] | 13 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 14 | //////////////////////////////////////////////////////////////////////////////////////////// |
| 15 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 16 | GrShaderCaps::GrShaderCaps(const GrContextOptions& options) { |
| 17 | fGLSLGeneration = k330_GrGLSLGeneration; |
| 18 | fShaderDerivativeSupport = false; |
| 19 | fGeometryShaderSupport = false; |
Chris Dalton | f1b47bb | 2017-10-06 11:57:51 -0600 | [diff] [blame] | 20 | fGSInvocationsSupport = false; |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 21 | fDstReadInShaderSupport = false; |
| 22 | fDualSourceBlendingSupport = false; |
| 23 | fIntegerSupport = false; |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 24 | fFBFetchSupport = false; |
| 25 | fFBFetchNeedsCustomOutput = false; |
egdaniel | f529439 | 2015-10-21 07:14:17 -0700 | [diff] [blame] | 26 | fUsesPrecisionModifiers = false; |
egdaniel | 472d44e | 2015-10-22 08:20:00 -0700 | [diff] [blame] | 27 | fCanUseAnyFunctionInShader = true; |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 28 | fCanUseMinAndAbsTogether = true; |
Florin Malita | 8a0044f | 2017-08-07 14:38:22 -0400 | [diff] [blame] | 29 | fCanUseFractForNegativeValues = true; |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 30 | fMustForceNegatedAtanParamToFloat = false; |
Greg Daniel | 80a08dd | 2017-01-20 10:45:49 -0500 | [diff] [blame] | 31 | fAtan2ImplementedAsAtanYOverX = false; |
Greg Daniel | 10ed243 | 2017-12-01 16:19:43 -0500 | [diff] [blame] | 32 | fMustDoOpBetweenFloorAndAbs = false; |
egdaniel | 138c263 | 2016-08-17 10:59:00 -0700 | [diff] [blame] | 33 | fRequiresLocalOutputColorForFBFetch = false; |
Brian Osman | ac1e496 | 2017-05-25 11:34:38 -0400 | [diff] [blame] | 34 | fMustObfuscateUniformColor = false; |
Brian Osman | dff5d43 | 2017-08-01 14:46:18 -0400 | [diff] [blame] | 35 | fMustGuardDivisionEvenAfterExplicitZeroCheck = false; |
Brian Salomon | f8c187c | 2019-12-19 14:41:57 -0500 | [diff] [blame] | 36 | fInBlendModesFailRandomlyForAllZeroVec = false; |
Brian Osman | cd3261a | 2018-01-16 13:52:29 +0000 | [diff] [blame] | 37 | fCanUseFragCoord = true; |
Chris Dalton | c2d0dd6 | 2018-03-07 07:46:10 -0700 | [diff] [blame] | 38 | fIncompleteShortIntPrecision = false; |
Adrienne Walker | ee8295c | 2018-08-21 10:56:30 -0700 | [diff] [blame] | 39 | fAddAndTrueToLoopCondition = false; |
Adrienne Walker | c02165f | 2018-08-21 11:08:11 -0700 | [diff] [blame] | 40 | fUnfoldShortCircuitAsTernary = false; |
Adrienne Walker | 92b161f | 2018-08-22 10:41:52 -0700 | [diff] [blame] | 41 | fEmulateAbsIntFunction = false; |
Adrienne Walker | 8b23ca6 | 2018-08-22 10:45:41 -0700 | [diff] [blame] | 42 | fRewriteDoWhileLoops = false; |
Adrienne Walker | 2f4c09b | 2018-08-22 16:04:57 -0700 | [diff] [blame] | 43 | fRemovePowWithConstantExponent = false; |
Chris Dalton | 8e30ad4 | 2019-04-08 10:51:14 -0600 | [diff] [blame] | 44 | fMustWriteToFragColor = false; |
Brian Salomon | 5a5f3e8 | 2019-08-16 15:05:40 -0400 | [diff] [blame] | 45 | fNoDefaultPrecisionForExternalSamplers = false; |
John Stiles | 85749c0 | 2021-03-23 17:12:03 -0400 | [diff] [blame] | 46 | fRewriteMatrixVectorMultiply = false; |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 47 | fFlatInterpolationSupport = false; |
Brian Salomon | 4127456 | 2017-09-15 09:40:03 -0700 | [diff] [blame] | 48 | fPreferFlatInterpolation = false; |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 49 | fNoPerspectiveInterpolationSupport = false; |
Chris Dalton | 8a64a44 | 2019-10-29 18:54:58 -0600 | [diff] [blame] | 50 | fSampleMaskSupport = false; |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 51 | fExternalTextureSupport = false; |
Chris Dalton | 1d61635 | 2017-05-31 12:51:23 -0600 | [diff] [blame] | 52 | fVertexIDSupport = false; |
Chris Dalton | 7c7ff03 | 2018-03-28 20:09:58 -0600 | [diff] [blame] | 53 | fFPManipulationSupport = false; |
Chris Dalton | 47c8ed3 | 2017-11-15 18:27:09 -0700 | [diff] [blame] | 54 | fFloatIs32Bits = true; |
| 55 | fHalfIs32Bits = false; |
Jim Van Verth | 20ae25c | 2019-03-29 08:50:41 -0400 | [diff] [blame] | 56 | fHasLowFragmentPrecision = false; |
Brian Salomon | e9f2265 | 2021-04-12 11:18:32 -0400 | [diff] [blame] | 57 | fReducedShaderMode = false; |
Brian Osman | 76f635c | 2020-03-25 16:23:11 -0400 | [diff] [blame] | 58 | fColorSpaceMathNeedsFloat = false; |
Brian Osman | d8efe70 | 2020-09-22 09:49:04 -0400 | [diff] [blame] | 59 | fBuiltinFMASupport = false; |
John Stiles | 6f3015a | 2020-10-08 14:55:36 -0400 | [diff] [blame] | 60 | fBuiltinDeterminantSupport = false; |
Ethan Nicholas | 70728ef | 2020-05-28 07:09:00 -0400 | [diff] [blame] | 61 | fCanUseDoLoops = true; |
Jim Van Verth | ff98f28 | 2021-03-19 08:37:02 -0400 | [diff] [blame] | 62 | fCanUseFastMath = false; |
Brian Osman | 28f702c | 2021-02-02 11:52:07 -0500 | [diff] [blame] | 63 | fUseNodePools = true; |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 64 | |
egdaniel | 472d44e | 2015-10-22 08:20:00 -0700 | [diff] [blame] | 65 | fVersionDeclString = nullptr; |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 66 | fShaderDerivativeExtensionString = nullptr; |
Chris Dalton | 8fd7955 | 2018-01-11 00:46:14 -0500 | [diff] [blame] | 67 | fGeometryShaderExtensionString = nullptr; |
Chris Dalton | f1b47bb | 2017-10-06 11:57:51 -0600 | [diff] [blame] | 68 | fGSInvocationsExtensionString = nullptr; |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 69 | fFragCoordConventionsExtensionString = nullptr; |
| 70 | fSecondaryOutputExtensionString = nullptr; |
bsalomon | 7ea33f5 | 2015-11-22 14:51:00 -0800 | [diff] [blame] | 71 | fExternalTextureExtensionString = nullptr; |
Brian Osman | 061020e | 2018-04-17 14:22:15 -0400 | [diff] [blame] | 72 | fSecondExternalTextureExtensionString = nullptr; |
cdalton | c08f196 | 2016-02-12 12:14:06 -0800 | [diff] [blame] | 73 | fNoPerspectiveInterpolationExtensionString = nullptr; |
Chris Dalton | d31b5e7 | 2019-02-26 18:02:16 -0700 | [diff] [blame] | 74 | fSampleVariablesExtensionString = nullptr; |
Chris Dalton | 5a2f962 | 2019-12-27 14:56:38 -0700 | [diff] [blame] | 75 | fTessellationExtensionString = nullptr; |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 76 | fFBFetchColorName = nullptr; |
| 77 | fFBFetchExtensionString = nullptr; |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 78 | fMaxFragmentSamplers = 0; |
Chris Dalton | b96995d | 2020-06-04 16:44:29 -0600 | [diff] [blame] | 79 | fMaxTessellationSegments = 0; |
jvanverth | 98a83a9 | 2015-06-24 11:07:07 -0700 | [diff] [blame] | 80 | fAdvBlendEqInteraction = kNotSupported_AdvBlendEqInteraction; |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 81 | } |
| 82 | |
Kevin Lubick | f4def34 | 2018-10-04 12:52:50 -0400 | [diff] [blame] | 83 | #ifdef SK_ENABLE_DUMP_GPU |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 84 | void GrShaderCaps::dumpJSON(SkJSONWriter* writer) const { |
| 85 | writer->beginObject(); |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 86 | |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 87 | writer->appendBool("Shader Derivative Support", fShaderDerivativeSupport); |
| 88 | writer->appendBool("Geometry Shader Support", fGeometryShaderSupport); |
Chris Dalton | f1b47bb | 2017-10-06 11:57:51 -0600 | [diff] [blame] | 89 | writer->appendBool("Geometry Shader Invocations Support", fGSInvocationsSupport); |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 90 | writer->appendBool("Dst Read In Shader Support", fDstReadInShaderSupport); |
| 91 | writer->appendBool("Dual Source Blending Support", fDualSourceBlendingSupport); |
| 92 | writer->appendBool("Integer Support", fIntegerSupport); |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 93 | |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 94 | static const char* kAdvBlendEqInteractionStr[] = { |
| 95 | "Not Supported", |
| 96 | "Automatic", |
| 97 | "General Enable", |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 98 | }; |
Brian Salomon | 4dea72a | 2019-12-18 10:43:10 -0500 | [diff] [blame] | 99 | static_assert(0 == kNotSupported_AdvBlendEqInteraction); |
| 100 | static_assert(1 == kAutomatic_AdvBlendEqInteraction); |
| 101 | static_assert(2 == kGeneralEnable_AdvBlendEqInteraction); |
Brian Salomon | 4dea72a | 2019-12-18 10:43:10 -0500 | [diff] [blame] | 102 | static_assert(SK_ARRAY_COUNT(kAdvBlendEqInteractionStr) == kLast_AdvBlendEqInteraction + 1); |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 103 | |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 104 | writer->appendBool("FB Fetch Support", fFBFetchSupport); |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 105 | writer->appendBool("Uses precision modifiers", fUsesPrecisionModifiers); |
| 106 | writer->appendBool("Can use any() function", fCanUseAnyFunctionInShader); |
| 107 | writer->appendBool("Can use min() and abs() together", fCanUseMinAndAbsTogether); |
| 108 | writer->appendBool("Can use fract() for negative values", fCanUseFractForNegativeValues); |
| 109 | writer->appendBool("Must force negated atan param to float", fMustForceNegatedAtanParamToFloat); |
Greg Daniel | 10ed243 | 2017-12-01 16:19:43 -0500 | [diff] [blame] | 110 | writer->appendBool("Must do op between floor and abs", fMustDoOpBetweenFloorAndAbs); |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 111 | writer->appendBool("Must use local out color for FBFetch", fRequiresLocalOutputColorForFBFetch); |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 112 | writer->appendBool("Must obfuscate uniform color", fMustObfuscateUniformColor); |
| 113 | writer->appendBool("Must guard division even after explicit zero check", |
| 114 | fMustGuardDivisionEvenAfterExplicitZeroCheck); |
Brian Salomon | f8c187c | 2019-12-19 14:41:57 -0500 | [diff] [blame] | 115 | writer->appendBool( |
| 116 | "src-in and dst-in blend modes may return (0,0,0,1) when dst/src is all zeros", |
| 117 | fInBlendModesFailRandomlyForAllZeroVec); |
Brian Osman | cd3261a | 2018-01-16 13:52:29 +0000 | [diff] [blame] | 118 | writer->appendBool("Can use gl_FragCoord", fCanUseFragCoord); |
Chris Dalton | c2d0dd6 | 2018-03-07 07:46:10 -0700 | [diff] [blame] | 119 | writer->appendBool("Incomplete short int precision", fIncompleteShortIntPrecision); |
Adrienne Walker | ee8295c | 2018-08-21 10:56:30 -0700 | [diff] [blame] | 120 | writer->appendBool("Add and true to loops workaround", fAddAndTrueToLoopCondition); |
Adrienne Walker | c02165f | 2018-08-21 11:08:11 -0700 | [diff] [blame] | 121 | writer->appendBool("Unfold short circuit as ternary", fUnfoldShortCircuitAsTernary); |
Adrienne Walker | 92b161f | 2018-08-22 10:41:52 -0700 | [diff] [blame] | 122 | writer->appendBool("Emulate abs(int) function", fEmulateAbsIntFunction); |
Adrienne Walker | 8b23ca6 | 2018-08-22 10:45:41 -0700 | [diff] [blame] | 123 | writer->appendBool("Rewrite do while loops", fRewriteDoWhileLoops); |
Adrienne Walker | 2f4c09b | 2018-08-22 16:04:57 -0700 | [diff] [blame] | 124 | writer->appendBool("Rewrite pow with constant exponent", fRemovePowWithConstantExponent); |
Chris Dalton | 8e30ad4 | 2019-04-08 10:51:14 -0600 | [diff] [blame] | 125 | writer->appendBool("Must write to sk_FragColor [workaround]", fMustWriteToFragColor); |
Brian Salomon | 5a5f3e8 | 2019-08-16 15:05:40 -0400 | [diff] [blame] | 126 | writer->appendBool("Don't add default precision statement for samplerExternalOES", |
| 127 | fNoDefaultPrecisionForExternalSamplers); |
John Stiles | 85749c0 | 2021-03-23 17:12:03 -0400 | [diff] [blame] | 128 | writer->appendBool("Rewrite matrix-vector multiply", fRewriteMatrixVectorMultiply); |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 129 | writer->appendBool("Flat interpolation support", fFlatInterpolationSupport); |
Brian Salomon | 4127456 | 2017-09-15 09:40:03 -0700 | [diff] [blame] | 130 | writer->appendBool("Prefer flat interpolation", fPreferFlatInterpolation); |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 131 | writer->appendBool("No perspective interpolation support", fNoPerspectiveInterpolationSupport); |
Chris Dalton | 8a64a44 | 2019-10-29 18:54:58 -0600 | [diff] [blame] | 132 | writer->appendBool("Sample mask support", fSampleMaskSupport); |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 133 | writer->appendBool("External texture support", fExternalTextureSupport); |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 134 | writer->appendBool("sk_VertexID support", fVertexIDSupport); |
Chris Dalton | 7c7ff03 | 2018-03-28 20:09:58 -0600 | [diff] [blame] | 135 | writer->appendBool("Floating point manipulation support", fFPManipulationSupport); |
Chris Dalton | 47c8ed3 | 2017-11-15 18:27:09 -0700 | [diff] [blame] | 136 | writer->appendBool("float == fp32", fFloatIs32Bits); |
| 137 | writer->appendBool("half == fp32", fHalfIs32Bits); |
Jim Van Verth | 20ae25c | 2019-03-29 08:50:41 -0400 | [diff] [blame] | 138 | writer->appendBool("Has poor fragment precision", fHasLowFragmentPrecision); |
Brian Osman | 76f635c | 2020-03-25 16:23:11 -0400 | [diff] [blame] | 139 | writer->appendBool("Color space math needs float", fColorSpaceMathNeedsFloat); |
Chris Dalton | a708618 | 2018-11-16 09:33:43 -0500 | [diff] [blame] | 140 | writer->appendBool("Builtin fma() support", fBuiltinFMASupport); |
John Stiles | 6f3015a | 2020-10-08 14:55:36 -0400 | [diff] [blame] | 141 | writer->appendBool("Builtin determinant() support", fBuiltinDeterminantSupport); |
Ethan Nicholas | 70728ef | 2020-05-28 07:09:00 -0400 | [diff] [blame] | 142 | writer->appendBool("Can use do-while loops", fCanUseDoLoops); |
Brian Osman | 28f702c | 2021-02-02 11:52:07 -0500 | [diff] [blame] | 143 | writer->appendBool("Use node pools", fUseNodePools); |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 144 | |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 145 | writer->appendS32("Max FS Samplers", fMaxFragmentSamplers); |
Chris Dalton | b96995d | 2020-06-04 16:44:29 -0600 | [diff] [blame] | 146 | writer->appendS32("Max Tessellation Segments", fMaxTessellationSegments); |
Brian Osman | 71a1889 | 2017-08-10 10:23:25 -0400 | [diff] [blame] | 147 | writer->appendString("Advanced blend equation interaction", |
| 148 | kAdvBlendEqInteractionStr[fAdvBlendEqInteraction]); |
| 149 | |
| 150 | writer->endObject(); |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 151 | } |
Kevin Lubick | f4def34 | 2018-10-04 12:52:50 -0400 | [diff] [blame] | 152 | #else |
| 153 | void GrShaderCaps::dumpJSON(SkJSONWriter* writer) const { } |
| 154 | #endif |
jvanverth | cba99b8 | 2015-06-24 06:59:57 -0700 | [diff] [blame] | 155 | |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 156 | void GrShaderCaps::applyOptionsOverrides(const GrContextOptions& options) { |
Brian Salomon | 01b476a | 2018-01-23 11:06:41 -0500 | [diff] [blame] | 157 | if (options.fDisableDriverCorrectnessWorkarounds) { |
| 158 | SkASSERT(fCanUseAnyFunctionInShader); |
| 159 | SkASSERT(fCanUseMinAndAbsTogether); |
| 160 | SkASSERT(fCanUseFractForNegativeValues); |
| 161 | SkASSERT(!fMustForceNegatedAtanParamToFloat); |
| 162 | SkASSERT(!fAtan2ImplementedAsAtanYOverX); |
| 163 | SkASSERT(!fMustDoOpBetweenFloorAndAbs); |
| 164 | SkASSERT(!fRequiresLocalOutputColorForFBFetch); |
| 165 | SkASSERT(!fMustObfuscateUniformColor); |
| 166 | SkASSERT(!fMustGuardDivisionEvenAfterExplicitZeroCheck); |
Brian Salomon | f8c187c | 2019-12-19 14:41:57 -0500 | [diff] [blame] | 167 | SkASSERT(!fInBlendModesFailRandomlyForAllZeroVec); |
Brian Salomon | 01b476a | 2018-01-23 11:06:41 -0500 | [diff] [blame] | 168 | SkASSERT(fCanUseFragCoord); |
Chris Dalton | c2d0dd6 | 2018-03-07 07:46:10 -0700 | [diff] [blame] | 169 | SkASSERT(!fIncompleteShortIntPrecision); |
Adrienne Walker | ee8295c | 2018-08-21 10:56:30 -0700 | [diff] [blame] | 170 | SkASSERT(!fAddAndTrueToLoopCondition); |
Adrienne Walker | c02165f | 2018-08-21 11:08:11 -0700 | [diff] [blame] | 171 | SkASSERT(!fUnfoldShortCircuitAsTernary); |
Adrienne Walker | 92b161f | 2018-08-22 10:41:52 -0700 | [diff] [blame] | 172 | SkASSERT(!fEmulateAbsIntFunction); |
Adrienne Walker | 8b23ca6 | 2018-08-22 10:45:41 -0700 | [diff] [blame] | 173 | SkASSERT(!fRewriteDoWhileLoops); |
Adrienne Walker | 2f4c09b | 2018-08-22 16:04:57 -0700 | [diff] [blame] | 174 | SkASSERT(!fRemovePowWithConstantExponent); |
Chris Dalton | 8e30ad4 | 2019-04-08 10:51:14 -0600 | [diff] [blame] | 175 | SkASSERT(!fMustWriteToFragColor); |
Brian Salomon | 5a5f3e8 | 2019-08-16 15:05:40 -0400 | [diff] [blame] | 176 | SkASSERT(!fNoDefaultPrecisionForExternalSamplers); |
John Stiles | 85749c0 | 2021-03-23 17:12:03 -0400 | [diff] [blame] | 177 | SkASSERT(!fRewriteMatrixVectorMultiply); |
Brian Salomon | 01b476a | 2018-01-23 11:06:41 -0500 | [diff] [blame] | 178 | } |
Chris Dalton | 4ac9aad | 2021-02-24 17:41:44 -0700 | [diff] [blame] | 179 | if (!options.fEnableExperimentalHardwareTessellation) { |
| 180 | fMaxTessellationSegments = 0; |
| 181 | } |
Brian Osman | 195c05b | 2017-08-30 15:14:04 -0400 | [diff] [blame] | 182 | #if GR_TEST_UTILS |
Chris Dalton | 8367e11 | 2019-11-13 12:43:21 -0700 | [diff] [blame] | 183 | if (options.fSuppressDualSourceBlending) { |
| 184 | fDualSourceBlendingSupport = false; |
| 185 | } |
| 186 | if (options.fSuppressGeometryShaders) { |
| 187 | fGeometryShaderSupport = false; |
| 188 | } |
Chris Dalton | 3163428 | 2020-09-17 12:16:54 -0600 | [diff] [blame] | 189 | if (options.fMaxTessellationSegmentsOverride > 0) { |
| 190 | fMaxTessellationSegments = std::min(options.fMaxTessellationSegmentsOverride, |
| 191 | fMaxTessellationSegments); |
| 192 | } |
Brian Salomon | e9f2265 | 2021-04-12 11:18:32 -0400 | [diff] [blame] | 193 | if (options.fReducedShaderVariations) { |
| 194 | fReducedShaderMode = true; |
| 195 | } |
Brian Osman | 195c05b | 2017-08-30 15:14:04 -0400 | [diff] [blame] | 196 | #endif |
egdaniel | b7e7d57 | 2015-11-04 04:23:53 -0800 | [diff] [blame] | 197 | } |