This allows processing to continue in the face of invalid array sizes,
matching the error reporting behavior of SkSLParser.
Change-Id: Ifc0572aecf829563e4a77f01962a6e05aa9e98e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444761
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Change-Id: I06ba9dd9ed8af8555233ddfa10d3e0ec6babc2ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444759
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
There was no good reason for this behavior in the first place, and this
change makes the error reporting behavior better match SkSLParser.
Change-Id: I7b69e7bcc64173c0ac6523e075c1f24e2be00ed0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444758
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Most of the logic in IRGenerator::finish has moved to
Compiler::finalize. The @if/@switch pass has been combined with the pass
that verifies no dangling FunctionReference/TypeReference expressions,
saving one walk through the IR tree. Most program-finalization logic now
exists in Compiler and Analysis.
This change reorders our error generation logic slightly, and manages to
squeeze a few extra (valid) errors out of one of our fuzzer-generated
tests, but is not really intended to affect results in any significant
way.
Change-Id: I461de7c31f3980dedf74424e7826c032b1f40fd2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444757
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>
As these checks were in the AST processing side of things, they were not
catching errors in DSL code. SkSLAnalysis is also a better home for this
function than SkSLIRGenerator.
Change-Id: I8149825047570300cc09425deba1339ac0edb7ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444656
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This doesn't rely on anything Compiler-specific, and can just be a plain
Analysis pass.
Change-Id: I8564ae2a750c6daa6c449e6fa56355cc047f7010
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444496
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:11837
Change-Id: Ia79f76c18587741000367edba303c5f7c0c1087d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444178
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This matches the behavior of SkSLParser and fixes some spurious
followup errors.
Change-Id: Id1eae353eb6536a6385d04d0426e0de736db6b57
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444360
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This adds line numbers to a bunch of errors which were previously
missing them.
Change-Id: Id77c08d168b0a2d8a0131a53aa004bf37b8bec02
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444176
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Chromium has been updated, this is no longer needed
Change-Id: I0bcf65c79d454c50796e04e33c213de2295c0e6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441877
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This fixes spurious errors that occur subsequent to an error converting
and array size.
Change-Id: I23fda9ef744f9144726d4fd28584676b33a4c7bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444177
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This eliminates an extra "expected int literal" error when the
array size is an invalid expression.
Change-Id: Iaf5d15316df3ec5200d51d73c14d7e428ce17be9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443236
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Change-Id: I0fdaf04525f02e8827839a0f43bb9181309cbb56
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444137
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
The fuzzer discovered that, when we attempt to verify that an array
doesn't contain any literal values that are out-of-range for its base
type, we pay a linear-time cost based on the size of the array. This
happens even when the array value isn't known at compile time; we still
iterate over its slot count and diligently discover that every single
constant-subexpression slot in the expression is "null".
We now have a helper function on Expression,
`allowsConstantSubexpressions`, which only returns true for expression
kinds that can contain constant subexpressions. We use this helper to
skip over this linear-per-subexpression check when the expression
cannot possibly contain a constant subexpression. In particular,
`AnyConstructor::compareConstant` and `Type::checkForOutOfRangeLiteral`
will now early-out for expressions that can't possibly contain a
constant subexpression.
Change-Id: Ia34e422afa67b478a8616acb0a0e9cd211b29698
Bug: oss-fuzz:37900
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444136
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>
This adds position tracking to individual fields and an error for
illegal field modifiers.
Change-Id: Ie121699bde94e831f33a0bc021349a1cd757d08b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443888
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
A few nice properties fall out of this:
- IntrinsicSets become an implementation detail that most code never has
to think about.
- The dehydrated data is marginally smaller because it no longer needs
to store the IntrinsicSet array; it's re-derived when the
FunctionDefinition is created via Convert.
finalizeFunction is largely unnecessary now, but it still had one
lingering use; it appends the sk_Position fixup to the end of main()
when compiling a vertex program. Added appendRTAdjustFixupToVertexMain
to IRGenerator to handle this case. This could be done in Convert as
well if the RTAdjust fields weren't buried inside of the IRGenerator.
Change-Id: I7451ea9c64112a376ad36902d36c29a9cf147504
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442817
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
I want to free up GrD3DTypesPriv to actually be private types that
include real d3d objects.
Change-Id: Id38d6baae4fa68c19301b27d4f9d51eb1d9c5db0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443676
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
With this change, it will either match or improve on the reports we
currently get from SkSLParser.
Change-Id: I9b3c0f0c2225bf47fec141a1c01c94d9c2ab6a6b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443056
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This fixes some spurious errors being reported by DSLParser.
Change-Id: I824896b88c2d208aac13cc8f597a2f949b831196
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443057
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This reverts commit 9a0302cd9d.
Reason for revert: layout tests suppressed
Original change's description:
> Revert "Simplify SkRasterClip now that it's only intersect/diff"
>
> This reverts commit 75bab9249d.
>
> Reason for revert: Experiment to see if blocking Chrome roll
>
> Original change's description:
> > Simplify SkRasterClip now that it's only intersect/diff
> >
> > Bug: skia:10205
> > Change-Id: Id29a63783bd38e5977e94bf8e8d7fbb4fe16cb51
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442279
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=reed@google.com,michaelludwig@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
>
> Change-Id: I1ceeccf880a139dc9236b7df17e3599f8cae611f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10205
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443414
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
# Not skipping CQ checks because this is a reland.
Bug: skia:10205
Change-Id: I13a49190c67e5e32431ea268312ede60c55798b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443897
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This moves the functions for dealing with child effects into the public
module (where those types already live). With that change, blend and
colorFilter have no module-specific declarations.
Change-Id: I7665e68427ea4d8d1ed4d31afb658edb79bac5a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443412
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Bug: skia:12086
Change-Id: I5564e4981575cab546e4d2d0470656b0aff204c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443877
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This matches the behavior of SkSLParser
Change-Id: Ib9af7173dda8866faf8633b8c88a8716b4e6b8d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443239
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This fixes an issue where the field modifiers were incorrectly applied
and adds proper error detection to the modifiers.
Change-Id: I8cd88d3a459df81250c267e6007bca9663b7eda4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443237
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
We get better error reports by simply continuing in these cases.
Change-Id: I9e5fd4fe3afca601bb20a23376b6b098e909106f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443238
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This fixes a spurious complaint about a missing semicolon.
Change-Id: I6e310e098ffb9e90c973af1e47bc3572781af296
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443216
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This was previously resulting in the error "array size must
appear after variable name". We're presumably also going to need
another fix elsewhere to add this error back in when it applies,
but that's going to be a separate CL.
Change-Id: I18164b4ebb82a22944637c3380d8a9d4fc86d0c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443177
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This allows for correct line number information in errors relating
to layouts.
Change-Id: I8df02f434d3565cb466074742780424b67ce4a8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443240
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
DSLParser caught a duplicate function name in here that SkSLParser
wasn't reporting.
Change-Id: I428c7ec64d1b625d9d12c6b7acdb23b52a0d7b89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443241
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
These scripts are useful when testing WebAssembly locally
because the mimetype impacts how the binaries are loaded.
The porting was achieved by doing the following:
python -m lib2to3 -w -n serve.py
Change-Id: I09673fa881339a9b157c5fc993e190766efcd85e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443884
Reviewed-by: Erik Rose <erikrose@google.com>
This will be useful when trying to determine the flattened size of a
program, and it is expensive to compute on demand.
Change-Id: I232d9189511502d4783e5542a9bfe0dff8ea8c4a
Bug: skia:12396
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443883
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Width*height could actually overflow on relatively reasonably sized
integer rects, so this restructures the computation to use relative
area (compared to A) instead of total area. The relations are the same
but it avoids the multiply.
Bug: chromium:1244411
Change-Id: I5bfcfba80835da07b9929f532fc3b40b330a1199
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443876
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This fixes redundant "not a function" errors when we have already
produced an error resolving the target of a call.
Change-Id: I94876ec09feac399108033d1b850e78c7750dd1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443411
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
fetch-sk is no longer Python 2 compatible, and not all machines default
to Python3 (the Mac terminal still defaults to 2.7).
Change-Id: I6244ee591bbe787ef2dba46da2b20446265e42b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443406
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
3a9df22fcc..2751780112
2021-08-31 cnorthrop@google.com Capture/Replay: Set texture buffer offset alignment
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC fmalita@google.com on the revert to ensure that a human
is aware of the problem.
To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Tbr: fmalita@google.com
Test: Test: Fortnite MEC
Change-Id: I3c321ee52054a770dd7ac6a786adda8f8779d431
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443765
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>