Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
SkSLTest.cpp File Reference
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkShader.h"
#include "include/core/SkSpan.h"
#include "include/core/SkString.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkRuntimeEffect.h"
#include "include/gpu/GpuTypes.h"
#include "include/gpu/GrDirectContext.h"
#include "include/gpu/ganesh/SkSurfaceGanesh.h"
#include "include/private/base/SkTArray.h"
#include "include/sksl/SkSLVersion.h"
#include "src/base/SkArenaAlloc.h"
#include "src/base/SkEnumBitMask.h"
#include "src/base/SkStringView.h"
#include "src/core/SkRasterPipeline.h"
#include "src/core/SkRasterPipelineOpContexts.h"
#include "src/core/SkRasterPipelineOpList.h"
#include "src/core/SkRuntimeEffectPriv.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrShaderCaps.h"
#include "src/sksl/SkSLCompiler.h"
#include "src/sksl/SkSLProgramKind.h"
#include "src/sksl/SkSLProgramSettings.h"
#include "src/sksl/SkSLUtil.h"
#include "src/sksl/analysis/SkSLProgramVisitor.h"
#include "src/sksl/codegen/SkSLRasterPipelineBuilder.h"
#include "src/sksl/codegen/SkSLRasterPipelineCodeGenerator.h"
#include "src/sksl/ir/SkSLFunctionDeclaration.h"
#include "src/sksl/ir/SkSLModifierFlags.h"
#include "src/sksl/ir/SkSLProgram.h"
#include "src/sksl/ir/SkSLProgramElement.h"
#include "src/sksl/ir/SkSLStatement.h"
#include "src/sksl/ir/SkSLType.h"
#include "src/sksl/ir/SkSLVarDeclarations.h"
#include "src/sksl/ir/SkSLVariable.h"
#include "src/sksl/tracing/SkSLDebugTracePriv.h"
#include "tests/CtsEnforcement.h"
#include "tests/Test.h"
#include "tools/Resources.h"
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <regex>
#include <string>
#include <string_view>
#include <vector>

Go to the source code of this file.

Classes

struct  UniformData
 

Namespaces

namespace  SkSL
 

Macros

#define ADRENO   "Adreno \\‍(TM\\) "
 
#define NVIDIA   "(Tegra|Quadro|RTX|GTX) "
 
#define DEF_GANESH_SKSL_TEST(flags, ctsEnforcement, name, path)   /* Ganesh is disabled */
 
#define DEF_GRAPHITE_SKSL_TEST(flags, ctsEnforcement, name, path)   /* Graphite is disabled */
 
#define SKSL_TEST(flags, ctsEnforcement, name, path)
 

Typedefs

using SkSLTestFlags = SkEnumBitMask< SkSLTestFlag >
 

Enumerations

enum class  SkSLTestFlag : int {
  CPU = 1 << 0 , ES3 = 1 << 1 , GPU = 1 << 2 , GPU_ES3 = 1 << 3 ,
  UsesNaN = 1 << 4
}
 

Functions

static constexpr bool is_cpu (SkSLTestFlags flags)
 
static constexpr bool is_gpu (SkSLTestFlags flags)
 
static constexpr bool is_strict_es2 (SkSLTestFlags flags)
 
static SkBitmap bitmap_from_shader (skiatest::Reporter *r, SkSurface *surface, sk_sp< SkRuntimeEffect > effect)
 
static bool gpu_generates_nan (skiatest::Reporter *r, GrDirectContext *ctx)
 
static SkString load_source (skiatest::Reporter *r, const char *testFile, const char *permutationSuffix)
 
static bool failure_is_expected (std::string_view deviceName, std::string_view backendAPI, std::string_view name, skiatest::TestType testType)
 
static void test_one_permutation (skiatest::Reporter *r, std::string_view deviceName, std::string_view backendAPI, SkSurface *surface, const char *name, const char *testFile, skiatest::TestType testType, const char *permutationSuffix, const SkRuntimeEffect::Options &options)
 
static void test_permutations (skiatest::Reporter *r, std::string_view deviceName, std::string_view backendAPI, SkSurface *surface, const char *name, const char *testFile, skiatest::TestType testType, bool strictES2)
 
static void test_cpu (skiatest::Reporter *r, const char *name, const char *testFile, SkSLTestFlags flags)
 
static void test_clone (skiatest::Reporter *r, const char *testFile, SkSLTestFlags flags)
 
static void report_rp_pass (skiatest::Reporter *r, const char *testFile, SkSLTestFlags flags)
 
static void report_rp_fail (skiatest::Reporter *r, const char *testFile, SkSLTestFlags flags, const char *reason)
 
static void test_raster_pipeline (skiatest::Reporter *r, const char *testFile, SkSLTestFlags flags)
 

Variables

static constexpr int kWidth = 2
 
static constexpr int kHeight = 2
 
static constexpr float kUniformColorBlack [] = {0.0f, 0.0f, 0.0f, 1.0f}
 
static constexpr float kUniformColorRed [] = {1.0f, 0.0f, 0.0f, 1.0f}
 
static constexpr float kUniformColorGreen [] = {0.0f, 1.0f, 0.0f, 1.0f}
 
static constexpr float kUniformColorBlue [] = {0.0f, 0.0f, 1.0f, 1.0f}
 
static constexpr float kUniformColorWhite [] = {1.0f, 1.0f, 1.0f, 1.0f}
 
static constexpr float kUniformTestInputs [] = {-1.25f, 0.0f, 0.75f, 2.25f}
 
static constexpr float kUniformUnknownInput [] = {1.0f}
 
static constexpr float kUniformTestMatrix2x2 []
 
static constexpr float kUniformTestMatrix3x3 []
 
static constexpr float kUniformTestMatrix4x4 []
 
static constexpr float kUniformTestArray [] = {1, 2, 3, 4, 5}
 
static constexpr float kUniformTestArrayNegative [] = {-1, -2, -3, -4, -5}
 
static constexpr UniformData kUniformData []
 
constexpr SkSLTestFlags CPU = SkSLTestFlag::CPU
 
constexpr SkSLTestFlags ES3 = SkSLTestFlag::ES3
 
constexpr SkSLTestFlags GPU = SkSLTestFlag::GPU
 
constexpr SkSLTestFlags GPU_ES3 = SkSLTestFlag::GPU_ES3
 
constexpr SkSLTestFlags UsesNaN = SkSLTestFlag::UsesNaN
 
