skia2/gn
John Stiles 21f5f450a4 Fix SPIR-V compilation error with arrays of samplers.
This CL addresses the root cause of the fuzzer issue, by checking for
LayoutIsSupported before getting the MemoryLayout of a type. However,
this array ought to be detected as an error everywhere, as samplers are
opaque types; at present, this code compiles without error in GLSL and
Metal. This is an issue for followup CLs.

GLSL's actual support for arrays of samplers is interesting and probably
too nuanced for us to try to emulate:

https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Opaque_arrays

"Under GLSL version 3.30, Sampler arrays (the only opaque type 3.30
provides) can be declared, but they can only be accessed by compile-time
integral Constant Expressions. So you cannot loop over an array of
samplers, no matter what the array initializer, offset and comparison
expressions are.

Under GLSL 4.00 and above, array indices leading to an opaque value can
be accessed by non-compile-time constants, but these index values must
be dynamically uniform. The value of those indices must be the same
value, in the same execution order, regardless of any non-uniform
parameter values, for all shader invocations in the invocation group."

Change-Id: Ib382f5c3b563f996b3c8f1eb6b021b6d31fa9ce7
Bug: oss-fuzz:28107
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339159
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-30 17:28:14 +00:00
..
toolchain allow overriding {target,host}_link = ... in GN 2020-11-05 19:40:47 +00:00
__init__.py
bench.gni Add GrPathUtils::findCubicConvex180Chops 2020-11-02 20:33:54 +00:00
BUILD.gn Add ios_min_target. 2020-11-18 21:21:25 +00:00
BUILDCONFIG.gn Add ios_min_target. 2020-11-18 21:21:25 +00:00
call.py
checkdir.py fix print functions for python3 gn scripts 2020-03-06 17:42:39 +00:00
checkpath.py
codesign_ios.py Update code-signing script to have better error messages. 2020-11-09 18:41:36 +00:00
compile_ib_files.py
compile_processors.py Fix worklist files with skslc. 2020-11-18 19:41:45 +00:00
compile_sksl_tests.py Fix SPIR-V golden output file extensions. 2020-11-23 21:15:13 +00:00
copy_git_directory.py
core.gni Move SkTTopoSort to src/gpu and rename it to GrTTopoSort 2020-11-17 14:17:03 +00:00
cp.py Work around python 2 shutil.copy2 date bug 2020-09-28 20:12:13 +00:00
create_sksl_fp.py SkSL include files are now stored in a binary format 2020-07-31 13:48:25 +00:00
dehydrate_sksl.py Reland "Untangle dependency cycle in sksl dehydration" 2020-08-10 15:47:43 +00:00
effects_imagefilters.gni
effects.gni Convert GLHighContrastFilterEffect to an .fp file. 2020-07-10 20:54:33 +00:00
find_headers.py
find_msvc.py Add Preview to list of possible MSVC versions. 2020-04-30 19:54:33 +00:00
find_xcode_sysroot.py fix print functions for python3 gn scripts 2020-03-06 17:42:39 +00:00
flutter_defines.gni Switch to m44 for the rest of canvas virtuals 2020-11-25 21:50:37 +00:00
fuchsia_defines.gni Enable new clip stack for Fuchsia 2020-10-12 20:41:03 +00:00
gen_plist_ios.py Add product bundle name to iOS Xcode projects 2020-11-16 16:00:56 +00:00
gm.gni Remove two YUV effect GMs: yuv_to_rgb_effect and yuv_nv12_to_rgb_effect. 2020-11-17 19:28:43 +00:00
gn_meta_sln.py fix print functions for python3 gn scripts 2020-03-06 17:42:39 +00:00
gn_to_bp_utils.py Cleanup gn_to_bp_utils 2020-10-16 16:01:32 +00:00
gn_to_bp.py Remove windows:enabled from skia_deps 2020-11-12 16:26:48 +00:00
gn_to_cmake.py Switch GN defs on Mac and iOS to use frameworks, take 3 2020-08-12 17:03:47 +00:00
gpu.gni Move SkTTopoSort to src/gpu and rename it to GrTTopoSort 2020-11-17 14:17:03 +00:00
highest_version_dir.py fix print functions for python3 gn scripts 2020-03-06 17:42:39 +00:00
ios.gni Add ios_min_target. 2020-11-18 21:21:25 +00:00
is_clang.py Fix is_clang python3 encoding errors 2020-06-26 18:41:00 +00:00
make_gm_gni.py
opts.gni add structure for normal SKX opts 2020-06-05 13:48:39 +00:00
pdf.gni Make skia_use_xps option work on Windows 2020-03-24 17:09:33 +00:00
push_to_android.py
rm.py Delete .a file before writing static library. 2020-06-11 17:19:23 +00:00
run_sksllex.py Reland "Fetch clang-format automatically when compiling .fp files." 2020-06-12 13:21:41 +00:00
samples.gni Add toy variable-width stroker sample 2020-10-26 14:43:03 +00:00
shared_sources.gni add structure for normal SKX opts 2020-06-05 13:48:39 +00:00
skia.gni Reland "[svg] Relocate out of experimental" 2020-10-16 02:32:41 +00:00
sksl_tests.gni Fix SPIR-V compilation error with arrays of samplers. 2020-11-30 17:28:14 +00:00
sksl.gni Add global struct definitions to SkSL. 2020-11-30 15:26:14 +00:00
tests.gni Migrate dedicated SPIR-V tests to golden outputs. 2020-11-30 15:05:54 +00:00
utils.gni Remove SkWhitelistTypefaces. 2020-06-30 14:54:53 +00:00
xps.gni harmonize rewrite-includes and gn-format checks 2020-04-03 17:00:54 +00:00