diff --git a/projects/skia/BUILD.gn.diff b/projects/skia/BUILD.gn.diff index d39e37ee0..101144228 100644 --- a/projects/skia/BUILD.gn.diff +++ b/projects/skia/BUILD.gn.diff @@ -376,3 +376,38 @@ test_app("image_decode_incremental") { ] } +test_app("sksl2glsl") { + sources = [ + "fuzz/Fuzz.cpp", + "fuzz/FuzzCommon.cpp", + "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp", + ] + deps = [ + ":gpu_tool_utils", + ":skia", + ] +} + +test_app("sksl2spirv") { + sources = [ + "fuzz/Fuzz.cpp", + "fuzz/FuzzCommon.cpp", + "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp", + ] + deps = [ + ":gpu_tool_utils", + ":skia", + ] +} + +test_app("sksl2metal") { + sources = [ + "fuzz/Fuzz.cpp", + "fuzz/FuzzCommon.cpp", + "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp", + ] + deps = [ + ":gpu_tool_utils", + ":skia", + ] +} diff --git a/projects/skia/Dockerfile b/projects/skia/Dockerfile index 4ee981a86..e2ff521b6 100644 --- a/projects/skia/Dockerfile +++ b/projects/skia/Dockerfile @@ -70,6 +70,8 @@ RUN wget -O $SRC/skia/skjson_seed_corpus.zip https://storage.googleapis.com/skia RUN wget -O $SRC/skia/api_polyutils_seed_corpus.zip https://storage.googleapis.com/skia-fuzzer/oss-fuzz/api_polyutils_seed_corpus.zip +RUN wget -O $SRC/skia/sksl_seed_corpus.zip https://storage.googleapis.com/skia-fuzzer/oss-fuzz/sksl_seed_corpus.zip + COPY build.sh $SRC/ COPY skia.diff $SRC/skia/skia.diff @@ -100,6 +102,11 @@ COPY api_fuzzers.options $SRC/skia/api_pathop.options COPY api_fuzzers.options $SRC/skia/api_polyutils.options COPY api_fuzzers.options $SRC/skia/api_raster_n32_canvas.options +# SKSL fuzzers can share options +COPY sksl.options $SRC/skia/sksl2glsl.options +COPY sksl.options $SRC/skia/sksl2spirv.options +COPY sksl.options $SRC/skia/sksl2metal.options + COPY json.dict $SRC/skia/json.dict COPY BUILD.gn.diff $SRC/skia/BUILD.gn.diff diff --git a/projects/skia/build.sh b/projects/skia/build.sh index e49b9a3fc..48dee4fb6 100644 --- a/projects/skia/build.sh +++ b/projects/skia/build.sh @@ -99,7 +99,8 @@ $SRC/depot_tools/ninja -C out/Fuzz region_deserialize region_set_path \ jpeg_encoder webp_encoder skottie_json \ textblob_deserialize skjson \ api_null_canvas api_image_filter api_pathop \ - api_polyutils android_codec image_decode_incremental + api_polyutils android_codec image_decode_incremental \ + sksl2glsl sksl2spirv sksl2metal $SRC/depot_tools/ninja -C out/Fuzz_mem_constraints image_filter_deserialize \ api_raster_n32_canvas \ @@ -206,3 +207,15 @@ cp ./image_decode_seed_corpus.zip $OUT/android_codec_seed_corpus.zip. cp out/Fuzz/image_decode_incremental $OUT/image_decode_incremental cp ./image_decode_incremental.options $OUT/image_decode_incremental.options cp ./image_decode_seed_corpus.zip $OUT/image_decode_incremental_seed_corpus.zip + +cp out/Fuzz/sksl2glsl $OUT/sksl2glsl +cp ./sksl2glsl.options $OUT/sksl2glsl.options +cp ./sksl_seed_corpus.zip $OUT/sksl2glsl_seed_corpus.zip + +cp out/Fuzz/sksl2spirv $OUT/sksl2spirv +cp ./sksl2spirv.options $OUT/sksl2spirv.options +cp ./sksl_seed_corpus.zip $OUT/sksl2spirv_seed_corpus.zip + +cp out/Fuzz/sksl2metal $OUT/sksl2metal +cp ./sksl2metal.options $OUT/sksl2metal.options +cp ./sksl_seed_corpus.zip $OUT/sksl2metal_seed_corpus.zip diff --git a/projects/skia/sksl.options b/projects/skia/sksl.options new file mode 100644 index 000000000..648edd482 --- /dev/null +++ b/projects/skia/sksl.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 3000 \ No newline at end of file