Enable DSL FP tests.

These new tests rely on compiled shaders that live in the
`tests/sksl/dslfp/` directory; this CL updates the Bazel and
emscripten build scripts to include these shaders.

Change-Id: Ib670682af8bf451a4473504dd4cc76a0e9222129
Bug: skia:11854
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400097
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This commit is contained in:
John Stiles 2021-04-22 16:08:32 -04:00 committed by Skia Commit-Bot
parent 82007f568d
commit abde8fc182
4 changed files with 40 additions and 3 deletions

View File

@ -54,6 +54,7 @@ tests_sources = [
"$_tests/CompressedBackendAllocationTest.cpp",
"$_tests/CopySurfaceTest.cpp",
"$_tests/CubicMapTest.cpp",
"$_tests/DSLFPTest.cpp",
"$_tests/DashPathEffectTest.cpp",
"$_tests/DataRefTest.cpp",
"$_tests/DebugLayerManagerTest.cpp",
@ -329,6 +330,20 @@ tests_sources = [
"$_tests/Writer32Test.cpp",
"$_tests/YUVCacheTest.cpp",
"$_tests/YUVTest.cpp",
"$_tests/sksl/dslfp/GrDSLFPTest_DoStatement.dsl.cpp",
"$_tests/sksl/dslfp/GrDSLFPTest_DoStatement.h",
"$_tests/sksl/dslfp/GrDSLFPTest_ForStatement.dsl.cpp",
"$_tests/sksl/dslfp/GrDSLFPTest_ForStatement.h",
"$_tests/sksl/dslfp/GrDSLFPTest_IfStatement.dsl.cpp",
"$_tests/sksl/dslfp/GrDSLFPTest_IfStatement.h",
"$_tests/sksl/dslfp/GrDSLFPTest_SwitchStatement.dsl.cpp",
"$_tests/sksl/dslfp/GrDSLFPTest_SwitchStatement.h",
"$_tests/sksl/dslfp/GrDSLFPTest_Swizzle.dsl.cpp",
"$_tests/sksl/dslfp/GrDSLFPTest_Swizzle.h",
"$_tests/sksl/dslfp/GrDSLFPTest_Ternary.dsl.cpp",
"$_tests/sksl/dslfp/GrDSLFPTest_Ternary.h",
"$_tests/sksl/dslfp/GrDSLFPTest_WhileStatement.dsl.cpp",
"$_tests/sksl/dslfp/GrDSLFPTest_WhileStatement.h",
]
gl_tests_sources = [

View File

@ -172,6 +172,17 @@ fi
GMS_TO_BUILD="gm/*.cpp"
TESTS_TO_BUILD="tests/*.cpp"
# DSL FP tests need to include compiled test shaders from the `dslfp` subdirectory.
TESTS_TO_BUILD+=\
" tests/sksl/dslfp/GrDSLFPTest_DoStatement.dsl.cpp"\
" tests/sksl/dslfp/GrDSLFPTest_ForStatement.dsl.cpp"\
" tests/sksl/dslfp/GrDSLFPTest_IfStatement.dsl.cpp"\
" tests/sksl/dslfp/GrDSLFPTest_SwitchStatement.dsl.cpp"\
" tests/sksl/dslfp/GrDSLFPTest_Swizzle.dsl.cpp"\
" tests/sksl/dslfp/GrDSLFPTest_Ternary.dsl.cpp"\
" tests/sksl/dslfp/GrDSLFPTest_WhileStatement.dsl.cpp"
# When developing locally, it can be faster to focus only on the gms or tests you care about
# (since they all have to be recompiled/relinked) every time. To do so, mark the following as true
if false; then

View File

@ -576,6 +576,20 @@ DM_SRCS_ALL = struct(
"src/xml/*.cpp",
"tests/*.cpp",
"tests/*.h",
"tests/sksl/dslfp/GrDSLFPTest_DoStatement.dsl.cpp",
"tests/sksl/dslfp/GrDSLFPTest_DoStatement.h",
"tests/sksl/dslfp/GrDSLFPTest_ForStatement.dsl.cpp",
"tests/sksl/dslfp/GrDSLFPTest_ForStatement.h",
"tests/sksl/dslfp/GrDSLFPTest_IfStatement.dsl.cpp",
"tests/sksl/dslfp/GrDSLFPTest_IfStatement.h",
"tests/sksl/dslfp/GrDSLFPTest_SwitchStatement.dsl.cpp",
"tests/sksl/dslfp/GrDSLFPTest_SwitchStatement.h",
"tests/sksl/dslfp/GrDSLFPTest_Swizzle.dsl.cpp",
"tests/sksl/dslfp/GrDSLFPTest_Swizzle.h",
"tests/sksl/dslfp/GrDSLFPTest_Ternary.dsl.cpp",
"tests/sksl/dslfp/GrDSLFPTest_Ternary.h",
"tests/sksl/dslfp/GrDSLFPTest_WhileStatement.dsl.cpp",
"tests/sksl/dslfp/GrDSLFPTest_WhileStatement.h",
"tools/AutoreleasePool.h",
"tools/BigPathBench.inc",
"tools/BinaryAsset.h",

View File

@ -4,7 +4,6 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#if 0 // TODO(skia:11854): enable tests in followup CL
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
@ -83,5 +82,3 @@ DSL_FP_TEST(DSLFPTest_DoStatement, /*shouldLoop:*/ false)
DSL_FP_TEST(DSLFPTest_ForStatement, /*colorWhite:*/ SkPMColor4f{1, 1, 1, 1})
DSL_FP_TEST(DSLFPTest_SwitchStatement)
DSL_FP_TEST(DSLFPTest_WhileStatement)
#endif