constexpr auto kApiLevel_T = CtsEnforcement::kApiLevel_T
 
constexpr auto kApiLevel_U = CtsEnforcement::kApiLevel_U
 
constexpr auto kApiLevel_V = CtsEnforcement::kApiLevel_V
 
constexpr auto kNever = CtsEnforcement::kNever
 
constexpr auto kNextRelease = CtsEnforcement::kNextRelease
 

Macro Definition Documentation

◆ ADRENO

#define ADRENO   "Adreno \\‍(TM\\) "

◆ DEF_GANESH_SKSL_TEST

#define DEF_GANESH_SKSL_TEST (   flags,
  ctsEnforcement,
  name,
  path 
)    /* Ganesh is disabled */

Definition at line 911 of file SkSLTest.cpp.

◆ DEF_GRAPHITE_SKSL_TEST

#define DEF_GRAPHITE_SKSL_TEST (   flags,
  ctsEnforcement,
  name,
  path 
)    /* Graphite is disabled */

Definition at line 931 of file SkSLTest.cpp.

◆ NVIDIA

#define NVIDIA   "(Tegra|Quadro|RTX|GTX) "

◆ SKSL_TEST

#define SKSL_TEST (   flags,
  ctsEnforcement,
  name,
  path 
)
Value:
DEF_TEST(SkSL##name##_RP, r) { test_raster_pipeline(r, path, flags); } \
DEF_TEST(SkSL##name##_Clone, r) { test_clone(r, path, flags); } \
DEF_GANESH_SKSL_TEST(flags, ctsEnforcement, name, path) \
DEF_GRAPHITE_SKSL_TEST(flags, std::max(kApiLevel_V, ctsEnforcement), name, path)
static void test_clone(skiatest::Reporter *r, const char *testFile, SkSLTestFlags flags)
Definition: SkSLTest.cpp:740
static void test_cpu(skiatest::Reporter *r, const char *name, const char *testFile, SkSLTestFlags flags)
Definition: SkSLTest.cpp:637
constexpr auto kApiLevel_V
Definition: SkSLTest.cpp:962
static void test_raster_pipeline(skiatest::Reporter *r, const char *testFile, SkSLTestFlags flags)
Definition: SkSLTest.cpp:795
static constexpr bool is_cpu(SkSLTestFlags flags)
Definition: SkSLTest.cpp:112
#define DEF_CONDITIONAL_TEST(name, reporter, condition)
Definition: Test.h:307
FlutterSemanticsFlag flags
static float max(float r, float g, float b)
Definition: hsl.cpp:49
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

Definition at line 934 of file SkSLTest.cpp.

Typedef Documentation

◆ SkSLTestFlags

Definition at line 110 of file SkSLTest.cpp.

Enumeration Type Documentation

◆ SkSLTestFlag

enum class SkSLTestFlag : int
strong
Enumerator
CPU 

CPU tests must pass when painted to a CPU-backed surface via SkRuntimeEffect.

ES3 

ES3 tests must pass when executed directly on the CPU via the SkRasterPipeline backend. They aren't compatible with SkRuntimeEffect, since they use non-ES2 features.

GPU 

GPU tests must pass when painted to a GPU-backed surface via SkRuntimeEffect.

GPU_ES3 

GPU_ES3 tests must pass on ES3-compatible GPUs when "enforce ES2 restrictions" is off.

UsesNaN 

UsesNaN tests rely on NaN values, so they are only expected to pass on GPUs that generate them (which is not a requirement, even with ES3).

Definition at line 87 of file SkSLTest.cpp.

87 : int {
88 /** `CPU` tests must pass when painted to a CPU-backed surface via SkRuntimeEffect. */
89 CPU = 1 << 0,
90
91 /**
92 * `ES3` tests must pass when executed directly on the CPU via the SkRasterPipeline backend.
93 * They aren't compatible with SkRuntimeEffect, since they use non-ES2 features.
94 */
95 ES3 = 1 << 1,
96
97 /** `GPU` tests must pass when painted to a GPU-backed surface via SkRuntimeEffect. */
98 GPU = 1 << 2,
99
100 /** `GPU_ES3` tests must pass on ES3-compatible GPUs when "enforce ES2 restrictions" is off. */
101 GPU_ES3 = 1 << 3,
102
103 /**
104 * `UsesNaN` tests rely on NaN values, so they are only expected to pass on GPUs that generate
105 * them (which is not a requirement, even with ES3).
106 */
107 UsesNaN = 1 << 4,
108};
constexpr SkSLTestFlags CPU
Definition: SkSLTest.cpp:955
constexpr SkSLTestFlags ES3
Definition: SkSLTest.cpp:956
constexpr SkSLTestFlags UsesNaN
Definition: SkSLTest.cpp:959
constexpr SkSLTestFlags GPU
Definition: SkSLTest.cpp:957
constexpr SkSLTestFlags GPU_ES3
Definition: SkSLTest.cpp:958

Function Documentation

◆ bitmap_from_shader()

static SkBitmap bitmap_from_shader ( skiatest::Reporter r,
SkSurface surface,
sk_sp< SkRuntimeEffect effect 
)
static

Definition at line 163 of file SkSLTest.cpp.

165 {
166
168 for (const UniformData& data : kUniformData) {
170 if (uniform.fVar) {
171 uniform.set(data.span.data(), data.span.size());
172 }
173 }
174
175 sk_sp<SkShader> shader = builder.makeShader();
176 if (!shader) {
177 return SkBitmap{};
178 }
179
180 surface->getCanvas()->clear(SK_ColorBLACK);
181
182 SkPaint paintShader;
183 paintShader.setShader(shader);
184 surface->getCanvas()->drawRect(SkRect::MakeWH(kWidth, kHeight), paintShader);
185
187 REPORTER_ASSERT(r, bitmap.tryAllocPixels(surface->imageInfo()));
188 REPORTER_ASSERT(r, surface->readPixels(bitmap, /*srcX=*/0, /*srcY=*/0));
189 return bitmap;
190}
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
static constexpr int kWidth
Definition: SkSLTest.cpp:84
static constexpr UniformData kUniformData[]
Definition: SkSLTest.cpp:148
static constexpr int kHeight
Definition: SkSLTest.cpp:85
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286
void setShader(sk_sp< SkShader > shader)
VkSurfaceKHR surface
Definition: main.cc:49
Definition: bitmap.py:1
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609
const SkRuntimeEffect::Uniform * fVar
bool set(const T val[], const int count)
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ failure_is_expected()

static bool failure_is_expected ( std::string_view  deviceName,
std::string_view  backendAPI,
std::string_view  name,
skiatest::TestType  testType 
)
static

Definition at line 238 of file SkSLTest.cpp.

241 { // skiatest::TestType::kGraphite
242 enum TestTypeMatcher { CPU, Ganesh, Graphite, GPU /* either Ganesh or Graphite */ };
243
244 struct TestDisable {
245 std::optional<std::regex> deviceName;
246 std::optional<std::string_view> backendAPI;
247 std::optional<TestTypeMatcher> testTypeMatcher;
248 std::optional<bool> platform;
249 };
250
252
253 // TODO(b/40044139): migrate test-disable list from dm_flags into this map
254 static SkNoDestructor<TestDisableMap> testDisableMap{[] {
255 #define ADRENO "Adreno \\(TM\\) "
256 #define NVIDIA "(Tegra|Quadro|RTX|GTX) "
257
258 TestDisableMap disables;
259 constexpr std::nullopt_t _ = std::nullopt;
260 using regex = std::regex;
261
262#if defined(SK_BUILD_FOR_UNIX)
263 constexpr bool kLinux = true;
264#else
265 constexpr bool kLinux = false;
266#endif
267#if defined(SK_BUILD_FOR_MAC)
268 constexpr bool kMac = true;
269#else
270 constexpr bool kMac = false;
271#endif
272#if defined(SK_BUILD_FOR_IOS)
273 constexpr bool kiOS = true;
274#else
275 constexpr bool kiOS = false;
276#endif
277#if defined(SK_BUILD_FOR_WIN)
278 constexpr bool kWindows = true;
279#else
280 constexpr bool kWindows = false;
281#endif
282#if defined(SK_BUILD_FOR_ANDROID)
283 constexpr bool kAndroid = true;
284#else
285 constexpr bool kAndroid = false;
286#endif
287
288 // - Apple --------------------------------------------------------------------------------
289 // MacOS/iOS do not handle short-circuit evaluation properly in OpenGL (chromium:307751)
290 for (const char* test : {"LogicalAndShortCircuit",
291 "LogicalOrShortCircuit"}) {
292 disables[test].push_back({_, "OpenGL", GPU, kMac || kiOS});
293 }
294
295 // ANGLE has a handful of Mac-specific bugs.
296 for (const char* test : {"MatrixScalarNoOpFolding", // anglebug.com/7525
297 "MatrixScalarMath", // anglebug.com/7525
298 "SwizzleIndexStore", // Apple bug FB12055941
299 "OutParamsAreDistinctFromGlobal", // anglebug.com/7145
300 "IntrinsicMixFloatES3"}) { // anglebug.com/7245
301 disables[test].push_back({_, "ANGLE", GPU, kMac});
302 }
303
304 // Switch fallthrough has some issues on iOS.
305 for (const char* test : {"SwitchWithFallthrough",
306 "SwitchWithFallthroughGroups"}) {
307 disables[test].push_back({_, "OpenGL", GPU, kiOS});
308 }
309
310 // - ARM ----------------------------------------------------------------------------------
311 // Mali 400 is a very old driver its share of quirks, particularly in relation to matrices.
312 for (const char* test : {"Matrices", // b/40043539
313 "MatrixNoOpFolding",
314 "MatrixScalarMath", // b/40043764
315 "MatrixSwizzleStore",
316 "MatrixScalarNoOpFolding", // b/40044644
317 "UnaryPositiveNegative",
318 "Cross"}) {
319 disables[test].push_back({regex("Mali-400"), _, GPU, _});
320 }
321
322 // - Nvidia -------------------------------------------------------------------------------
323 // Tegra3 has several issues, but the inability to break from a for loop is a common theme.
324 for (const char* test : {"Switch", // b/40043561
325 "SwitchDefaultOnly", // " "
326 "SwitchWithFallthrough", // " "
327 "SwitchWithFallthroughAndVarDecls", // " "
328 "SwitchWithFallthroughGroups", // " "
329 "SwitchWithLoops", // " "
330 "SwitchCaseFolding", // " "
331 "LoopFloat", // " "
332 "LoopInt", // " "
333 "MatrixScalarNoOpFolding", // b/40044644
334 "MatrixScalarMath", // b/40043764
335 "MatrixFoldingES2", // b/40043017
336 "MatrixEquality", // b/40043017
337 "IntrinsicFract",
338 "ModifiedStructParametersCannotBeInlined"}) {
339 disables[test].push_back({regex("Tegra 3"), _, GPU, _});
340 }
341
342 // Various Nvidia GPUs generate errors when assembling weird matrices, and erroneously
343 // constant-fold expressions with side-effects in constructors when compiling GLSL.
344 for (const char* test : {"MatrixConstructorsES2", // b/40043524
345 "MatrixConstructorsES3", // b/40043524
346 "MatrixScalarNoOpFolding", // b/40044644
347 "PreserveSideEffects", // b/40044140
348 "StructFieldNoFolding"}) { // b/40044479
349 disables[test].push_back({regex(NVIDIA), "OpenGL", _, _});
350 disables[test].push_back({regex(NVIDIA), "ANGLE GL", _, _});
351 }
352
353 disables["IntrinsicMixFloatES3"].push_back({regex("RTX "), "Vulkan", _, kWindows});
354
355 // The Golo features P400s with older and buggier drivers than usual.
356 for (const char* test : {"PreserveSideEffects", // b/40044140
357 "CommaSideEffects"}) {
358 disables[test].push_back({regex("Quadro P400"), _, _, kLinux});
359 }
360
361 // b/318725123
362 for (const char* test : {"UniformArray",
363 "TemporaryIndexLookup",
364 "MatrixIndexLookup"}) {
365 disables[test].push_back({regex("Quadro P400"), "Dawn Vulkan", Graphite, kWindows});
366 }
367
368 // - PowerVR ------------------------------------------------------------------------------
369 for (const char* test : {"OutParamsAreDistinct", // b/40044222
370 "OutParamsAreDistinctFromGlobal"}) {
371 disables[test].push_back({regex("PowerVR Rogue GE8300"), _, GPU, _});
372 }
373
374 // - Radeon -------------------------------------------------------------------------------
375 for (const char* test : {"DeadReturnES3", // b/301326132
376 "IntrinsicAll", // b/40045114
377 "MatrixConstructorsES3", // b/40043524
378 "MatrixScalarNoOpFolding", // b/40044644
379 "StructIndexStore", // b/40045236
380 "SwizzleIndexLookup", // b/40045254
381 "SwizzleIndexStore"}) { // b/40045254
382 disables[test].push_back({regex("Radeon.*(R9|HD)"), "OpenGL", GPU, _});
383 disables[test].push_back({regex("Radeon.*(R9|HD)"), "ANGLE GL", GPU, _});
384 }
385
386 // The Radeon Vega 6 doesn't return zero for the derivative of a uniform.
387 for (const char* test : {"IntrinsicDFdy",
388 "IntrinsicDFdx",
389 "IntrinsicFwidth"}) {
390 disables[test].push_back({regex("AMD RADV RENOIR"), _, GPU, _});
391 }
392
393 // - Adreno -------------------------------------------------------------------------------
394 // Disable broken tests on Android with Adreno GPUs (b/40043413, b/40045254)
395 for (const char* test : {"ArrayCast",
396 "ArrayComparison",
397 "CommaSideEffects",
398 "IntrinsicMixFloatES2",
399 "IntrinsicClampFloat",
400 "SwitchWithFallthrough",
401 "SwitchWithFallthroughGroups",
402 "SwizzleIndexLookup",
403 "SwizzleIndexStore"}) {
404 disables[test].push_back({regex(ADRENO "[3456]"), _, _, kAndroid});
405 }
406
407 // Older Adreno 5/6xx drivers report a pipeline error or silently fail when handling inouts.
408 for (const char* test : {"VoidInSequenceExpressions", // b/295217166
409 "InoutParameters", // b/40043966
410 "OutParams",
411 "OutParamsDoubleSwizzle",
412 "OutParamsNoInline",
413 "OutParamsFunctionCallInArgument"}) {
414 disables[test].push_back({regex(ADRENO "[56]"), "Vulkan", _, kAndroid});
415 }
416
417 for (const char* test : {"MatrixToVectorCast", // b/40043288
418 "StructsInFunctions"}) { // b/40043024
419 disables[test].push_back({regex(ADRENO "[345]"), "OpenGL", _, kAndroid});
420 }
421
422 // Constructing a matrix from vectors and scalars can be surprisingly finicky (b/40043539)
423 for (const char* test : {"Matrices",
424 "MatrixNoOpFolding"}) {
425 disables[test].push_back({regex(ADRENO "3"), "OpenGL", _, kAndroid});
426 }
427
428 // Adreno 600 doesn't handle isinf() in OpenGL correctly. (b/40043464)
429 disables["IntrinsicIsInf"].push_back({regex(ADRENO "6"), "OpenGL", _, kAndroid});
430
431 // Older Adreno drivers crash when presented with an empty block (b/40044390)
432 disables["EmptyBlocksES3"].push_back({regex(ADRENO "(540|630)"), _, _, kAndroid});
433
434 // Adrenos alias out-params to globals improperly (b/40044222)
435 disables["OutParamsAreDistinctFromGlobal"].push_back({regex(ADRENO "[3456]"), "OpenGL",
436 _, kAndroid});
437 // Adreno generates the wrong result for this test. (b/40044477)
438 disables["StructFieldFolding"].push_back({regex(ADRENO "[56]"), "OpenGL",
439 _, kAndroid});
440
441 // b/318726662
442 for (const char* test : {"PrefixExpressionsES2",
443 "MatrixToVectorCast",
444 "MatrixConstructorsES2"}) {
445 disables[test].push_back({regex(ADRENO "620"), "Vulkan", Graphite, kAndroid});
446 }
447
448 // - Intel --------------------------------------------------------------------------------
449 // Disable various tests on Intel.
450 // Intrinsic floor() on Intel + ANGLE + DirectX is broken (anglebug.com/5588)
451 disables["IntrinsicFloor"].push_back({regex("Intel.*(Iris|HD)"), "ANGLE D3D", _, _});
452
453 // Intrinsic not() and mix() are broken on Intel GPUs in Metal. (b/40045105)
454 for (const char* test : {"IntrinsicNot",
455 "IntrinsicMixFloatES3"}) {
456 disables[test].push_back({regex("Intel.*(Iris|6000)"), "Metal", _, kMac});
457 }
458
459 // Swizzled-index store is broken across many Intel GPUs. (b/40045254)
460 disables["SwizzleIndexStore"].push_back({regex("Intel"), "OpenGL", _, kMac});
461 disables["SwizzleIndexStore"].push_back({regex("Intel.*Iris"), _, _, kWindows});
462
463 // vec4(mat2) conversions can lead to a crash on Intel + ANGLE (b/40043275)
464 for (const char* test : {"VectorToMatrixCast",
465 "VectorScalarMath",
466 "TrivialArgumentsInlineDirectly"}) {
467 disables[test].push_back({regex("Intel"), "ANGLE", _, kWindows});
468 }
469
470 for (const char* test : {"MatrixFoldingES2",
471 "MatrixEquality",
472 "TemporaryIndexLookup", // b/40045228
473 "SwizzleIndexLookup"}) { // b/40045254
474 disables[test].push_back({regex("Intel.*(Iris|4400)"), "OpenGL", _, kWindows});
475 disables[test].push_back({regex("Intel.*(Iris|4400)"), "ANGLE", _, kWindows});
476 }
477
478 for (const char* test : {"ReturnsValueOnEveryPathES3", // b/40043548
479 "OutParamsAreDistinctFromGlobal", // b/40044222
480 "StructFieldFolding"}) { // b/40044477
481 disables[test].push_back({regex("Intel"), "OpenGL", _, kWindows});
482 disables[test].push_back({regex("Intel"), "ANGLE GL", _, kWindows});
483 }
484
485 for (const char* test : {"SwitchDefaultOnly", // b/40043548
486 "ReturnsValueOnEveryPathES3"}) { // b/40045205
487 disables[test].push_back({regex("Intel"), "Vulkan", _, kLinux});
488 }
489
490 for (const char* test : {"SwitchDefaultOnly"}) {
491 disables[test].push_back({regex("Intel"), "ANGLE", _, kWindows});
492 }
493
494 for (const char* test : {"SwizzleAsLValueES3"}) { // https://anglebug.com/8260
495 disables[test].push_back({regex("Intel"), _, _, kWindows});
496 disables[test].push_back({_, "ANGLE", _, kWindows});
497 }
498
499 // Some Intel GPUs don't return zero for the derivative of a uniform.
500 for (const char* test : {"IntrinsicDFdy",
501 "IntrinsicDFdx",
502 "IntrinsicFwidth"}) {
503 disables[test].push_back({regex("Intel"), _, GPU, _});
504 }
505
506 disables["LoopFloat"].push_back({regex("Intel.*(Iris|6000)"), _, _, kMac}); // b/40043507
507
508 #undef ADRENO
509 #undef NVIDIA
510
511 return disables;
512 }()};
513
514 if (const std::vector<TestDisable>* testDisables = testDisableMap->find(name)) {
515 for (const TestDisable& d : *testDisables) {
516 if (d.platform.has_value() && !*d.platform) {
517 continue; // disable applies to a different platform
518 }
519 if (d.backendAPI.has_value() && !skstd::contains(backendAPI, *d.backendAPI)) {
520 continue; // disable applies to a different backend API
521 }
522 if (d.deviceName.has_value() &&
523 !std::regex_search(deviceName.begin(), deviceName.end(), *d.deviceName)) {
524 continue; // disable applies to a different device
525 }
526 if (d.testTypeMatcher == CPU && testType != skiatest::TestType::kCPU) {
527 continue; // disable only applies to CPU
528 }
529 if (d.testTypeMatcher == Ganesh && testType != skiatest::TestType::kGanesh) {
530 continue; // disable only applies to Ganesh
531 }
532 if (d.testTypeMatcher == Graphite && testType != skiatest::TestType::kGraphite) {
533 continue; // disable only applies to Graphites
534 }
535 if (d.testTypeMatcher == GPU && testType == skiatest::TestType::kCPU) {
536 continue; // disable only applies to GPU
537 }
538 // This test was disabled.
539 return true;
540 }
541 }
542
543 // This test was not in our disable list.
544 return false;
545}
#define test(name)
#define ADRENO
#define NVIDIA
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
constexpr bool contains(std::string_view str, std::string_view needle)
Definition: SkStringView.h:41

◆ gpu_generates_nan()

static bool gpu_generates_nan ( skiatest::Reporter r,
GrDirectContext ctx 
)
static

Definition at line 192 of file SkSLTest.cpp.

192 {
193#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
194 // The Metal shader compiler (which is also used under-the-hood for some GL/GLES contexts on
195 // these platforms) enables fast-math by default. That prevents NaN-based tests from passing:
196 // https://developer.apple.com/documentation/metal/mtlcompileoptions/1515914-fastmathenabled
197 return false;
198#else
199 // If we don't have infinity support, we definitely won't generate NaNs
200 if (!ctx->priv().caps()->shaderCaps()->fInfinitySupport) {
201 return false;
202 }
203
205 #version 300
206 uniform half4 colorGreen, colorRed;
207
208 half4 main(float2 xy) {
209 return isnan(colorGreen.r / colorGreen.b) ? colorGreen : colorRed;
210 }
211 )")).effect;
212 REPORTER_ASSERT(r, effect);
213
216
217 SkBitmap bitmap = bitmap_from_shader(r, surface.get(), effect);
218 REPORTER_ASSERT(r, !bitmap.empty());
219
220 SkColor color = bitmap.getColor(0, 0);
222 return color == SK_ColorGREEN;
223#endif
224}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
uint32_t SkColor
Definition: SkColor.h:37
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
static SkBitmap bitmap_from_shader(skiatest::Reporter *r, SkSurface *surface, sk_sp< SkRuntimeEffect > effect)
Definition: SkSLTest.cpp:163
const GrCaps * caps() const
const GrShaderCaps * shaderCaps() const
Definition: GrCaps.h:63
GrDirectContextPriv priv()
static Result MakeForShader(SkString sksl, const Options &)
DlColor color
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
static SkImageInfo MakeN32Premul(int width, int height)
sk_sp< SkRuntimeEffect > effect
bool fInfinitySupport
Definition: SkSLUtil.h:103

◆ is_cpu()

static constexpr bool is_cpu ( SkSLTestFlags  flags)
staticconstexpr

Definition at line 112 of file SkSLTest.cpp.

112 {
114}
static constexpr bool SkToBool(const T &x)
Definition: SkTo.h:35

◆ is_gpu()

static constexpr bool is_gpu ( SkSLTestFlags  flags)
staticconstexpr

Definition at line 116 of file SkSLTest.cpp.

◆ is_strict_es2()

static constexpr bool is_strict_es2 ( SkSLTestFlags  flags)
staticconstexpr

Definition at line 120 of file SkSLTest.cpp.

120 {
122}

◆ load_source()

static SkString load_source ( skiatest::Reporter r,
const char *  testFile,
const char *  permutationSuffix 
)
static

Definition at line 226 of file SkSLTest.cpp.

228 {
229 SkString resourcePath = SkStringPrintf("sksl/%s", testFile);
230 sk_sp<SkData> shaderData = GetResourceAsData(resourcePath.c_str());
231 if (!shaderData) {
232 ERRORF(r, "%s%s: Unable to load file", testFile, permutationSuffix);
233 return SkString("");
234 }
235 return SkString{reinterpret_cast<const char*>(shaderData->bytes()), shaderData->size()};
236}
sk_sp< SkData > GetResourceAsData(const char *resource)
Definition: Resources.cpp:42
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
#define ERRORF(r,...)
Definition: Test.h:293
const uint8_t * bytes() const
Definition: SkData.h:43
size_t size() const
Definition: SkData.h:30
const char * c_str() const
Definition: SkString.h:133

◆ report_rp_fail()

static void report_rp_fail ( skiatest::Reporter r,
const char *  testFile,
SkSLTestFlags  flags,
const char *  reason 
)
static

Definition at line 786 of file SkSLTest.cpp.

789 {
791 ERRORF(r, "%s: %s", testFile, reason);
792 }
793}

