Internally, these can be very useful for assembling code fragments.
Externally, our users shouldn't have any SkSL::Statement or
SkSL::Expression objects to pass in, so it's still effectively a non-
public API.
Change-Id: I03b88507ce932b472ab5b9aed68ea67dcd10b13f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449855
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Unreachable code might contain the only reference to a variable or
function. We can eliminate those variables/functions if we remove the
unreachable code first.
(Are there counterexamples where this order leads to worse results? I
couldn't think of any, and pragmatically it didn't show up in any of
our existing tests.)
Change-Id: Ic9f0222851269e0c37eb9570547307998f882b6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450156
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
`increment` and `float a` could be eliminated, but are not.
This is fixed in a followup CL.
Change-Id: I7a5c3ab7341f40020f84f157b08a7152bc067af0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450276
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Doing some finer-grained testing, I found that some tests weren't broken
on Adreno 600 even though they were problematic on older GPUs/drivers.
Change-Id: Ib10424310a65e872aef5140aeb36cf29704de2c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449847
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This reverts commit 6aac1193a7.
Reason for revert: Breaking Mac bots in Chromium roll. Looks like
they depend on getVkImageInfo for an unknown reason, and it's
hidden behind SK_VULKAN.
Original change's description:
> Add new GrSurfaceInfo class and related backend structs.
>
> Bug: skia:12402
> Change-Id: I45b2f71dcfa5843e2a19a8de7d34196a4d552905
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445176
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:12402
Change-Id: I3c9642354dae8c955bc58d281700536393f84519
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450199
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit c50fefbba7.
Reason for revert: Many issues with GMs
Original change's description:
> Defer the attachment of GL stencil buffers
>
> This will allow us to use a single FBO for
> EXT_multisampled_render_to_texture, that we modify on-demand depending
> on whether we need MSAA.
>
> Bug: chromium:1222095
> Change-Id: Ife2d743e28833521d785e4bf0e20de593c492a9a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442736
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: chromium:1222095
Change-Id: I0d921b0298d535942ef3fd332522b14244aa9ce3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450197
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 949dfb5ffd.
Reason for revert: Reverting to revert parent CL.
Original change's description:
> Use a single FBO for EXT_multisampled_render_to_texture targets
>
> Uses a single FBO and changes the attachments based on whether we need
> multisample or not. This is an effort to work around presumed driver
> bugs from having the same texture bound to different FBOs with different
> sample counts.
>
> Bug: chromium:1222095
> Change-Id: I1347a149524be95181a4d3fb0a0da7bfe92a2ec9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442737
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: chromium:1222095
Change-Id: I1647c21d04348daae1636d7e637faf6fa604b0df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450196
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 6694a36a7f.
Reason for revert: Issues with Adreno GMs.
Original change's description:
> Don't keep a non-msaa FBO with EXT_multisampled_render_to_texture
>
> This seems to cause bugs on various platforms. Instead, do the same
> thing we do for dmsaa: reconfigure a single FBO as msaa or not,
> based on need.
>
> Bug: chromium:1222095
> Change-Id: I4ca4aff32772ee2a9607c92c586ae9494f955229
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442565
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: chromium:1222095
Change-Id: I060988c63edbfeb628d5a6c34cda3e159066114a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449918
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Disappointingly, these GPUs have trouble assembling a matrix from a mix
of vectors and scalars.
Change-Id: I324837d6e3ac33fd8c23546154f496120636bad4
Bug: skia:12456
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449846
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This seems to cause bugs on various platforms. Instead, do the same
thing we do for dmsaa: reconfigure a single FBO as msaa or not,
based on need.
Bug: chromium:1222095
Change-Id: I4ca4aff32772ee2a9607c92c586ae9494f955229
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442565
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Uses a single FBO and changes the attachments based on whether we need
multisample or not. This is an effort to work around presumed driver
bugs from having the same texture bound to different FBOs with different
sample counts.
Bug: chromium:1222095
Change-Id: I1347a149524be95181a4d3fb0a0da7bfe92a2ec9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442737
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Missed a case when eliminating optional/wrapper in an earlier CL.
Change-Id: If7f80ea6e2172acadf7b0087fe1a05853ccae445
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449838
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Instead of manually maintaining them, which is error prone.
Change-Id: If78a564e4afe238d195b952fea276154b2e12b06
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449917
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
This will allow us to use a single FBO for
EXT_multisampled_render_to_texture, that we modify on-demand depending
on whether we need MSAA.
Bug: chromium:1222095
Change-Id: Ife2d743e28833521d785e4bf0e20de593c492a9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442736
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Change-Id: If3e838f22f1b99fd7a3b1c6bca0affd39f5573b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449843
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Change-Id: I0d924a2bce1f1a90b2603c593b786bb1610e3d04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449597
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This will allow us to use AutoSymbolTable in more places (and helps cut
down IRGenerator, as we transition away from it).
Change-Id: Ie88c149e0f7eee080a8a4c8cbbc34c8a2a5401d1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449756
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This reverts commit ae59426ea6.
Bug: skia:12182
Change-Id: I591a0a89ffad1a3d5d867dd247ceeec71b6041a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449516
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: chromium:1203327
Change-Id: I36de6f9ad0bba04854911cf8d060b7a754e116f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449058
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
We're being stricter in V2 wrt this. This CL is an experiment to see if this fallback is actually relied on.
If this sticks we can unify the two (SFC & SDC) code paths in makeSFCFromBackendTexture.
Change-Id: I77815e0aa63d0910d8f8f38ec1f047b83750e109
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449678
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:11837
Change-Id: I334cdeb75db1a80a35d333faa26aec4999bd6bb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449677
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
As of http://review.skia.org/449518 we no longer allow matrix
constructors containing vectors that spill across multiple columns; it
doesn't reliably work on all GPUs. The tessellator needed a small fixup
to support this new limitation.
Change-Id: I82853b6c8ae83597aab3eab611dd10072d23eca5
Bug: skia:12443
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449836
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
The existing define wasn't being used to compile :skia
(but it is for building the fuzzer code).
After this lands, oss-fuzz will be updated to set that
flag too. https://github.com/google/oss-fuzz/pull/6462
The change to SkTypes.h is to remove bit-rotted code that
prevents oss-fuzz from working.
Change-Id: I95b48d76dd3878d04ba3a5d021359ca200c20a0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449576
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This will allow the code to be reused outside of the Inliner.
Change-Id: I9e68a12d14143add6a5a24f408a645af20d4e2b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449193
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
The GLSL spec allows matrix constructors containing vectors that would
split between multiple columns of the matrix. However, in practice, this
does not actually work well on a lot of GPUs!
- "cast not allowed", "internal error":
Tegra 3
Quadro P400
GTX 660
GTX 960
- Compiles, but generates wrong result:
RadeonR9M470X
RadeonHD7770
Since this isn't a pattern we expect to see in user code, we now report
it as an error at compile time. mat2(vec4) is treated as an exceptional
case and still allowed.
Change-Id: Id6925984a2d1ec948aec4defcc790a197a96cf86
Bug: skia:12443
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449518
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
It now lives in the Compiler instead of the Inliner, and we have a
pointer to it inside the Context. I also took the opportunity to remove
a few unnecessary #includes from Context and fixed up the fallout from
this.
POTENTIALLY IMPORTANT FOOTNOTE: DSLWriter has its own Mangler object
inside of it. I experimented with removing this and having it share the
Mangler object inside the Context, but this caused failures in
"testThreading" and "testpersistentcache" CQ bots; the Expected and
Actual images would mismatch. (The Expected would be missing some
draws.) This particularly affected some blur-related tests which are
likely to be GaussianConvolution--i.e. it uses DSL.
This might be a canary in the coalmine for some quirky DSL threading
issue? e.g. using the same Context on two threads at once?
Change-Id: I2290b810d9487c40a3dbef119c95d1572b14a5ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449357
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Not a big deal from a performance standpoint, but it's still unnecessary
work that produces uglier code.
Change-Id: Id0153fffe0bac7275f8d2b0d68fb6977de5f9e8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449676
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug 36932:
Adds a lower limit when fuzzing dash path effects, since it can produce
paths with > 140k verbs. While this is not that much memory on its own,
the triangulating path renderer can require 3+GB to complete its work
(although it doesn't actually fail).
Bug 36945, 37042:
Also has PathToTriangles check for finite paths before starting any
triangulation work. These paths were created with infinities and NaNs.
Normally such a path would be rejected at a higher level in SkCanvas.
Since the triangulator is being fuzzed directly, this emulates this.
It's included in GrTriangulator and not the fuzzer's main function
because it's a cheap test and theoretically we could encounter a path
that was built lower down (e.g. dashing or transformed to device space)
that then overflowed.
Bug: oss-fuzz:36923, oss-fuzz:36945, oss-fuzz:37042
Change-Id: If97212bf410f771b42cebaedb5733af1abbfc4b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449520
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
DSLParser is #ifdef'ed out, so this doesn't currently impact anything,
but is necessary to be able to reenable the DSLParser.
Change-Id: I76d48b1b855f42ba3bc8b0734199af6e2a88becb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449517
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:11837
Change-Id: Iaa0349749a5d79d7915fb37ef1b30b46f0aa58d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448796
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is more lightweight than String and avoids a handful of copies.
Change-Id: Iad72a1b1027877f41bab10eeeaa340f2823a0896
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449359
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>