06b84efcb3
We now insert helper functions which defer the assignment of out- parameters back into their original variables to the end of the function call. This allows us to match the semantics listed the GLSL spec in section 6.1.1: "All arguments are evaluated at call time, exactly once, in order, from left to right. [...] Evaluation of an out parameter results in an l-value that is used to copy out a value when the function returns. Evaluation of an inout parameter results in both a value and an l-value; the value is copied to the formal parameter at call time and the lvalue is used to copy out a value when the function returns." This technique also allows us to support swizzled out-parameters in Metal, by reading the swizzle into a temp variable, calling the original function, and then re-assigning the result back into the original swizzle expression. At present, we don't deduplicate these helper functions, so in theory there could be a fair amount of redundant code generated if a function with out parameters is called many times in a row. The cost of properly deduplicating them is probably larger than the benefit in the 99% case. Change-Id: Iefc922ac9e2b24ef2ff1e9dacb17a735a75ec8ea Bug: skia:10855, skia:11052 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341162 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com> |
||
---|---|---|
.. | ||
toolchain | ||
__init__.py | ||
bench.gni | ||
BUILD.gn | ||
BUILDCONFIG.gn | ||
call.py | ||
checkdir.py | ||
checkpath.py | ||
codesign_ios.py | ||
compile_ib_files.py | ||
compile_processors.py | ||
compile_sksl_tests.py | ||
copy_git_directory.py | ||
core.gni | ||
cp.py | ||
create_sksl_fp.py | ||
dehydrate_sksl.py | ||
effects_imagefilters.gni | ||
effects.gni | ||
find_headers.py | ||
find_msvc.py | ||
find_xcode_sysroot.py | ||
flutter_defines.gni | ||
fuchsia_defines.gni | ||
gen_plist_ios.py | ||
gm.gni | ||
gn_meta_sln.py | ||
gn_to_bp_utils.py | ||
gn_to_bp.py | ||
gn_to_cmake.py | ||
gpu.gni | ||
highest_version_dir.py | ||
ios.gni | ||
is_clang.py | ||
make_gm_gni.py | ||
opts.gni | ||
pdf.gni | ||
push_to_android.py | ||
rm.py | ||
run_sksllex.py | ||
samples.gni | ||
shared_sources.gni | ||
skia.gni | ||
sksl_tests.gni | ||
sksl.gni | ||
tests.gni | ||
utils.gni | ||
xps.gni |