◆ report_rp_pass()

static void report_rp_pass ( skiatest::Reporter r,
const char *  testFile,
SkSLTestFlags  flags 
)
static

Definition at line 780 of file SkSLTest.cpp.

780 {
782 ERRORF(r, "NEW: %s", testFile);
783 }
784}

◆ test_clone()

static void test_clone ( skiatest::Reporter r,
const char *  testFile,
SkSLTestFlags  flags 
)
static

Definition at line 740 of file SkSLTest.cpp.

740 {
741 SkString shaderString = load_source(r, testFile, "");
742 if (shaderString.isEmpty()) {
743 return;
744 }
746 // TODO(skia:11209): Can we just put the correct #version in the source files that need this?
749 std::unique_ptr<SkSL::Program> program = compiler.convertProgram(
751 if (!program) {
752 ERRORF(r, "%s", compiler.errorText().c_str());
753 return;
754 }
755
756 // Clone every expression in the program, and ensure that its clone generates the same
757 // description as the original.
758 class CloneVisitor : public SkSL::ProgramVisitor {
759 public:
760 CloneVisitor(skiatest::Reporter* r) : fReporter(r) {}
761
762 bool visitExpression(const SkSL::Expression& expr) override {
763 std::string original = expr.description();
764 std::string cloned = expr.clone()->description();
765 REPORTER_ASSERT(fReporter, original == cloned,
766 "Mismatch after clone!\nOriginal: %s\nCloned: %s\n",
767 original.c_str(), cloned.c_str());
768
769 return INHERITED::visitExpression(expr);
770 }
771
772 skiatest::Reporter* fReporter;
773
774 using INHERITED = ProgramVisitor;
775 };
776
777 CloneVisitor{r}.visit(*program);
778}
#define INHERITED(method,...)
Definition: SkRecorder.cpp:128
static constexpr bool is_strict_es2(SkSLTestFlags flags)
Definition: SkSLTest.cpp:120
static SkString load_source(skiatest::Reporter *r, const char *testFile, const char *permutationSuffix)
Definition: SkSLTest.cpp:226
virtual std::unique_ptr< Expression > clone(Position pos) const =0
std::string description() const final
virtual bool visitExpression(typename T::Expression &expression)
bool isEmpty() const
Definition: SkString.h:130
compiler
Definition: malisc.py:17

◆ test_cpu()

static void test_cpu ( skiatest::Reporter r,
const char *  name,
const char *  testFile,
SkSLTestFlags  flags 
)
static

Definition at line 637 of file SkSLTest.cpp.

640 {
642
643 // Create a raster-backed surface.
646
647 test_permutations(r, "CPU", "SkRP", surface.get(), name, testFile,
648 skiatest::TestType::kCPU, /*strictES2=*/true);
649}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static void test_permutations(skiatest::Reporter *r, std::string_view deviceName, std::string_view backendAPI, SkSurface *surface, const char *name, const char *testFile, skiatest::TestType testType, bool strictES2)
Definition: SkSLTest.cpp:619
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)

