| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
CVE 513337118 Signed-off-by: whuqincheng <liweiyang1@huawei.com> | 24 天前 | |
CVE-2026-7923 patch修复 TicketNo: DTS2026052234994 Description: CVE-2026-7923 patch修复 Team:OTHERS Feature or Bugfix:Bugfix Binary Source: sync from gitcode PrivateCode(Yes/No):No ------ DO NOT MODIFY, AUTO-GENERATED! ------ gitcode-Issue: 131 Time: "2026-05-13T03:10:55.284530Z" PR-Num: 216 gitcode-PR: https://gitcode.com/openharmony-tpc/chromium_third_party_skia/merge_requests/216 UserId:842199 Co-Authored-By: Agent cherry picked from commit 243a3f1f8500d9afdbcaf4df85ecdecae32e257c cherry picked from commit 1370d28c2f017351def224d94b82aaf4582bb9d4 Change-Id: I1778641851542ee2d33b6624479938f1d8520aaa Reviewed-by: w30064525 Approved-by: f00619500 Merged-on: https://open.codehub.huawei.com/OpenSourceCenter_CR/openharmony-tpc/chromium_third_party_skia/-/change_requests/188 Merged-by: public pjenkins Signed-off-by: lxinjie <liuxinjie6@huawei.com> | 1 个月前 | |
CVE 514082801 Signed-off-by: whuqincheng <liweiyang1@huawei.com> | 14 天前 | |
Update (some) callers to follow more strict span rules - allows us to migrate to std::span, keeping SkSpan (for now) as an alias. - idea is to land call-site-cleanups separately, so that when we do try to actually throw the switch, that CL only contains the switch (build-flag) itself. Change-Id: I5f9aaafeb297b7adc1d953019fdac6ffda95fe03 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1097896 Commit-Queue: Mike Reed <mike@reedtribe.org> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Florin Malita <fmalita@google.com> | 7 个月前 | |
Update Bazel to 8.2.1 and use bzlmod The update to bzlmod [1] changes how we handle third_party deps (dramatically) and how our toolchains work (minorly). To review and understand the changes, I suggest going language by language through the changes: C++ === We have Bazel check out git repositories listed in deps.bzl (like before), but this has been converted to a module_extension [2] which behaves basically the same. In MODULE.bazel, we load the extension and then specify all the dependencies that Skia directly depends on from there. If we can depend on versions from the Bazel registry [3], for example bazel_dep(name = "libpng", version = "1.6.47.bcr.1") we could remove the git repository versions and this might make things easier for external clients if there are version mismatches. A big change was required with how we customize our compilation of expat, FreeType, Harfbuzz, and ICU. Previously, we'd copied in (or cleverly referenced) files from the Skia repo in the third party copy of the code and this sort of worked. External clients had to use some helpers to load these configs and it was Fine (tm). This does not work with bzlmod's dependency graph. I tried several things to make this work cleanly and ran into road blocks with either RBE or external client usage (or both). See earlier patchsets for that, if interested. What *did* work (at least ok) was making a patch file per third party dep that needed it using tools/generate_patches.py to combine all those files and specify an output location. This has the downside of not being in sync, but I made the existing roll scripts for expat, FreeType, Harfbuzz shell out to the script to minimize that. Toolchains needed to be slightly updated to have a different path in the external/ output directory, which now includes some prefixing. To make this as robust as possible, I made the trampoline scripts use paths relative to where the script lives and use a glob to find the path no matter what the prefix is. Clang remains at 15.0.1 for Bazel builds. Rust ==== The rust toolchain has been updated to 1.86.0 (this was the primary impetus for this change). External crate dependences use crate_universe [4] and specify the versions we need directly in MODULE.bazel instead of using a toml file. I chose that approach because it seemed more direct when one wants to figure out what version our Bazel build uses. All crates except cxx worked "out of the box", meaning the rules_rust generated BUILD.bazel files for them in a way that just worked. I had to use crate.annotation to customize cxx to use bazel/external/cxx/BUILD.bazel.skia in addition to the generated rule so we can overwrite the include path. This was a bit fiddly and required me to spend a while looking through the bazel cache to experiment with what the output was. The only other major change is how we reference rust dependencies now. For example in src/ports/fontations/BUILD.bazel see that all rust dependencies are based out of @crates instead of all being top level dependencies. Again, poking into the bazel cache is helpful for figuring out what the generated target names are. Another upside of this update is the big long "splicing workspaces" seems to have gone away. Golang ====== The golang version is now 1.24.2. These were the most fiddly changes - particularly with some changes in the ecosystem related to protos. In MODULE.bazel, the go.mod file is read in to get both the go version and the direct golang dependencies. go_rules uses gazelle [5] to generate BUILD.bazel files for any deps if they don't have them. This includes generating BUILD.bazel files for proto files, which are a bit messy due to there being some conflicting ways to include these and thus resolve the deps. This [6] is why I ended up mothballing the upgrade of the Skia Infra repo in favor of a minimal [7] change. In this case, we only had to tell the go.chromium.org/luci repo not to autogenerate .go files for .proto files because there are pre-existing ones. While building task drivers, there was a problem where some go deps were not being brought in and thus our transitive dependencies were failing to build. This is why tools.go was added (inspired by [8] to force those to be included. Python3 ======= This was a straightforward upgrade to Python 3.13. MODULE.bazel still reads requirements.txt to figure out what to download. The BUILD.bazel file we build for Dawn uses these requirements, but we didn't have to change how that worked at all. Other Notes =========== Renames ------- There are many mechanical changes (e.g. io_bazel_rules_go->rules_go) throughout as a result of bzlmod having different (non prefixed) package names in some cases. bazel/buildrc ------------- Sandboxing seems much faster in this new Bazel version on Mac. Thus I deleted the no_sandbox config. This change also updates the version of emsdk we use to compile CanvasKit. I had to squelch some warnings that they have via our config because I didn't see another way to override their toolchain settings. buildifier ---------- Updated the version used by Bazel to 8.0.3 I suggest folks also update their local version too, so presubmits work [9] Not working (yet) / disabled ============================ - karma_tests (JS tests for CanvasKit). This was based on long-deprecated rules and I didn't have the time to fix this. We still have GN based tests for CanvasKit, so this was low enough priority to skip for now - codesize_test. git_common.WithGitFinder was not working. As this is a test for our task_driver and has been stable for a while, it seemed like a low priority to fix. - bazel run //:gofmt. This moved with new go_rules and I couldn't find an easy replacement. - bazel run //:errcheck. This needs to shell out to golang and doesn't work on systems that don't have go installed because of the hermeticity. Not sure what to do about that. - clang_ios and clang_windows_amd64 toolchains. We don't have any CI jobs that use these atm, and they are lower priority for now. I made some changes based on other toolchains, but didn't test these. [1] https://bazel.build/external/migration [2] https://bazel.build/external/extension [3] https://registry.bazel.build/modules/libpng [4] https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html [5] https://github.com/bazel-contrib/bazel-gazelle/blob/master/extensions.md#go_deps [6] https://skia-review.googlesource.com/c/buildbot/+/988440/11/MODULE.bazel [7] http://review.skia.org/990801 [8] https://github.com/google/skia-buildbot/blob/b4a7f41e01ea288eadd197f9eee0b1a8a12c5aa4/tools.go [9] https://github.com/bazelbuild/buildtools/releases/tag/v8.0.3 Change-Id: I68be15c5c4a5d2b14359fa460075591dafab336a Bug: b/413044303 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/984976 Commit-Queue: Kaylee Lubick <kjlubick@google.com> Reviewed-by: Dominik Röttsches <drott@google.com> Reviewed-by: Eric Boren <borenet@google.com> | 1 年前 | |
Reland "Remove JSON output from public API of SkSLDebugTrace" This is a reland of commit 47f59c4368e202c276aee0534b7d8dc9df4bf65b This guards use of SkSLTraceUtils so it is not used in Flutter (which caused the roll to break because they have their own BUILD.gn file that would have needed updating). They don't need our JSON output anyway, so this will incidentally save them a few kb in code size. Original change's description: > Remove JSON output from public API of SkSLDebugTrace > > SkSLDebugTrace was the only place in //src that used //src/utils/SkJSON.h (Skia's JSON parser). This parsing > wasn't visible via the public API, instead hiding it in > DebugTracePriv). > > I would like to remove our JSON parser from Skia proper and > move it into //modules. This makes Skia the library easier > to build (as there is a static_assert() that flat out fails > on big-endian systems [1]), reduces our potential security > footprint, and our code size (marginally). > > Aside: Skia's JSON writer appears to be mainly used by some > Ganesh code to output debug info. One could wonder if that's > strictly necessary or if it could be moved to //tools too. > > In any case, this removes the JSON parsing and output logic > from SkSLDebugTrace (and SkSLDebugTracePriv), moving them > to //tools where we can access it for some of our tooling > when we need to. A follow-up CL will move SkJSON.h to //modules. > > Change-Id: I48558630e7bd9963609947f839657a89f064bd1a > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/926676 > Reviewed-by: Florin Malita <fmalita@google.com> Change-Id: Iccb25d41f225affa5fbb491d586130637effa0bc Reviewed-on: https://skia-review.googlesource.com/c/skia/+/927598 Reviewed-by: Jim Van Verth <jvanverth@google.com> Owners-Override: Kaylee Lubick <kjlubick@google.com> | 1 年前 | |
Delete all filegroups that supported legacy (non-buffet) Bazel build We don't need most of the flags and all these file groups which had made a big "ball o mud" build. Change-Id: I690f38c3555e390b7c8d459b4649a270c3e03ce2 Bug: b/40045064 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/889266 Commit-Queue: Kaylee Lubick <kjlubick@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> | 1 年前 | |
[graphite] Remove placeholder ES2 shader modules Change-Id: I2ec9b27450e1c42054d38c9167a4ab81e5f3c62b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/996117 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: James Godfrey-Kittle <jamesgk@google.com> | 1 年前 | |
Remove trailing whitespace. Also adds a presubmit to prevent adding trailing whitespace to source code in the future. Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6 Reviewed-on: https://skia-review.googlesource.com/57380 Reviewed-by: Ravi Mistry <rmistry@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com> | 8 年前 | |
[sksl] Document atomics and barriers in README * Added documentation for the new synchronization primitives to the SkSL README. * Renamed sksl/README to sksl/README.md. This allows the page to get rendered as markdown when viewed in the browser. Bug: b/260597257 Change-Id: I4b98ea460820d955c603e354db1918b05c6f289c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/618519 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: Arman Uguray <armansito@google.com> | 3 年前 | |
Mark samplers as explicitly-sampled when passing them to a function. This change is required in order for child effects to evaluate correctly when they are used in helper functions. Otherwise, they are treated as pass-through and ignore the passed-in position. Bug: b/328051548 Change-Id: I2fa8c714b2479843461a62ec42c3ca3bd9e09f99 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/881417 Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> | 1 年前 | |
Remove SkSL program size limit Bug: 40044195 Change-Id: Ic456211b208421a978fbbda103dda8fead063ab2 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/891757 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: Brian Osman <brianosman@google.com> | 1 年前 | |
Prepare more call-sites for std::span Change-Id: Ieccf7ff710b32994fa16cc2fde3f428619925e54 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1099836 Reviewed-by: Florin Malita <fmalita@google.com> Commit-Queue: Mike Reed <mike@reedtribe.org> Reviewed-by: Eric Boren <borenet@google.com> | 7 个月前 | |
Add SkSL type alias for 'atomic_uint.' atomic_uint is a GLSL ES3 reserved word, so SkSL needs to be aware of it and treat it as a typename instead of as a freely usable identifier. We now treat it as an alias for atomicUint (even though its semantics don't match GL). Bug: b/343194653 Change-Id: Ida1dda38c4a2715afe3442be7034a0d5a39d8a52 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/877337 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> | 1 年前 | |
Replace bug ids with mapped ids in the new issue tracker Bug references of the form: skia:NNNN crbug.com/skia/NNNN https://crbug.com/skia/NNNN http://skbug.com/NNNN skbug.com/NNNN skbug:NNNN are replaced with skbug.com/MMMMMMMM where NNNN maps to MMMMMMMM in the new issue tracker. Change-Id: Ifdc83c39e95e369135e1daa4ebb157977fecb36f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1002016 Auto-Submit: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brett Somocurcio <brettos@google.com> | 1 年前 | |
Mark more single argument constructors explicit I had a more expansive search pattern and found a few more candidates this time around. Gemini CLI did most of the work here and it does not appear we were implicitly using the conversion. Change-Id: Ia51d127a099dca4f76f7e13012d9f19dd1038e50 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1076816 Auto-Submit: Kaylee Lubick <kjlubick@google.com> Reviewed-by: Florin Malita <fmalita@google.com> Commit-Queue: Florin Malita <fmalita@google.com> | 8 个月前 | |
Factor out fold_two_constants into a helper function. This should be entirely equivalent and the code is nearly unchanged. This hypothetically changes control flow a bit if we could reach the last return nullptr in fold_two_constants, as previously this would continue on into later parts of Simplify, but in practice I don't think any of the remaining code in Simplify could affect any expression composed entirely of constants. Change-Id: I4ff129453a96746947a7c18813ce38c5bdc940a7 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/847597 Auto-Submit: John Stiles <johnstiles@google.com> Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: John Stiles <johnstiles@google.com> | 2 年前 | |
Move SkSLDefines to src/sksl/ It has no more uses in include/ Change-Id: Iefdf22e5b88625c84c1305a24184503e96561a98 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/753497 Commit-Queue: Kevin Lubick <kjlubick@google.com> Auto-Submit: Kevin Lubick <kjlubick@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: John Stiles <johnstiles@google.com> | 2 年前 | |
Remove ShaderCaps from the SkSL frontend entirely. The Context no longer holds a shader-caps pointer. The code generators now take a ShaderCaps pointer, which is currently provided by the Compiler. Bug: b/316916102 Change-Id: I2e556c524ad36869c8d5f53d3c0111b1cbedbd53 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/791211 Auto-Submit: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com> | 2 年前 | |
Switch to unique_ptr<> for SymbolTable management. Previously, it was unclear who was ultimately responsible for ownership of a symbol table. Now, symbol tables are owned by the IR node which made them. We have one global scope, and additional scopes can be created by a Block, Switch, or For. Change-Id: Ifce8a7ad7e752cc409487767e3c059357a55ec27 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/800220 Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com> | 2 年前 | |
Add a FixedArray class to shrink SkSL::ComponentArray. Using a fixed-size array here saves about 2K of code size, and uses about 16K less RAM when loading the Graphite modules. The FixedArray class was designed to be a drop-in replacement for STArray (at least, enough to pass the basic tests in TArrayTest). For now, it only supports trivial types and up to 255 elements, but these restrictions are fixable if a need arises. Change-Id: I09358427a144af24deb2031813f95759f48efd1f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/844437 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> | 2 年前 | |
Move DSL and most private SkSL headers out of include/. We aren't supporting DSL as public API, so its headers have moved back into src/sksl/. Most SkSL references in include/private/ were in support of DSL, so these have been moved back into src/sksl/ as well. Change-Id: I9b7f965f9e77fb6e24de388d79db82c56b51bad3 Bug: skia:14183 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/671958 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> | 3 年前 | |
Move DSL and most private SkSL headers out of include/. We aren't supporting DSL as public API, so its headers have moved back into src/sksl/. Most SkSL references in include/private/ were in support of DSL, so these have been moved back into src/sksl/ as well. Change-Id: I9b7f965f9e77fb6e24de388d79db82c56b51bad3 Bug: skia:14183 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/671958 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> | 3 年前 | |
Remove starts_with and ends_with from SkSL::String. std::string::starts_with will be available in C++20. In the interim, prefer using a free function in skstd. This puts us a small step closer towards removing SkSL::String. Change-Id: I8c6b33d94c51a643d8cb99ac4c4b1c0556cb9170 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502782 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> | 4 年前 | |
Reland "Add synonyms to GLSLGeneration for 100es and 300es." This is a reland of 63e7ba59ce32a8612be23ea0992b93b8dd360ec3 This fixes accidental change of 310es -> 300es in one spot. Original change's description: > Add synonyms to GLSLGeneration for 100es and 300es. > > We use GLSLGeneration::k330 to mean GLSL 3.30 for desktop GLSL and also > for ES 3.00. k110 lived a double life as ES 1.00. This was confusing, so > several places in the code had comments like "this is the value for GLSL > ES 3" to clarify. > > This CL adds new enums "k100es" and "k300es" which use the same values > as "k110" and "k330", but make the code easier to understand at a > glance. > > Change-Id: Ib4dfbd8cd7bab45b35d6ad7303ccf87c7eeca3ab > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506898 > Auto-Submit: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> Change-Id: I2e271090687000aa522b217b9d54f9332ecd3a49 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512728 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> | 4 年前 | |
[graphite] Remove placeholder ES2 shader modules Change-Id: I2ec9b27450e1c42054d38c9167a4ab81e5f3c62b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/996117 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: James Godfrey-Kittle <jamesgk@google.com> | 1 年前 | |
[graphite] Remove placeholder ES2 shader modules Change-Id: I2ec9b27450e1c42054d38c9167a4ab81e5f3c62b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/996117 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: James Godfrey-Kittle <jamesgk@google.com> | 1 年前 | |
Replace bug ids with mapped ids in the new issue tracker Bug references of the form: skia:NNNN crbug.com/skia/NNNN https://crbug.com/skia/NNNN http://skbug.com/NNNN skbug.com/NNNN skbug:NNNN are replaced with skbug.com/MMMMMMMM where NNNN maps to MMMMMMMM in the new issue tracker. Change-Id: Ifdc83c39e95e369135e1daa4ebb157977fecb36f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1002016 Auto-Submit: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brett Somocurcio <brettos@google.com> | 1 年前 | |
[sksl] Skip inline statement limit for modules This was added as an upper bound for pathologic inputs from user provided SkSL. However, it turns out that the Graphite modules have gotten large enough that their base level of statements quickly pushes inlining past the 2500 statement limit. This would mean that somewhat arbitrarily simple seeming module functions would remain un-inlined within the modules. These would not be re-inlined when the final program was compiled because that would only execute a single iteration of inlining. This would be enough to inline the primary module function calls, but not enough to then recurse and inline things that were missed when compiling as a large module stopped the process early. I'll be curious to see how this impacts performance, but I couldn't measure improvements on Mac. That's not surprising given they use llvm on the generated msl so it can clean these issues up. That said I think always maximally inlining the module functions produces more predictable output. NOTE: This does not actually impact the .unoptimized.sksl and .minified.sksl because inlining is executed as part of loading the modules. Change-Id: I8739dd5d38649161c00072d2f1bf1494c106ab21 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/993544 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: James Godfrey-Kittle <jamesgk@google.com> Commit-Queue: Michael Ludwig <michaelludwig@google.com> | 1 年前 | |
Reland "Add SkNoDestructor<T> class to Skia." This reverts commit d85e872b336fa12f2f66d003f49ff34f09b26c5b. Reason for revert: adding #include Original change's description: > Revert "Add SkNoDestructor<T> class to Skia." > > This reverts commit 485cd3d0f9ca5524458c168b8d31c64c6348655e. > > Reason for revert: Appears to be breaking G3 roll > > Original change's description: > > Add SkNoDestructor<T> class to Skia. > > > > This class is adapted from Chromium, and is BSD-licensed: > > https://crsrc.org/c/base/no_destructor.h > > > > static SkNoDestructor<T> foo(...); inside a function approximates > > a global singleton, but is safe from ordering concerns at startup or > > shutdown. It is also faster than allocating an object on the heap. > > (We used to consider allocation from the heap as a sufficiently- > > good solution, but apparently this leads to measurable overhead > > when everyone does it: > > http://go/totw/110#the-fix-safe-initialization-no-destruction) > > > > I've added it to SkSL in places where we currently allocate. > > > > Change-Id: I2f1c6cf915c6f1294242951206a9d40e640fa4cc > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/694624 > > Reviewed-by: Kevin Lubick <kjlubick@google.com> > > Reviewed-by: Herb Derby <herb@google.com> > > Commit-Queue: John Stiles <johnstiles@google.com> > > Change-Id: If8b83ab687ae980eee018beca52d4715da91a186 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/695236 > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Auto-Submit: Brian Osman <brianosman@google.com> Change-Id: I08610f0b69556fb561a49ffe0f0c3c726cbf294a Reviewed-on: https://skia-review.googlesource.com/c/skia/+/695239 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> | 3 年前 | |
[SkSL] Remove loadFloatBuffer intrinsic There is no longer a use-case for this intrinsic function since we can now pass unsized arrays as parameters in all Graphite backends using storage buffers. Change-Id: I7014562ae7f03c4ab0b6df56095e3e64747a0b86 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/883536 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: Nathan Sanchez <nathanasanchez@google.com> | 1 年前 | |
Mark unsupported texture/sampler types as reserved. This should be the last of the new reserved tokens. The remaining unhandled words will be allowed to pass through safely. Bug: b/343194653 Change-Id: I946e6d4f792269ae5d7f54b9a199eb63c121b810 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/879641 Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com> | 1 年前 | |
Add new modifier pixel_local to SkSL. At this CL, the lexer and parser have been updated to support the new keyword, but the modifier is not allowed in any context. Bug: b/299504320 Change-Id: I754f2a6e82726d0969a174e62d2d1d9eedcd9100 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/754016 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: Michael Ludwig <michaelludwig@google.com> | 2 年前 | |
Move SkStringView from include/private/base into src/base src/base is where files that we want to be used in the base package (i.e. minimal deps and used in many parts of Skia) which are not used by the public API can go. Change-Id: Idf781f7cc24ab8aa05004c099cea53d65484b1c0 Bug: skia:13983 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/627696 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: Brian Osman <brianosman@google.com> | 3 年前 | |
[includes] Enforce IWYU on sksl code PS1 regenerates the Bazel files. Use it as the base change when comparing patchsets. IWYU seems to do a good job of working with MyFile.cpp and MyFile.h, but if there is just a MyHeader.h, it doesn't always seem to throw errors if the includes aren't correct. This was observed with include/sksl/DSL.h This might be due to the fact that headers are not compiled on their own, so they are never sent directly to the IWYU binary. This change sets enforce_iwyu_on_package() on the all sksl packages and then fixes the includes until all those checks are happy. There were a few files that needed fixes outside of the sksl folder. Examples include: - src/gpu/effects/GrConvexPolyEffect.cpp - tests/SkSLDSLTest.cpp To really enforce this, we need to add a CI/CQ job that runs bazel build //example:hello_world_gl --config=clang \ --sandbox_base=/dev/shm --features skia_enforce_iwyu If that failed, a dev could make the changes described in the logs and/or run the command locally to see those prescribed fixes. I had to add several entries to toolchain/IWYU_mapping.imp in order to fix some private includes and other atypical choices. I tried adding a rule there to allow inclusion of SkTypes.h to make sure defines like SK_SUPPORT_GPU, but could not get it to work for all cases, so I deferred to using the IWYU pragma: keep (e.g. SkSLPipelineStageCodeGenerator.h) Change-Id: I4c3e536d8e69ff7ff2d26fe61a525a6c2e80db06 Bug: skia:13052 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522256 Reviewed-by: John Stiles <johnstiles@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> | 4 年前 | |
[Graphite][SkSL] Conditionally force std430 array stride In Graphite's case, both RenderStep and PaintParams uniforms will follow the same interface layout (UBO or SSBO). Intrinsic uniforms may differ in layout but they only contain a single float4 so then we know the only arrays being passed as function arguments will come from the same layout. Locally declared arrays also get forced to std430 as well when it is enabled. This will only be enabled in Vulkan if SSBOs are using std430 and will only affect spir-v generation. Bug: b/40045541 Change-Id: Iaf4825769787da5a4f62acd58b4be0d19bca9836 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/874247 Reviewed-by: John Stiles <johnstiles@google.com> | 1 年前 | |
Port GrMemoryPool emscripten alignment fix to SkSL::MemoryPool Bug: b/298303571 Change-Id: I60f92c703e81da52f5d9178d24992be5d3952dee Reviewed-on: https://skia-review.googlesource.com/c/skia/+/751522 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com> | 2 年前 | |
Keep track of the current ModuleType as it is being compiled. Previously, we knew whether or not a module was being compiled (via fIsBuiltinCode), but not _which_ module. Since we have a ModuleType enum now, it makes sense to actually keep it in the ProgramConfig instead of just a boolean. Change-Id: Iedf31a9f3003a40367eb1eca1070b7dc2e782fb1 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/879936 Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> | 1 年前 | |
[graphite] Remove placeholder ES2 shader modules Change-Id: I2ec9b27450e1c42054d38c9167a4ab81e5f3c62b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/996117 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: James Godfrey-Kittle <jamesgk@google.com> | 1 年前 | |
[graphite] Remove placeholder ES2 shader modules Change-Id: I2ec9b27450e1c42054d38c9167a4ab81e5f3c62b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/996117 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: James Godfrey-Kittle <jamesgk@google.com> | 1 年前 | |
Migrate SkSL::Module into dedicated header. This is really an overdue change. Previously Module lived in SkSLCompiler.h, and it turns out that many places which #included Compiler were only doing so to access the Module structure. Modules also now hold onto their ModuleType; nothing relies on it today, but it seemed like a reasonable way to spend 1 byte. Change-Id: If52dcd309cbc2d3b9bf7743d108618753c75bf7f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/879603 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> | 1 年前 | |
Replace bug ids with mapped ids in the new issue tracker Bug references of the form: skia:NNNN crbug.com/skia/NNNN https://crbug.com/skia/NNNN http://skbug.com/NNNN skbug.com/NNNN skbug:NNNN are replaced with skbug.com/MMMMMMMM where NNNN maps to MMMMMMMM in the new issue tracker. Change-Id: Ifdc83c39e95e369135e1daa4ebb157977fecb36f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1002016 Auto-Submit: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brett Somocurcio <brettos@google.com> | 1 年前 | |
[graphite] Remove placeholder ES2 shader modules Change-Id: I2ec9b27450e1c42054d38c9167a4ab81e5f3c62b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/996117 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: James Godfrey-Kittle <jamesgk@google.com> | 1 年前 | |
Reland "Fix swizzled compound assignment with lvalue side-effects in Metal." This reverts commit ffed127e89749f53e940124e4b41f6aa36561f48. Reason for revert: disabling test on ANGLE / Intel+Win10 Original change's description: > Revert "Fix swizzled compound assignment with lvalue side-effects in Metal." > > This reverts commit 93cfaa8481ecc1e4cfc8698d6432be3c69e858b6. > > Reason for revert: Intel+Win and ANGLE+D3D11 fail on newly introduced SwizzleAsLValueES3 test > > > Original change's description: > > Fix swizzled compound assignment with lvalue side-effects in Metal. > > > > Because we now have an index-substitution map, we can emit the LHS > > twice without fear of double-evaluation. > > > > Change-Id: I7ae58749b48147178c8a82831c6e27f91762ffbe > > Bug: skia:14127 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/722859 > > Commit-Queue: Arman Uguray <armansito@google.com> > > Reviewed-by: Arman Uguray <armansito@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Bug: skia:14127 > Change-Id: Ib7183737ce126626328020e2130b78044d12d2a6 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/723406 > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Auto-Submit: John Stiles <johnstiles@google.com> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bug: skia:14127 Change-Id: Ie6636c9dd20d45d1369b5cfdc85e6a350b359891 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/723412 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> | 2 年前 | |
Reland "Fix swizzled compound assignment with lvalue side-effects in Metal." This reverts commit ffed127e89749f53e940124e4b41f6aa36561f48. Reason for revert: disabling test on ANGLE / Intel+Win10 Original change's description: > Revert "Fix swizzled compound assignment with lvalue side-effects in Metal." > > This reverts commit 93cfaa8481ecc1e4cfc8698d6432be3c69e858b6. > > Reason for revert: Intel+Win and ANGLE+D3D11 fail on newly introduced SwizzleAsLValueES3 test > > > Original change's description: > > Fix swizzled compound assignment with lvalue side-effects in Metal. > > > > Because we now have an index-substitution map, we can emit the LHS > > twice without fear of double-evaluation. > > > > Change-Id: I7ae58749b48147178c8a82831c6e27f91762ffbe > > Bug: skia:14127 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/722859 > > Commit-Queue: Arman Uguray <armansito@google.com> > > Reviewed-by: Arman Uguray <armansito@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Bug: skia:14127 > Change-Id: Ib7183737ce126626328020e2130b78044d12d2a6 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/723406 > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Auto-Submit: John Stiles <johnstiles@google.com> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bug: skia:14127 Change-Id: Ie6636c9dd20d45d1369b5cfdc85e6a350b359891 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/723412 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> | 2 年前 | |
[includes] Enforce IWYU on sksl code PS1 regenerates the Bazel files. Use it as the base change when comparing patchsets. IWYU seems to do a good job of working with MyFile.cpp and MyFile.h, but if there is just a MyHeader.h, it doesn't always seem to throw errors if the includes aren't correct. This was observed with include/sksl/DSL.h This might be due to the fact that headers are not compiled on their own, so they are never sent directly to the IWYU binary. This change sets enforce_iwyu_on_package() on the all sksl packages and then fixes the includes until all those checks are happy. There were a few files that needed fixes outside of the sksl folder. Examples include: - src/gpu/effects/GrConvexPolyEffect.cpp - tests/SkSLDSLTest.cpp To really enforce this, we need to add a CI/CQ job that runs bazel build //example:hello_world_gl --config=clang \ --sandbox_base=/dev/shm --features skia_enforce_iwyu If that failed, a dev could make the changes described in the logs and/or run the command locally to see those prescribed fixes. I had to add several entries to toolchain/IWYU_mapping.imp in order to fix some private includes and other atypical choices. I tried adding a rule there to allow inclusion of SkTypes.h to make sure defines like SK_SUPPORT_GPU, but could not get it to work for all cases, so I deferred to using the IWYU pragma: keep (e.g. SkSLPipelineStageCodeGenerator.h) Change-Id: I4c3e536d8e69ff7ff2d26fe61a525a6c2e80db06 Bug: skia:13052 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522256 Reviewed-by: John Stiles <johnstiles@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> | 4 年前 | |
[includes] Reduce IWYU exports from SkTypes.h SkTypes.h was found exporting <stddef.h> and <stdint.h>. Thus if a Skia file includes SkTypes.h, it did not need to include either of those files to use things like size_t or uint8_t respectively. [1] This also resulted in strange IWYU warnings like: warning: size_t is defined in "include/core/SkTypes.h", which isn't directly #included. Thus, this CL removes those additional exports, and as a result, adds many more includes of <cstddef> and <cstdint>. The second change this CL is to not use the default IWYU mappings which are hard-coded into IWYU [2]. These defaults are valid, but make suggestions for the C version of headers and not the C++ ones (i.e. <stddef.h> over <cstddef>). To make these recommendations align better with our preferred style (the C++ ones), we use IWYU with --no_default_mappings and then have to expand our existing mappings to better deal with how IWYU would resolve some of these headers. [1] https://codereview.chromium.org/1207893002/#msg49 [2] https://github.com/include-what-you-use/include-what-you-use/blob/4c0f39615982c57a9cb313c971c6f45fca1cc1fe/iwyu_include_picker.cc#L1221-L1234 Change-Id: Iafebe190f8f3e86f252147b9f538c182bcc34af4 Bug: skia:13052 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/555516 Auto-Submit: Kevin Lubick <kjlubick@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Brian Osman <brianosman@google.com> | 3 年前 | |
Correct the writing errors in discardStatement(). Bug: b/0 Change-Id: I8811e1c8f82196de1fe70cefb3e683e8bc6fbc93 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1009537 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Thomas Smith <thomsmit@google.com> | 1 年前 | |
Fix for-loop variable scoping. For loop induction variables now share a symbol table with the for-loop body statement, rather than having a symbol table that is solely responsible for induction variables. This approach is modeled after the GLSL grammar, which uses a special statement_no_new_scope node for the body of a for loop. Bug: b/320478438 Change-Id: Icf0beffa62386c74a269cff3505f0d1d0af84123 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/802796 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> | 2 年前 | |
Rename definition of VLOG. This dates from the initial introduction of this code several years ago. If the source file is compiled in a way that pulls in Chromium's logging files, which #define VLOG, it causes a compile error. Bug: none Change-Id: Ie808ff3d5ed26e8e00c34f3a95e9894d94f0f421 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/741061 Reviewed-by: John Stiles <johnstiles@google.com> Auto-Submit: Peter Kasting <pkasting@chromium.org> Commit-Queue: Peter Kasting <pkasting@chromium.org> | 2 年前 | |
Use SkArenaAlloc for SkSL memory pooling. Previously we used GrMemoryPool, but this is only available when SK_GANESH is defined. SkArenaAlloc, on the other hand, is available everywhere. On my machine, the benchmark timings using SkArenaAlloc are basically the same as GrMemoryPool or even slightly better. We do sacrifice a leak warning, but I can't remember the last time I saw one (~everything uses smart pointers) and ASAN should still still be able to detect and report leaks. Change-Id: I84f5849ef1c9c30cd50eb744590aae7d7bc53523 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/686876 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: John Stiles <johnstiles@google.com> | 3 年前 | |
Move DSL and most private SkSL headers out of include/. We aren't supporting DSL as public API, so its headers have moved back into src/sksl/. Most SkSL references in include/private/ were in support of DSL, so these have been moved back into src/sksl/ as well. Change-Id: I9b7f965f9e77fb6e24de388d79db82c56b51bad3 Bug: skia:14183 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/671958 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> | 3 年前 | |
Reject SkSL programs that are larger than 8MB. The mesh specification fuzzer will replace certain bytes with attribute/varying names, in an attempt to help the fuzzer find more interesting programs. The fuzzer created a variable with an extraordinarily long name, then used control bytes to spam the name over and over again, turning a 7K input into over 8MB of output. This program overflowed the maximum offset of a Position. Because Position offsets are signed, this overflow turned the offset into a large negative number. The error reporter then attempted to read back a variable name from this negative offset. We now reject programs that are larger than 8MB. Bug: oss-fuzz:59150 Change-Id: Ieecc976749960e10085aa30fddf439c4b88712a0 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/700996 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> | 3 年前 | |
[graphite] Remove placeholder ES2 shader modules Change-Id: I2ec9b27450e1c42054d38c9167a4ab81e5f3c62b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/996117 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: James Godfrey-Kittle <jamesgk@google.com> | 1 年前 | |
Replace bug ids with mapped ids in the new issue tracker Bug references of the form: skia:NNNN crbug.com/skia/NNNN https://crbug.com/skia/NNNN http://skbug.com/NNNN skbug.com/NNNN skbug:NNNN are replaced with skbug.com/MMMMMMMM where NNNN maps to MMMMMMMM in the new issue tracker. Change-Id: Ifdc83c39e95e369135e1daa4ebb157977fecb36f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1002016 Auto-Submit: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brett Somocurcio <brettos@google.com> | 1 年前 | |
Eliminate SampleUsage::constructor. This seems to be a vestige from our .fp code generator. Change-Id: Iab7f4b11a467f11d6c0f6596995cc8d0c9a003c2 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/636820 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com> | 3 年前 | |
Move SkSLDefines to src/sksl/ It has no more uses in include/ Change-Id: Iefdf22e5b88625c84c1305a24184503e96561a98 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/753497 Commit-Queue: Kevin Lubick <kjlubick@google.com> Auto-Submit: Kevin Lubick <kjlubick@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: John Stiles <johnstiles@google.com> | 2 年前 | |
Move SkSLDefines to src/sksl/ It has no more uses in include/ Change-Id: Iefdf22e5b88625c84c1305a24184503e96561a98 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/753497 Commit-Queue: Kevin Lubick <kjlubick@google.com> Auto-Submit: Kevin Lubick <kjlubick@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: John Stiles <johnstiles@google.com> | 2 年前 | |
Remove SkSL::String class. The previous CLs have removed the last significant differences between SkSL::String and std::string. This CL removes SkSL::String entirely and replaces it with std::string throughout the code. Apologies for the very long CL, but I have done my best to make it as simple and reviewable as possible. The vast majority of changes are simple replacement of SkSL::String with std::string. In the rare spots where code is moved from one place to another, it is logically unchanged. Change-Id: I39563d2db45da229f17f4504dfd63e00bde7a96e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503339 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> | 4 年前 | |
[SkSL] Remove loadFloatBuffer intrinsic There is no longer a use-case for this intrinsic function since we can now pass unsized arrays as parameters in all Graphite backends using storage buffers. Change-Id: I7014562ae7f03c4ab0b6df56095e3e64747a0b86 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/883536 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: Nathan Sanchez <nathanasanchez@google.com> | 1 年前 | |
Only enable shader precision modifier usage for ganesh/GL * GLSL is the only shading language Skia generates shaders for that actually can use precision modifiers. Therefore, remove setting that flag for all other backends. * Some attributes that are only relevant for GL are nontrivial to relegate to ShaderCaps because they are referenced in backend-agnostic SkSL logic or may be needed for Dawn SkSL generation in order for Dawn to support GL. This CL adds comments identifying these. * I also aligned the comment doc style within SkSLUtil.h while I was poking around. Change-Id: I92c449cf16a36fbc6a317d78caa284a7a77468b1 Bug: b/445938112 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1060336 Commit-Queue: Nicolette Prevost <nicolettep@google.com> Auto-Submit: Nicolette Prevost <nicolettep@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> | 9 个月前 | |
Add unit test demonstrating structs in a module. The generated code is not yet correct; the struct from the module is not incorporated into the final output. Change-Id: Ib9a689237be69d9a80087202240f007cacfc2d41 Bug: b/320462028 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/805497 Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> | 2 年前 | |
[sksl] Support FB fetch in Dawn Bug: b/238756863 Change-Id: I3da7293c50c7e202f0eed71ba931a5abbb721ff8 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/779456 Commit-Queue: James Godfrey-Kittle <jamesgk@google.com> Reviewed-by: John Stiles <johnstiles@google.com> | 2 年前 | |
Guard both divisions in luminosity blend mode Bug: 359049360 Change-Id: I919ce7e198fcbb67ab35eea4e893ecfd3fba5434 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/895197 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> | 1 年前 | |
HDR v2: Add SkColorSpaceXform raster, graphite, and GLSL support Add a test suite that compares the results of color space conversion performed during SkCanvas::drawImage and SkColorSpaceXformSteps::apply with expected results. Bug: skia:420956739 Change-Id: I5326db9242bdd4dbd68614d46f249b58c1676655 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1006836 Reviewed-by: Christopher Cameron <ccameron@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: ccameron chromium <ccameron@chromium.org> Commit-Queue: Christopher Cameron <ccameron@google.com> Reviewed-by: Daniel Dilan <danieldilan@google.com> | 1 年前 | |
[graphite] Avoid swizzling + indexing within same line in vertex shaders * Doing so exposed what is likely a driver bug within Adreno GPUs. To get around this, this CL replaces indexing into swizzled containers with determining + using a rotated cornerID for simple indexing within all vertex shader SkSL. * This shows fixed output on GM_analytic_antialias_convex and on GM_stroke_rect_rrects on the Pixel 5. * Ganesh does not require this fix because it uses different shader code that does not encounter this issue. * Notably, the bug seems to manifest only within analytic_rrect_vertex_fn and not per_edge_aa_quad_vertex_fn where we also previously swizzled and indexed into a container within one line as well. I am not positive why this is the case, but regardless, this gets around our issues with analytic round rect render steps on the Adreno 620 GPU. * As expected, this change has no significant impact on performance on Linux (~20.3ms for GM_analytic_antialias_convex with and without the change). * This change seems to slightly speed up performance on the Pixel 5a (~14.1ms without the change (incorrect render result), ~13.4ms with the change (correct expected output)). Change-Id: I4c78390637e86e060d198c415136b1a890987c7d Bug: b/355630274; b/377927488 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1056217 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Auto-Submit: Nicolette Prevost <nicolettep@google.com> Commit-Queue: Nicolette Prevost <nicolettep@google.com> | 9 个月前 | |
Replace sk_has_side_effects keyword with $pure. Going forward, any function will be considered to be pure if it is marked with the $pure modifier. $pure is private and only allowed in modules. For reference, the old heuristic was both more complicated and less flexible: - User functions are never pure. - Module functions with a body are never pure. - Module functions without a body are pure when: - The function's name must be on the list of known intrinsics - The function must not have the sk_has_side_effects modifier Change-Id: I717a619e96f2d6b36561e403c0b6759752aaf8f9 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/583961 Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> | 3 年前 | |
CVE 514082801 Signed-off-by: whuqincheng <liweiyang1@huawei.com> | 14 天前 | |
Replace bug ids with mapped ids in the new issue tracker Bug references of the form: skia:NNNN crbug.com/skia/NNNN https://crbug.com/skia/NNNN http://skbug.com/NNNN skbug.com/NNNN skbug:NNNN are replaced with skbug.com/MMMMMMMM where NNNN maps to MMMMMMMM in the new issue tracker. Change-Id: Ifdc83c39e95e369135e1daa4ebb157977fecb36f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1002016 Auto-Submit: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brett Somocurcio <brettos@google.com> | 1 年前 | |
Add Graphite-only dehydrated modules. Graphite code snippets can be moved into these files; they will be compiled once at build time and dehydrated for later use. This allows us to avoid synthesizing and compiling them in each shader where they are referenced. (Unfortunately, the GPU driver will still need to compile them each time.) Change-Id: I5cdc5881d71d7b81a02c91a84d52804f2909b483 Bug: skia:13110 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532259 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> | 4 年前 | |
Remove trailing whitespace. Also adds a presubmit to prevent adding trailing whitespace to source code in the future. Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6 Reviewed-on: https://skia-review.googlesource.com/57380 Reviewed-by: Ravi Mistry <rmistry@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com> | 8 年前 |
Overview
SkSL ("Skia Shading Language") is a variant of GLSL which is used as Skia's internal shading language. SkSL is, at its heart, a single standardized version of GLSL which avoids all of the various version and dialect differences found in GLSL "in the wild", but it does bring a few of its own changes to the table.
Skia uses the SkSL compiler to convert SkSL code to GLSL, GLSL ES, SPIR-V, or MSL before handing it over to the graphics driver.
Differences from GLSL
-
Precision modifiers are not used. 'float', 'int', and 'uint' are always high precision. New types 'half', 'short', and 'ushort' are medium precision (we do not use low precision).
-
Vector types are named , so float2 instead of vec2 and bool4 instead of bvec4
-
Matrix types are named x, so float2x3 instead of mat2x3 and double4x4 instead of dmat4
-
GLSL caps can be referenced via the syntax 'sk_Caps.', e.g. sk_Caps.integerSupport. The value will be a constant boolean or int, as appropriate. As SkSL supports constant folding and branch elimination, this means that an 'if' statement which statically queries a cap will collapse down to the chosen branch, meaning that:
if (sk_Caps.integerSupport) do_something(); else do_something_else();
will compile as if you had written either 'do_something();' or 'do_something_else();', depending on whether that cap is enabled or not.
-
no #version statement is required, and it will be ignored if present
-
the output color is sk_FragColor (do not declare it)
-
use sk_Position instead of gl_Position. sk_Position is in device coordinates rather than normalized coordinates.
-
use sk_PointSize instead of gl_PointSize
-
use sk_VertexID instead of gl_VertexID
-
use sk_InstanceID instead of gl_InstanceID
-
the fragment coordinate is sk_FragCoord, and is always relative to the upper left.
-
use sk_Clockwise instead of gl_FrontFacing. This is always relative to an upper left origin.
-
you do not need to include ".0" to make a number a float (meaning that "float2(x, y) * 4" is perfectly legal in SkSL, unlike GLSL where it would often have to be expressed "float2(x, y) * 4.0". There is no performance penalty for this, as the number is converted to a float at compile time)
-
type suffixes on numbers (1.0f, 0xFFu) are both unnecessary and unsupported
-
creating a smaller vector from a larger vector (e.g. float2(float3(1))) is intentionally disallowed, as it is just a wordier way of performing a swizzle. Use swizzles instead.
-
Swizzle components, in addition to the normal rgba / xyzw components, can also be LTRB (meaning "left/top/right/bottom", for when we store rectangles in vectors), and may also be the constants '0' or '1' to produce a constant 0 or 1 in that channel instead of selecting anything from the source vector. foo.rgb1 is equivalent to float4(foo.rgb, 1).
-
All texture functions are named "sample", e.g. sample(sampler2D, float3) is equivalent to GLSL's textureProj(sampler2D, float3).
-
Functions support the 'inline' modifier, which causes the compiler to ignore its normal inlining heuristics and inline the function if at all possible
-
some built-in functions and one or two rarely-used language features are not yet supported (sorry!)
Synchronization Primitives
SkSL offers atomic operations and synchronization primitives geared towards GPU compute programs. These primitives are designed to abstract over the capabilities provided by MSL, SPIR-V, and WGSL, and differ from the corresponding primitives in GLSL.
Atomics
SkSL provides the atomicUint type. This is an opaque type that requires the use of an
atomic intrinsic (such as atomicLoad, atomicStore, and atomicAdd) to act on its value (which
is of type uint).
A variable with the atomicUint type must be declared inside a writable storage buffer block or as
a workgroup-shared variable. When declared inside a buffer block, it is guaranteed to conform to the
same size and stride as a uint.
workgroup atomicUint myLocalAtomicUint;
layout(set = 0, binding = 0) buffer mySSBO {
atomicUint myGlobalAtomicUint;
};
An atomicUint can be declared as a struct member or the element type of an array, provided that
the struct/array type is only instantiated in a workgroup-shared or storage buffer block variable.
Backend considerations and differences from GLSL
atomicUint should not be confused with the GLSL atomic_uint (aka Atomic
Counter) type. The semantics provided by
atomicUint are more similar to GLSL "Atomic Memory
Functions"
(see GLSL Spec v4.3, 8.11 "Atomic Memory Functions"). The key difference is that SkSL atomic
operations only operate on a variable of type atomicUint while GLSL Atomic Memory Functions can
operate over arbitrary memory locations (such as a component of a vector).
- The semantics of
atomicUintare similar to Metal'satomic<uint>and WGSL'satomic<u32>. These are the types that anatomicUintis translated to when targeting Metal and WGSL. - When translated to Metal, the atomic intrinsics use relaxed memory order semantics.
- When translated to SPIR-V, the atomic intrinsics use relaxed memory
semantics
(i.e.
0x0 None). The memory scope is either1 Deviceor2 Workgroupdepending on whether theatomicUintis declared in a buffer block or workgroup variable.
Barriers
SkSL provides two barrier intrinsics: workgroupBarrier() and storageBarrier(). These functions
are only available in compute programs and synchronize access to workgroup-shared and storage buffer
memory between invocations in the same workgroup. They provide the same semantics as the equivalent
WGSL Synchronization Built-in Functions. More
specifically:
- Both functions execute a control barrier with Acquire/Release memory ordering.
- Both functions use a
Workgroupexecution and memory scope. This means that a coherent memory view is only guaranteed between invocations in the same workgroup and NOT across workgroups in a given compute pipeline dispatch. If multiple workgroups require a synchronized coherent view over the same shared mutable state, their access must be synchronized via other means (such as a pipeline barrier between multiple dispatches).
Backend considerations
- The closest GLSL equivalent for
workgroupBarrier()is thebarrier()intrinsic. BothworkgroupBarrier()andstorageBarrier()can be defined as the following invocations of thecontrolBarrierintrinsic defined in GL_KHR_memory_scope_semantics:
// workgroupBarrier():
controlBarrier(gl_ScopeWorkgroup,
gl_ScopeWorkgroup,
gl_StorageSemanticsShared,
gl_SemanticsAcquireRelease);
// storageBarrier():
controlBarrier(gl_ScopeWorkgroup,
gl_ScopeWorkgroup,
gl_StorageSemanticsBuffer,
gl_SemanticsAcquireRelease);
-
In Metal,
workgroupBarrier()is equivalent tothreadgroup_barrier(mem_flags::mem_threadgroup).storageBarrier()is equivalent tothreadgroup_barrier(mem_flags::mem_device). -
In Vulkan SPIR-V,
workgroupBarrier()is equivalent toOpControlBarrierwithWorkgroupexecution and memory scope, andAcquireRelease | WorkgroupMemorymemory semantics.storageBarrier()is equivalent toOpControlBarrierwithWorkgroupexecution and memory scope, andAcquireRelease | UniformMemorymemory semantics.