blob: fe6184dddaae12b78a5ed3368e173fdea342a5ac [file] [log] [blame]
John Stiles232dd2b2021-01-25 10:57:47 -05001/*
2 * Copyright 2021 Google LLC
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#include "gm/gm.h"
9#include "include/core/SkBitmap.h"
10#include "include/core/SkCanvas.h"
11#include "include/core/SkData.h"
12#include "include/core/SkFont.h"
13#include "include/core/SkPaint.h"
14#include "include/core/SkSize.h"
15#include "include/core/SkString.h"
16#include "include/core/SkSurface.h"
17#include "include/effects/SkGradientShader.h"
18#include "include/effects/SkImageFilters.h"
19#include "include/effects/SkRuntimeEffect.h"
Ethan Nicholasdaed2592021-03-04 14:30:25 -050020#include "include/private/SkSLDefines.h" // for kDefaultInlineThreshold
John Stiles232dd2b2021-01-25 10:57:47 -050021#include "include/utils/SkRandom.h"
John Stiles65d7ab22021-04-28 15:14:09 -040022#include "src/gpu/GrCaps.h"
23#include "src/gpu/GrDirectContextPriv.h"
John Stiles232dd2b2021-01-25 10:57:47 -050024#include "tests/Test.h"
25#include "tools/Resources.h"
26#include "tools/ToolUtils.h"
27
28static const SkRect kRect = SkRect::MakeWH(1, 1);
29
John Stilesb41d5bb2021-01-26 16:28:12 -050030template <typename T>
31static void set_uniform(SkRuntimeShaderBuilder* builder, const char* name, const T& value) {
32 SkRuntimeShaderBuilder::BuilderUniform uniform = builder->uniform(name);
33 if (uniform.fVar) {
34 uniform = value;
35 }
36}
37
John Stilesd80f9662021-02-03 11:42:32 -050038static void test_one_permutation(skiatest::Reporter* r,
39 SkSurface* surface,
40 const char* testFile,
41 const char* permutationSuffix,
42 const SkRuntimeEffect::Options& options) {
John Stiles232dd2b2021-01-25 10:57:47 -050043 SkString resourcePath = SkStringPrintf("sksl/%s", testFile);
44 sk_sp<SkData> shaderData = GetResourceAsData(resourcePath.c_str());
45 if (!shaderData) {
John Stilesd80f9662021-02-03 11:42:32 -050046 ERRORF(r, "%s%s: Unable to load file", testFile, permutationSuffix);
John Stiles232dd2b2021-01-25 10:57:47 -050047 return;
48 }
49
50 SkString shaderString{reinterpret_cast<const char*>(shaderData->bytes()), shaderData->size()};
Brian Osman169c8902021-04-21 14:27:08 -040051 SkRuntimeEffect::Result result = SkRuntimeEffect::MakeForShader(shaderString, options);
John Stilesd80f9662021-02-03 11:42:32 -050052 if (!result.effect) {
53 ERRORF(r, "%s%s: %s", testFile, permutationSuffix, result.errorText.c_str());
John Stiles232dd2b2021-01-25 10:57:47 -050054 return;
55 }
56
John Stilesd80f9662021-02-03 11:42:32 -050057 SkRuntimeShaderBuilder builder(result.effect);
John Stilese1658b52021-01-29 11:44:13 -050058 set_uniform(&builder, "colorBlack", SkV4{0, 0, 0, 1});
59 set_uniform(&builder, "colorRed", SkV4{1, 0, 0, 1});
60 set_uniform(&builder, "colorGreen", SkV4{0, 1, 0, 1});
61 set_uniform(&builder, "colorBlue", SkV4{0, 0, 1, 1});
62 set_uniform(&builder, "colorWhite", SkV4{1, 1, 1, 1});
63 set_uniform(&builder, "testInputs", SkV4{-1.25, 0, 0.75, 2.25});
John Stiles01cdf012021-02-10 09:53:41 -050064 set_uniform(&builder, "testMatrix2x2", std::array<float,4>{1, 2,
65 3, 4});
66 set_uniform(&builder, "testMatrix3x3", std::array<float,9>{1, 2, 3,
67 4, 5, 6,
68 7, 8, 9});
John Stilese1658b52021-01-29 11:44:13 -050069 set_uniform(&builder, "unknownInput", 1.0f);
John Stilesa0e407d2021-02-10 12:21:51 -050070 set_uniform(&builder, "testMatrix2x2", std::array<float,4>{1, 2,
71 3, 4});
72 set_uniform(&builder, "testMatrix3x3", std::array<float,9>{1, 2, 3,
73 4, 5, 6,
74 7, 8, 9});
John Stilesb41d5bb2021-01-26 16:28:12 -050075
John Stiles232dd2b2021-01-25 10:57:47 -050076 sk_sp<SkShader> shader = builder.makeShader(/*localMatrix=*/nullptr, /*isOpaque=*/true);
77 if (!shader) {
John Stilesd80f9662021-02-03 11:42:32 -050078 ERRORF(r, "%s%s: Unable to build shader", testFile, permutationSuffix);
John Stiles232dd2b2021-01-25 10:57:47 -050079 return;
80 }
81
82 SkPaint paintShader;
83 paintShader.setShader(shader);
84 surface->getCanvas()->drawRect(kRect, paintShader);
85
86 SkBitmap bitmap;
87 REPORTER_ASSERT(r, bitmap.tryAllocPixels(surface->imageInfo()));
88 REPORTER_ASSERT(r, surface->readPixels(bitmap.info(), bitmap.getPixels(), bitmap.rowBytes(),
89 /*srcX=*/0, /*srcY=*/0));
90
91 SkColor color = bitmap.getColor(0, 0);
92 REPORTER_ASSERT(r, color == SkColorSetARGB(0xFF, 0x00, 0xFF, 0x00),
93 "Expected: solid green. Actual: A=%02X R=%02X G=%02X B=%02X.",
94 SkColorGetA(color), SkColorGetR(color), SkColorGetG(color), SkColorGetB(color));
95}
96
John Stiles65d7ab22021-04-28 15:14:09 -040097static void test_permutations(skiatest::Reporter* r,
98 SkSurface* surface,
99 const char* testFile,
100 bool worksInES2) {
John Stilesd80f9662021-02-03 11:42:32 -0500101 SkRuntimeEffect::Options options;
John Stiles65d7ab22021-04-28 15:14:09 -0400102 options.enforceES2Restrictions = worksInES2;
John Stiles9d26af92021-03-23 09:25:33 -0400103 options.forceNoInline = false;
John Stilesd80f9662021-02-03 11:42:32 -0500104 test_one_permutation(r, surface, testFile, "", options);
John Stiles9d26af92021-03-23 09:25:33 -0400105
106 options.forceNoInline = true;
107 test_one_permutation(r, surface, testFile, " (NoInline)", options);
John Stilesd80f9662021-02-03 11:42:32 -0500108}
109
John Stiles232dd2b2021-01-25 10:57:47 -0500110static void test_cpu(skiatest::Reporter* r, const char* testFile) {
111 const SkImageInfo info = SkImageInfo::MakeN32Premul(kRect.width(), kRect.height());
112 sk_sp<SkSurface> surface(SkSurface::MakeRaster(info));
113
John Stiles65d7ab22021-04-28 15:14:09 -0400114 test_permutations(r, surface.get(), testFile, /*worksInES2=*/true);
John Stiles232dd2b2021-01-25 10:57:47 -0500115}
116
117static void test_gpu(skiatest::Reporter* r, GrDirectContext* ctx, const char* testFile) {
118 const SkImageInfo info = SkImageInfo::MakeN32Premul(kRect.width(), kRect.height());
119 sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info));
120
John Stiles65d7ab22021-04-28 15:14:09 -0400121 test_permutations(r, surface.get(), testFile, /*worksInES2=*/true);
122}
123
124static void test_es3(skiatest::Reporter* r, GrDirectContext* ctx, const char* testFile) {
125 // We don't have an ES2 caps bit, so we check for integer support and derivatives support.
126 // Our ES2 bots should return false for these.
127 if (!ctx->priv().caps()->shaderCaps()->shaderDerivativeSupport() ||
128 !ctx->priv().caps()->shaderCaps()->integerSupport()) {
129 return;
130 }
131 // ES3-only tests never run on the CPU, because SkVM lacks support for many non-ES2 features.
132 const SkImageInfo info = SkImageInfo::MakeN32Premul(kRect.width(), kRect.height());
133 sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info));
134
135 test_permutations(r, surface.get(), testFile, /*worksInES2=*/false);
John Stiles232dd2b2021-01-25 10:57:47 -0500136}
137
John Stilesb4418502021-02-04 10:57:08 -0500138#define SKSL_TEST_CPU(name, path) \
John Stiles232dd2b2021-01-25 10:57:47 -0500139 DEF_TEST(name ## _CPU, r) { \
140 test_cpu(r, path); \
John Stilesb4418502021-02-04 10:57:08 -0500141 }
142#define SKSL_TEST_GPU(name, path) \
John Stiles232dd2b2021-01-25 10:57:47 -0500143 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(name ## _GPU, r, ctxInfo) { \
144 test_gpu(r, ctxInfo.directContext(), path); \
145 }
John Stiles65d7ab22021-04-28 15:14:09 -0400146#define SKSL_TEST_ES3(name, path) \
147 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(name ## _GPU, r, ctxInfo) { \
148 test_es3(r, ctxInfo.directContext(), path); \
149 }
John Stilesb4418502021-02-04 10:57:08 -0500150#define SKSL_TEST(name, path) SKSL_TEST_CPU(name, path) SKSL_TEST_GPU(name, path)
John Stiles232dd2b2021-01-25 10:57:47 -0500151
John Stiles34c098d2021-02-09 10:38:59 -0500152SKSL_TEST(SkSLAssignmentOps, "folding/AssignmentOps.sksl")
John Stilesd4374782021-02-05 09:31:21 -0500153SKSL_TEST(SkSLBoolFolding, "folding/BoolFolding.sksl")
154SKSL_TEST(SkSLIntFoldingES2, "folding/IntFoldingES2.sksl")
John Stiles65d7ab22021-04-28 15:14:09 -0400155SKSL_TEST_ES3(SkSLIntFoldingES3, "folding/IntFoldingES3.sksl")
John Stilesd4374782021-02-05 09:31:21 -0500156SKSL_TEST(SkSLFloatFolding, "folding/FloatFolding.sksl")
Brian Osman169c8902021-04-21 14:27:08 -0400157// skbug.com/11919: Fails on Nexus5/7, and Intel GPUs
158SKSL_TEST_CPU(SkSLMatrixFoldingES2, "folding/MatrixFoldingES2.sksl")
Brian Osman8e756f32021-02-10 10:19:27 -0500159SKSL_TEST(SkSLSelfAssignment, "folding/SelfAssignment.sksl")
John Stilesd4374782021-02-05 09:31:21 -0500160SKSL_TEST(SkSLShortCircuitBoolFolding, "folding/ShortCircuitBoolFolding.sksl")
John Stilesfb7d3782021-04-29 11:14:38 -0400161SKSL_TEST(SkSLSwizzleFolding, "folding/SwizzleFolding.sksl")
John Stiles03467a52021-03-04 15:19:48 +0000162SKSL_TEST(SkSLVectorScalarFolding, "folding/VectorScalarFolding.sksl")
John Stilesd4374782021-02-05 09:31:21 -0500163SKSL_TEST(SkSLVectorVectorFolding, "folding/VectorVectorFolding.sksl")
John Stiles232dd2b2021-01-25 10:57:47 -0500164
John Stiles0c9d8882021-03-25 17:04:36 -0400165SKSL_TEST(SkSLForBodyMustBeInlinedIntoAScope, "inliner/ForBodyMustBeInlinedIntoAScope.sksl")
John Stiles65d7ab22021-04-28 15:14:09 -0400166SKSL_TEST_ES3(SkSLForInitializerExpressionsCanBeInlined,
167 "inliner/ForInitializerExpressionsCanBeInlined.sksl")
John Stiles0c9d8882021-03-25 17:04:36 -0400168SKSL_TEST(SkSLForWithoutReturnInsideCanBeInlined, "inliner/ForWithoutReturnInsideCanBeInlined.sksl")
169SKSL_TEST(SkSLForWithReturnInsideCannotBeInlined, "inliner/ForWithReturnInsideCannotBeInlined.sksl")
170SKSL_TEST(SkSLIfBodyMustBeInlinedIntoAScope, "inliner/IfBodyMustBeInlinedIntoAScope.sksl")
171SKSL_TEST(SkSLIfElseBodyMustBeInlinedIntoAScope, "inliner/IfElseBodyMustBeInlinedIntoAScope.sksl")
172SKSL_TEST(SkSLIfElseChainWithReturnsCanBeInlined, "inliner/IfElseChainWithReturnsCanBeInlined.sksl")
173SKSL_TEST(SkSLIfTestCanBeInlined, "inliner/IfTestCanBeInlined.sksl")
174SKSL_TEST(SkSLIfWithReturnsCanBeInlined, "inliner/IfWithReturnsCanBeInlined.sksl")
175SKSL_TEST(SkSLInlineKeywordOverridesThreshold, "inliner/InlineKeywordOverridesThreshold.sksl")
176SKSL_TEST(SkSLInlinerAvoidsVariableNameOverlap, "inliner/InlinerAvoidsVariableNameOverlap.sksl")
177SKSL_TEST(SkSLInlinerElidesTempVarForReturnsInsideBlock,
178 "inliner/InlinerElidesTempVarForReturnsInsideBlock.sksl")
179SKSL_TEST(SkSLInlinerUsesTempVarForMultipleReturns,
180 "inliner/InlinerUsesTempVarForMultipleReturns.sksl")
181SKSL_TEST(SkSLInlinerUsesTempVarForReturnsInsideBlockWithVar,
182 "inliner/InlinerUsesTempVarForReturnsInsideBlockWithVar.sksl")
183SKSL_TEST(SkSLInlineThreshold, "inliner/InlineThreshold.sksl")
Brian Osman169c8902021-04-21 14:27:08 -0400184// skbug.com/11919: Fails on Adreno + Vulkan
185SKSL_TEST_CPU(SkSLInlineWithInoutArgument, "inliner/InlineWithInoutArgument.sksl")
John Stiles0c9d8882021-03-25 17:04:36 -0400186SKSL_TEST(SkSLInlineWithModifiedArgument, "inliner/InlineWithModifiedArgument.sksl")
187SKSL_TEST(SkSLInlineWithNestedBigCalls, "inliner/InlineWithNestedBigCalls.sksl")
188SKSL_TEST(SkSLInlineWithUnmodifiedArgument, "inliner/InlineWithUnmodifiedArgument.sksl")
189SKSL_TEST(SkSLInlineWithUnnecessaryBlocks, "inliner/InlineWithUnnecessaryBlocks.sksl")
190SKSL_TEST(SkSLNoInline, "inliner/NoInline.sksl")
191SKSL_TEST(SkSLShortCircuitEvaluationsCannotInlineRightHandSide,
192 "inliner/ShortCircuitEvaluationsCannotInlineRightHandSide.sksl")
193SKSL_TEST(SkSLStructsCanBeInlinedSafely, "inliner/StructsCanBeInlinedSafely.sksl")
194SKSL_TEST(SkSLSwizzleCanBeInlinedDirectly, "inliner/SwizzleCanBeInlinedDirectly.sksl")
195SKSL_TEST(SkSLTernaryResultsCannotBeInlined, "inliner/TernaryResultsCannotBeInlined.sksl")
196SKSL_TEST(SkSLTernaryTestCanBeInlined, "inliner/TernaryTestCanBeInlined.sksl")
197SKSL_TEST(SkSLTrivialArgumentsInlineDirectly, "inliner/TrivialArgumentsInlineDirectly.sksl")
John Stiles65d7ab22021-04-28 15:14:09 -0400198SKSL_TEST_ES3(SkSLWhileBodyMustBeInlinedIntoAScope,
199 "inliner/WhileBodyMustBeInlinedIntoAScope.sksl")
200SKSL_TEST_ES3(SkSLWhileTestCannotBeInlined, "inliner/WhileTestCannotBeInlined.sksl")
John Stiles0c9d8882021-03-25 17:04:36 -0400201
John Stilesbff24ab2021-03-17 13:20:10 -0400202// TODO(skia:11052): SPIR-V does not yet honor `out` param semantics correctly
203SKSL_TEST_CPU(SkSLInlinerHonorsGLSLOutParamSemantics,
John Stiles0c9d8882021-03-25 17:04:36 -0400204 "inliner/InlinerHonorsGLSLOutParamSemantics.sksl")
John Stilesbff24ab2021-03-17 13:20:10 -0400205
John Stilesd4374782021-02-05 09:31:21 -0500206SKSL_TEST(SkSLIntrinsicAbsFloat, "intrinsics/AbsFloat.sksl")
207SKSL_TEST(SkSLIntrinsicCeil, "intrinsics/Ceil.sksl")
208SKSL_TEST(SkSLIntrinsicClampFloat, "intrinsics/ClampFloat.sksl")
209SKSL_TEST(SkSLIntrinsicMaxFloat, "intrinsics/MaxFloat.sksl")
210SKSL_TEST(SkSLIntrinsicMinFloat, "intrinsics/MinFloat.sksl")
Brian Osman169c8902021-04-21 14:27:08 -0400211// skbug.com/11919: Fails on Adreno + Vulkan
212SKSL_TEST_CPU(SkSLIntrinsicMixFloat, "intrinsics/MixFloat.sksl")
John Stilesd4374782021-02-05 09:31:21 -0500213SKSL_TEST(SkSLIntrinsicSignFloat, "intrinsics/SignFloat.sksl")
John Stilese1658b52021-01-29 11:44:13 -0500214
John Stilesd4374782021-02-05 09:31:21 -0500215SKSL_TEST(SkSLArrayTypes, "shared/ArrayTypes.sksl")
216SKSL_TEST(SkSLAssignment, "shared/Assignment.sksl")
217SKSL_TEST(SkSLCastsRoundTowardZero, "shared/CastsRoundTowardZero.sksl")
218SKSL_TEST(SkSLCommaMixedTypes, "shared/CommaMixedTypes.sksl")
John Stiles31508392021-03-17 16:59:07 -0400219// This test causes the Adreno 330 driver to crash, and does not pass on Quadro P400 in wasm.
220// The CPU test confirms that we can get it right, even if not all drivers do.
221SKSL_TEST_CPU(SkSLCommaSideEffects, "shared/CommaSideEffects.sksl")
John Stilesd4374782021-02-05 09:31:21 -0500222SKSL_TEST(SkSLConstantIf, "shared/ConstantIf.sksl")
223SKSL_TEST(SkSLConstVariableComparison, "shared/ConstVariableComparison.sksl")
224SKSL_TEST(SkSLDeadIfStatement, "shared/DeadIfStatement.sksl")
225SKSL_TEST(SkSLDeadStripFunctions, "shared/DeadStripFunctions.sksl")
226SKSL_TEST(SkSLDependentInitializers, "shared/DependentInitializers.sksl")
227SKSL_TEST(SkSLEmptyBlocksES2, "shared/EmptyBlocksES2.sksl")
228SKSL_TEST(SkSLForLoopControlFlow, "shared/ForLoopControlFlow.sksl")
229SKSL_TEST(SkSLFunctionArgTypeMatch, "shared/FunctionArgTypeMatch.sksl")
230SKSL_TEST(SkSLFunctionReturnTypeMatch, "shared/FunctionReturnTypeMatch.sksl")
231SKSL_TEST(SkSLFunctions, "shared/Functions.sksl")
232SKSL_TEST(SkSLGeometricIntrinsics, "shared/GeometricIntrinsics.sksl")
233SKSL_TEST(SkSLHelloWorld, "shared/HelloWorld.sksl")
234SKSL_TEST(SkSLHex, "shared/Hex.sksl")
235SKSL_TEST(SkSLMatrices, "shared/Matrices.sksl")
John Stilesa0e407d2021-02-10 12:21:51 -0500236SKSL_TEST(SkSLMatrixEquality, "shared/MatrixEquality.sksl")
John Stilesd4374782021-02-05 09:31:21 -0500237SKSL_TEST(SkSLMultipleAssignments, "shared/MultipleAssignments.sksl")
238SKSL_TEST(SkSLNegatedVectorLiteral, "shared/NegatedVectorLiteral.sksl")
239SKSL_TEST(SkSLNumberCasts, "shared/NumberCasts.sksl")
240SKSL_TEST(SkSLOperatorsES2, "shared/OperatorsES2.sksl")
Brian Osman169c8902021-04-21 14:27:08 -0400241
242// skbug.com/11919: Fails on Adreno + Vulkan
243SKSL_TEST_CPU(SkSLOutParams, "shared/OutParams.sksl")
244SKSL_TEST_CPU(SkSLOutParamsNoInline, "shared/OutParamsNoInline.sksl")
245SKSL_TEST_CPU(SkSLOutParamsTricky, "shared/OutParamsTricky.sksl")
246
John Stilesd4374782021-02-05 09:31:21 -0500247SKSL_TEST(SkSLResizeMatrix, "shared/ResizeMatrix.sksl")
John Stilesb3dcbb12021-03-04 16:00:20 -0500248SKSL_TEST(SkSLReturnsValueOnEveryPathES2, "shared/ReturnsValueOnEveryPathES2.sksl")
John Stilesd4374782021-02-05 09:31:21 -0500249SKSL_TEST(SkSLScalarConversionConstructorsES2, "shared/ScalarConversionConstructorsES2.sksl")
250SKSL_TEST(SkSLStackingVectorCasts, "shared/StackingVectorCasts.sksl")
251SKSL_TEST(SkSLStaticIf, "shared/StaticIf.sksl")
John Stiles35c45522021-04-29 13:37:11 +0000252// TODO(skia:11908) Re-enable this when Metal supports struct equality
253SKSL_TEST_CPU(SkSLStructsInFunctions, "shared/StructsInFunctions.sksl")
John Stilesd4374782021-02-05 09:31:21 -0500254SKSL_TEST(SkSLSwizzleBoolConstants, "shared/SwizzleBoolConstants.sksl")
John Stilesc2c1b0c2021-02-05 16:24:03 -0500255SKSL_TEST(SkSLSwizzleByConstantIndex, "shared/SwizzleByConstantIndex.sksl")
256SKSL_TEST(SkSLSwizzleConstants, "shared/SwizzleConstants.sksl")
257SKSL_TEST(SkSLSwizzleLTRB, "shared/SwizzleLTRB.sksl")
258SKSL_TEST(SkSLSwizzleOpt, "shared/SwizzleOpt.sksl")
259SKSL_TEST(SkSLSwizzleScalar, "shared/SwizzleScalar.sksl")
John Stilesecd7c222021-02-08 14:20:28 -0500260SKSL_TEST(SkSLTernaryAsLValueEntirelyFoldable, "shared/TernaryAsLValueEntirelyFoldable.sksl")
261SKSL_TEST(SkSLTernaryAsLValueFoldableTest, "shared/TernaryAsLValueFoldableTest.sksl")
John Stiles28054ad2021-03-05 15:22:48 -0500262SKSL_TEST(SkSLTernaryExpression, "shared/TernaryExpression.sksl")
John Stilesecd7c222021-02-08 14:20:28 -0500263SKSL_TEST(SkSLUnaryPositiveNegative, "shared/UnaryPositiveNegative.sksl")
264SKSL_TEST(SkSLUnusedVariables, "shared/UnusedVariables.sksl")
265SKSL_TEST(SkSLVectorConstructors, "shared/VectorConstructors.sksl")
Brian Osman169c8902021-04-21 14:27:08 -0400266// skbug.com/11919: Fails on Nexus5/7, and Intel GPUs
267SKSL_TEST_CPU(SkSLVectorScalarMath, "shared/VectorScalarMath.sksl")
John Stiles7b928972021-01-27 09:56:04 -0500268
John Stiles232dd2b2021-01-25 10:57:47 -0500269/*
John Stilesecd20362021-02-03 17:44:47 -0500270// Incompatible with Runtime Effects because calling a function before its definition is disallowed.
271// (This was done to prevent recursion, as required by ES2.)
John Stiles0ac6c152021-02-10 14:04:24 -0500272SKSL_TEST(SkSLFunctionPrototype, "shared/FunctionPrototype.sksl")
John Stilese1658b52021-01-29 11:44:13 -0500273*/
274
275/*
John Stiles232dd2b2021-01-25 10:57:47 -0500276TODO(skia:11209): enable these tests when Runtime Effects have support for ES3
277
John Stilesd4374782021-02-05 09:31:21 -0500278SKSL_TEST(SkSLMatrixFoldingES3, "folding/MatrixFoldingES3.sksl")
John Stiles7b928972021-01-27 09:56:04 -0500279
John Stiles0c9d8882021-03-25 17:04:36 -0400280SKSL_TEST(SkSLDoWhileBodyMustBeInlinedIntoAScope, "inliner/DoWhileBodyMustBeInlinedIntoAScope.sksl")
281SKSL_TEST(SkSLDoWhileTestCannotBeInlined, "inliner/DoWhileTestCannotBeInlined.sksl")
John Stiles65d7ab22021-04-28 15:14:09 -0400282SKSL_TEST(SkSLEnumsCanBeInlinedSafely, "inliner/EnumsCanBeInlinedSafely.sksl")
John Stiles0c9d8882021-03-25 17:04:36 -0400283SKSL_TEST(SkSLStaticSwitch, "inliner/StaticSwitch.sksl")
John Stiles0c9d8882021-03-25 17:04:36 -0400284
John Stilesd4374782021-02-05 09:31:21 -0500285SKSL_TEST(SkSLIntrinsicAbsInt, "intrinsics/AbsInt.sksl")
286SKSL_TEST(SkSLIntrinsicClampInt, "intrinsics/ClampInt.sksl")
287SKSL_TEST(SkSLIntrinsicMaxInt, "intrinsics/MaxInt.sksl")
288SKSL_TEST(SkSLIntrinsicMinInt, "intrinsics/MinInt.sksl")
289SKSL_TEST(SkSLIntrinsicMixBool, "intrinsics/MixBool.sksl")
290SKSL_TEST(SkSLIntrinsicSignInt, "intrinsics/SignInt.sksl")
John Stilese1658b52021-01-29 11:44:13 -0500291
John Stilesd4374782021-02-05 09:31:21 -0500292SKSL_TEST(SkSLArrayConstructors, "shared/ArrayConstructors.sksl")
293SKSL_TEST(SkSLDeadLoopVariable, "shared/DeadLoopVariable.sksl")
294SKSL_TEST(SkSLDoWhileControlFlow, "shared/DoWhileControlFlow.sksl")
295SKSL_TEST(SkSLEmptyBlocksES3, "shared/EmptyBlocksES3.sksl")
296SKSL_TEST(SkSLHexUnsigned, "shared/HexUnsigned.sksl")
297SKSL_TEST(SkSLMatricesNonsquare, "shared/MatricesNonsquare.sksl")
298SKSL_TEST(SkSLOperatorsES3, "shared/OperatorsES3.sksl")
299SKSL_TEST(SkSLResizeMatrixNonsquare, "shared/ResizeMatrixNonsquare.sksl")
John Stilesb3dcbb12021-03-04 16:00:20 -0500300SKSL_TEST(SkSLReturnsValueOnEveryPathES3, "shared/ReturnsValueOnEveryPathES3.sksl")
John Stilesd4374782021-02-05 09:31:21 -0500301SKSL_TEST(SkSLScalarConversionConstructorsES3, "shared/ScalarConversionConstructorsES3.sksl")
John Stilesc2c1b0c2021-02-05 16:24:03 -0500302SKSL_TEST(SkSLSwizzleByIndex, "shared/SwizzleByIndex.sksl")
John Stilesd4374782021-02-05 09:31:21 -0500303SKSL_TEST(SkSLWhileLoopControlFlow, "shared/WhileLoopControlFlow.sksl")
John Stiles232dd2b2021-01-25 10:57:47 -0500304*/