◆ test_one_permutation()

static void test_one_permutation ( skiatest::Reporter r,
std::string_view  deviceName,
std::string_view  backendAPI,
SkSurface surface,
const char *  name,
const char *  testFile,
skiatest::TestType  testType,
const char *  permutationSuffix,
const SkRuntimeEffect::Options options 
)
static

Definition at line 547 of file SkSLTest.cpp.

555 {
556 SkString shaderString = load_source(r, testFile, permutationSuffix);
557 if (shaderString.isEmpty()) {
558 return;
559 }
561 if (!result.effect) {
562 ERRORF(r, "%s%s: %s", testFile, permutationSuffix, result.errorText.c_str());
563 return;
564 }
565 if (failure_is_expected(deviceName, backendAPI, name, testType)) {
566 // Some driver bugs can be catastrophic (e.g. crashing dm entirely), so we don't even try to
567 // run a shader if we expect that it might fail.
568 SkDebugf("%s: skipped %.*s%s\n", testFile, (int)backendAPI.size(), backendAPI.data(),
569 permutationSuffix);
570 return;
571 }
572
574 if (bitmap.empty()) {
575 ERRORF(r, "%s%s: Unable to build shader", testFile, permutationSuffix);
576 return;
577 }
578
579 bool success = true;
581 for (int y = 0; y < kHeight; ++y) {
582 for (int x = 0; x < kWidth; ++x) {
583 color[y][x] = bitmap.getColor(x, y);
584 if (color[y][x] != SK_ColorGREEN) {
585 success = false;
586 }
587 }
588 }
589
590 if (!success) {
591 static_assert(kWidth == 2);
592 static_assert(kHeight == 2);
593
594 SkString message = SkStringPrintf("Expected%s: solid green. Actual output from %.*s using "
595 "%.*s:\n"
596 "RRGGBBAA RRGGBBAA\n"
597 "%02X%02X%02X%02X %02X%02X%02X%02X\n"
598 "%02X%02X%02X%02X %02X%02X%02X%02X",
599 permutationSuffix,
600 (int)deviceName.size(), deviceName.data(),
601 (int)backendAPI.size(), backendAPI.data(),
602
603 SkColorGetR(color[0][0]), SkColorGetG(color[0][0]),
604 SkColorGetB(color[0][0]), SkColorGetA(color[0][0]),
605
606 SkColorGetR(color[0][1]), SkColorGetG(color[0][1]),
607 SkColorGetB(color[0][1]), SkColorGetA(color[0][1]),
608
609 SkColorGetR(color[1][0]), SkColorGetG(color[1][0]),
610 SkColorGetB(color[1][0]), SkColorGetA(color[1][0]),
611
612 SkColorGetR(color[1][1]), SkColorGetG(color[1][1]),
613 SkColorGetB(color[1][1]), SkColorGetA(color[1][1]));
614
615 ERRORF(r, "%s", message.c_str());
616 }
617}
const char * options
#define SkColorGetR(color)
Definition: SkColor.h:65
#define SkColorGetG(color)
Definition: SkColor.h:69
#define SkColorGetA(color)
Definition: SkColor.h:61
#define SkColorGetB(color)
Definition: SkColor.h:73
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static bool failure_is_expected(std::string_view deviceName, std::string_view backendAPI, std::string_view name, skiatest::TestType testType)
Definition: SkSLTest.cpp:238
GAsyncResult * result
Win32Message message
double y
double x

◆ test_permutations()

static void test_permutations ( skiatest::Reporter r,
std::string_view  deviceName,
std::string_view  backendAPI,
SkSurface surface,
const char *  name,
const char *  testFile,
skiatest::TestType  testType,
bool  strictES2 
)
static

Definition at line 619 of file SkSLTest.cpp.

626 {
629 options.forceUnoptimized = false;
630 test_one_permutation(r, deviceName, backendAPI, surface, name, testFile, testType, "", options);
631
632 options.forceUnoptimized = true;
633 test_one_permutation(r, deviceName, backendAPI, surface, name, testFile, testType,
634 " (Unoptimized)", options);
635}
static void test_one_permutation(skiatest::Reporter *r, std::string_view deviceName, std::string_view backendAPI, SkSurface *surface, const char *name, const char *testFile, skiatest::TestType testType, const char *permutationSuffix, const SkRuntimeEffect::Options &options)
Definition: SkSLTest.cpp:547
static SkRuntimeEffect::Options ES3Options()

◆ test_raster_pipeline()

static void test_raster_pipeline ( skiatest::Reporter r,
const char *  testFile,
SkSLTestFlags  flags 
)
static

Definition at line 795 of file SkSLTest.cpp.

797 {
798 SkString shaderString = load_source(r, testFile, "");
799 if (shaderString.isEmpty()) {
800 return;
801 }
802
803 // In Raster Pipeline, we can compile and run test shaders directly, without involving a surface
804 // at all.
807 settings.fMaxVersionAllowed = SkSL::Version::k300;
808 std::unique_ptr<SkSL::Program> program = compiler.convertProgram(
810 if (!program) {
811 ERRORF(r, "%s: Unexpected compilation error\n%s", testFile, compiler.errorText().c_str());
812 return;
813 }
814 const SkSL::FunctionDeclaration* main = program->getFunction("main");
815 if (!main) {
816 ERRORF(r, "%s: Program must have a 'main' function", testFile);
817 return;
818 }
819
820 // Match up uniforms from the program against our list of test uniforms, and build up a data
821 // buffer of uniform floats.
822 size_t offset = 0;
824 const SkSL::Context& ctx(compiler.context());
825
826 for (const SkSL::ProgramElement* elem : program->elements()) {
827 // Variables (uniform, etc.)
828 if (elem->is<SkSL::GlobalVarDeclaration>()) {
830 const SkSL::VarDeclaration& varDecl = global.declaration()->as<SkSL::VarDeclaration>();
831 const SkSL::Variable& var = *varDecl.var();
832
833 if (var.type().isEffectChild()) {
834 ERRORF(r, "%s: Test program cannot contain child effects", testFile);
835 return;
836 }
837 // 'uniform' variables
838 if (var.modifierFlags().isUniform()) {
840 }
841 }
842 }
843
844 TArray<float> uniformValues;
845 for (const SkRuntimeEffect::Uniform& programUniform : uniforms) {
846 bool foundMatch = false;
847 for (const UniformData& data : kUniformData) {
848 if (data.name == programUniform.name) {
849 SkASSERT(data.span.size() * sizeof(float) == programUniform.sizeInBytes());
850 foundMatch = true;
851 uniformValues.push_back_n(data.span.size(), data.span.data());
852 break;
853 }
854 }
855 if (!foundMatch) {
856 report_rp_fail(r, testFile, flags, "unsupported uniform");
857 return;
858 }
859 }
860
861 // Compile our program.
862 SkArenaAlloc alloc(/*firstHeapAllocation=*/1000);
863 SkRasterPipeline pipeline(&alloc);
864 SkSL::DebugTracePriv debugTrace;
865 std::unique_ptr<SkSL::RP::Program> rasterProg =
867 *main->definition(),
868 &debugTrace);
869 if (!rasterProg) {
870 report_rp_fail(r, testFile, flags, "code is not supported");
871 return;
872 }
873
874 // Append the SkSL program to the raster pipeline.
875 pipeline.appendConstantColor(&alloc, SkColors::kTransparent);
876 rasterProg->appendStages(&pipeline, &alloc, /*callbacks=*/nullptr, SkSpan(uniformValues));
877
878 // Move the float values from RGBA into an 8888 memory buffer.
881 pipeline.append(SkRasterPipelineOp::store_8888, &outCtx);
882 pipeline.run(0, 0, 1, 1);
883
884 // Make sure the first pixel (exclusively) of `out` is green. If the program compiled
885 // successfully, we expect it to run without error, and will assert if it doesn't.
886 uint32_t expected = 0xFF00FF00;
887 if (out[0] != expected) {
888 ERRORF(r, "%s: Raster Pipeline failed. Expected solid green, got ARGB:%02X%02X%02X%02X",
889 testFile,
890 (out[0] >> 24) & 0xFF,
891 (out[0] >> 16) & 0xFF,
892 (out[0] >> 8) & 0xFF,
893 out[0] & 0xFF);
894 return;
895 }
896
897 // Success!
898 report_rp_pass(r, testFile, flags);
899}
static constexpr int SkRasterPipeline_kMaxStride_highp
static void report_rp_pass(skiatest::Reporter *r, const char *testFile, SkSLTestFlags flags)
Definition: SkSLTest.cpp:780
static void report_rp_fail(skiatest::Reporter *r, const char *testFile, SkSLTestFlags flags, const char *reason)
Definition: SkSLTest.cpp:786
SkSpan(Container &&) -> SkSpan< std::remove_pointer_t< decltype(std::data(std::declval< Container >()))> >
static SkRuntimeEffect::Uniform VarAsUniform(const SkSL::Variable &, const SkSL::Context &, size_t *offset)
std::unique_ptr< Statement > & declaration()
const T & as() const
Definition: SkSLIRNode.h:133
T * push_back_n(int n)
Definition: SkTArray.h:267
constexpr SkColor4f kTransparent
Definition: SkColor.h:434
std::unique_ptr< RP::Program > MakeRasterPipelineProgram(const SkSL::Program &program, const FunctionDefinition &function, DebugTracePriv *debugTrace, bool writeTraceOps)
Definition: main.py:1
SeparatedVector2 offset

Variable Documentation

◆ CPU

constexpr SkSLTestFlags CPU = SkSLTestFlag::CPU
constexpr

Test flags:

  • CPU: this test should pass on the CPU backend
  • GPU: this test should pass on the Ganesh GPU backends
  • GPU_ES3: this test should pass on an ES3-compatible GPU when "enforce ES2 restrictions" is off

CtsEnforcement: Android CTS (go/wtf/cts) enforces that devices must pass this test at the given API level. CTS and Android SkQP builds should only run tests on devices greater than the provided API level, but other test binaries (dm/fm) should run every test, regardless of this value.

Definition at line 955 of file SkSLTest.cpp.

◆ ES3

constexpr SkSLTestFlags ES3 = SkSLTestFlag::ES3
constexpr

Definition at line 956 of file SkSLTest.cpp.

◆ GPU

constexpr SkSLTestFlags GPU = SkSLTestFlag::GPU
constexpr

Definition at line 957 of file SkSLTest.cpp.

◆ GPU_ES3

constexpr SkSLTestFlags GPU_ES3 = SkSLTestFlag::GPU_ES3
constexpr

Definition at line 958 of file SkSLTest.cpp.

◆ kApiLevel_T

constexpr auto kApiLevel_T = CtsEnforcement::kApiLevel_T
constexpr

Definition at line 960 of file SkSLTest.cpp.

◆ kApiLevel_U

constexpr auto kApiLevel_U = CtsEnforcement::kApiLevel_U
constexpr

Definition at line 961 of file SkSLTest.cpp.

◆ kApiLevel_V

constexpr auto kApiLevel_V = CtsEnforcement::kApiLevel_V
constexpr

Definition at line 962 of file SkSLTest.cpp.

◆ kHeight

constexpr int kHeight = 2
staticconstexpr

Definition at line 85 of file SkSLTest.cpp.

◆ kNever

constexpr auto kNever = CtsEnforcement::kNever
constexpr

Definition at line 963 of file SkSLTest.cpp.

◆ kNextRelease

constexpr auto kNextRelease = CtsEnforcement::kNextRelease
constexpr

Definition at line 964 of file SkSLTest.cpp.

◆ kUniformColorBlack

constexpr float kUniformColorBlack[] = {0.0f, 0.0f, 0.0f, 1.0f}
staticconstexpr

Definition at line 129 of file SkSLTest.cpp.

◆ kUniformColorBlue

constexpr float kUniformColorBlue[] = {0.0f, 0.0f, 1.0f, 1.0f}
staticconstexpr

Definition at line 132 of file SkSLTest.cpp.

◆ kUniformColorGreen

constexpr float kUniformColorGreen[] = {0.0f, 1.0f, 0.0f, 1.0f}
staticconstexpr

Definition at line 131 of file SkSLTest.cpp.

◆ kUniformColorRed

constexpr float kUniformColorRed[] = {1.0f, 0.0f, 0.0f, 1.0f}
staticconstexpr

Definition at line 130 of file SkSLTest.cpp.

◆ kUniformColorWhite

constexpr float kUniformColorWhite[] = {1.0f, 1.0f, 1.0f, 1.0f}
staticconstexpr

Definition at line 133 of file SkSLTest.cpp.

◆ kUniformData

constexpr UniformData kUniformData[]
staticconstexpr
Initial value:
= {
{"colorBlack", kUniformColorBlack},
{"colorRed", kUniformColorRed},
{"colorGreen", kUniformColorGreen},
{"colorBlue", kUniformColorBlue},
{"colorWhite", kUniformColorWhite},
{"testInputs", kUniformTestInputs},
{"unknownInput", kUniformUnknownInput},
{"testMatrix2x2", kUniformTestMatrix2x2},
{"testMatrix3x3", kUniformTestMatrix3x3},
{"testMatrix4x4", kUniformTestMatrix4x4},
{"testArray", kUniformTestArray},
{"testArrayNegative", kUniformTestArrayNegative},
}
static constexpr float kUniformTestMatrix3x3[]
Definition: SkSLTest.cpp:138
static constexpr float kUniformTestMatrix4x4[]
Definition: SkSLTest.cpp:141
static constexpr float kUniformColorGreen[]
Definition: SkSLTest.cpp:131
static constexpr float kUniformColorWhite[]
Definition: SkSLTest.cpp:133
static constexpr float kUniformTestArrayNegative[]
Definition: SkSLTest.cpp:146
static constexpr float kUniformColorBlack[]
Definition: SkSLTest.cpp:129
static constexpr float kUniformTestMatrix2x2[]
Definition: SkSLTest.cpp:136
static constexpr float kUniformTestInputs[]
Definition: SkSLTest.cpp:134
static constexpr float kUniformColorRed[]
Definition: SkSLTest.cpp:130
static constexpr float kUniformColorBlue[]
Definition: SkSLTest.cpp:132
static constexpr float kUniformTestArray[]
Definition: SkSLTest.cpp:145
static constexpr float kUniformUnknownInput[]
Definition: SkSLTest.cpp:135

Definition at line 148 of file SkSLTest.cpp.

◆ kUniformTestArray

constexpr float kUniformTestArray[] = {1, 2, 3, 4, 5}
staticconstexpr

Definition at line 145 of file SkSLTest.cpp.

◆ kUniformTestArrayNegative

constexpr float kUniformTestArrayNegative[] = {-1, -2, -3, -4, -5}
staticconstexpr

Definition at line 146 of file SkSLTest.cpp.

◆ kUniformTestInputs

constexpr float kUniformTestInputs[] = {-1.25f, 0.0f, 0.75f, 2.25f}
staticconstexpr

Definition at line 134 of file SkSLTest.cpp.

◆ kUniformTestMatrix2x2

constexpr float kUniformTestMatrix2x2[]
staticconstexpr
Initial value:
= {1.0f, 2.0f,
3.0f, 4.0f}

Definition at line 136 of file SkSLTest.cpp.

◆ kUniformTestMatrix3x3

constexpr float kUniformTestMatrix3x3[]
staticconstexpr
Initial value:
= {1.0f, 2.0f, 3.0f,
4.0f, 5.0f, 6.0f,
7.0f, 8.0f, 9.0f}

Definition at line 138 of file SkSLTest.cpp.

◆ kUniformTestMatrix4x4

constexpr float kUniformTestMatrix4x4[]
staticconstexpr
Initial value:
= {1.0f, 2.0f, 3.0f, 4.0f,
5.0f, 6.0f, 7.0f, 8.0f,
9.0f, 10.0f, 11.0f, 12.0f,
13.0f, 14.0f, 15.0f, 16.0f}

Definition at line 141 of file SkSLTest.cpp.

◆ kUniformUnknownInput

constexpr float kUniformUnknownInput[] = {1.0f}
staticconstexpr

Definition at line 135 of file SkSLTest.cpp.

◆ kWidth

constexpr int kWidth = 2
staticconstexpr

Definition at line 84 of file SkSLTest.cpp.

◆ UsesNaN

constexpr SkSLTestFlags UsesNaN = SkSLTestFlag::UsesNaN
constexpr

Definition at line 959 of file SkSLTest.cpp.