IWYU doesn't always understand that we want defines to come from
certain files, so we add a pragma to force it.
This also adds an extra entry to known_good_builds so I don't miss
this type of thing again when building locally.
Change-Id: I2321ea95edfc6a4506d51a011983965eb9bdf1c0
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528164
Reviewed-by: John Stiles <johnstiles@google.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
- Implemented much of the statement/expression/program-element
parsing/dispatch boilerplate with support for only those expressions
that are necessary to successfully compile shared/HelloWorld.sksl
- Implemented functions and fragment/vertex program entry points
Most of the code for HelloWorld.sksl is now generated, however the
output program is still missing a correct propagation of varying stage
inputs and output parameters to subroutines.
Bug: skia:13092
Change-Id: Ic51af5a041761f58234d45e3746206ed080e0910
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526758
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
While I was fixing up Chrome's uses, I found some failures
there that I did not see in Skia, and tracked them down
to a few other places where we include SkColorSpace
and it is not strictly necessary
- SkCustomMesh.h
- GrColorInfo.h
- GrColorSpaceXform.h
- SkColorSpaceXformSteps.h
For these files (and their .cpp files), I added enforcement
of include-what-you-use, and then fixed the myriad of places
which were depending on these transitive includes.
One change to help Chrome is the manual overloads of
SkImage::MakeFromAdoptedTexture instead of using default
parameters. This makes it so callers of that function
do not need to include SkColorSpace if they were going
to pass nullptr for it anyway.
Bug: skia:13052
Change-Id: I16bf8ed5e258225d887f562f2c189623b1ca9c23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527056
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
gn flag `skia_compile_modules` now compiles the `sksl-precompile` binary
and generates dehydrated data. gn flag `skia_compile_sksl_tests`
now compiles `skslc` and builds the SkSL test corpus, but does not
generate dehydrated data. (skslc uses the raw sksl_xxxxx.sksl inputs
directly, not the dehydrated data, so this is safe.)
Change-Id: I96f6837b4312cd01309496da743a8a0e8a66d69e
Bug: skia:13164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528158
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This binary will be compiled when the gn flag `skia_compile_modules` is
set. sksl-precompile will replace for skslc for module precompilation in
a followup.
Change-Id: I217127169b091f97c2e4d11e0deb655ceac84425
Bug: skia:13164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527838
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This means that the UniformManager w/in the SkPipelineDataGatherer will
now collect all the uniforms into a single block of memory.
Bug: skia:12701
Change-Id: I504a014d37662619191d9b519b4e1add69eac8bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527837
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This appears to unblock the broken Dawn -> Skia roll
Change-Id: Ic6fbf0dfd57ca323a5286f293fea844047435776
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528078
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This removes the use of the dubious void* 'srcs' array.
Bug: skia:12701
Change-Id: I5078d48c119d4e84e83a78b10d0bd4a9a1d8cd8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527777
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
It wasn't clear from the docs, but linkopts are passed upstack to
dependents, so we can define them where we add source files which need
them.
No-Try: true
Change-Id: I376412682320e8802c7fd2a295a65af97650541d
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527697
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This adds a flag to enable or disable the vulkan memory allocator
(enabled by default). This flag only makes sense when vulkan is
also enabled, so the flag is marked private and a public
config_setting_group is made that ANDs "vulkan backend" and
"user wants vma" which is what we base our rules on.
There are few buildifier lint rules that get tidied up
as well here.
Change-Id: I089951050282afb87f01f505661c66fed920c73c
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527696
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
The implementation is inconsistent across CPU and GPU.
CPU currently always implements kStrict even when kFast is passed.
For mipmapping this means computing a set of levels from the subset,
which is an expensive.
GPU limits the texture sampling coordinates to the subset in the
base level. However, higher level mipmap pixels that map back to
a footprint outside the subset are still sampled. So GPU pays a
higher shader complexity cost without really providing the benefit
of kStrict.
We are adding anisotropic filtering, which will not work well with
kStrict, and thus will also be disabled by kStrict.
Must land after https://chromium-review.googlesource.com/c/chromium/src/+/3571661
Bug: skia:10481
Bug: skia:13078
Bug: skia:13036
Canary-Chromium-CL: 3571661
Change-Id: I011b8698a3f9fafa9b819486873c8ff54df6299e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527284
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 2e6f60f423.
Reason for revert: draws black incorrectly in various iPhone 8 tests
Original change's description:
> Fix color fringes on blend_hue and blend_saturation.
>
> Previously, we checked for division against zero, but didn't do anything
> to prevent division against extraordinarily small values. Now, we only
> saturate if the delta between max and min is greater than 0.00001.
>
> Change-Id: I7d1df3430941c7e1a7f94e597d5449f9259612d6
> Bug: skia:9320
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527498
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:9320
Change-Id: Id83376080eed684577b3592c5e1bee3c80fc3fc9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528038
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
This addresses (hopefully) all of the remaining suboptimal positions in
SkSL error reporting.
Change-Id: I5bc977b03d51153b841a89fa687e54e3e9cb6ec3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527976
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This cleans up a lot of positions produced by DSLParser to make them
actually match the ranges of the elements being parsed.
Change-Id: Ic3a9d62c99c4b5f92b84a597a2ceba386bbcc334
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527501
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This is moving to the world where the SkPipelineDataGatherer holds
a UniformManager. In that world the UniformManager will need to
incrementally allocate the uniforms it is collecting.
Bug: skia:12701
Change-Id: I6ed26948d7d0f2979130c4908d0c34c32604cd75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527736
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12698
Change-Id: I3744b281a3d22bde5adeea4f909ca65e4e4d3cfe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527279
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
With UniformData being stored in a arena and TextureData still being
held by unique pointer, the PipelineDataCache needs to be able to handle
both.
Longer term, TextureData will also be held in an arena and this
split will go away.
Bug: skia:12701
Change-Id: Iab6c6542fbce4f886410f985e6c93ddaa125152e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527504
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
`writeStatement` has the potential to emit a trace_line op. In practice,
right now our function's outer Block never has a position, so there is
no difference. However, Ethan's position-related work will add a
position to this Block, which would expose this issue and break tests.
Change-Id: I810edbc9b82feafd471cbcacf062aa14c8a66ba8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527841
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Introduce a new WGSL codegen backend. It currently only supports
fragment/vertex stage input and output variable declarations.
Bug: skia:13092
Change-Id: If9e4e432794eb95fd33719be5c0141dfc2cb5680
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526757
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
No functional changes; just a code cleanup now that this is possible.
Change-Id: I2d153e22058c2b9be8e1dc4f2ad9ccc186bff120
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527657
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
It was already a no-op.
Bug: skia:13078
Change-Id: I7c7e1a86650ebdbd79bfcc4c1e739a3901345e76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527836
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
We already performed a matching simplification for `0 - x`, so this
seemed like a straightforward improvement.
Performing this simplification causes the expressions in the test code
to match on both sides (e.g. `-one == -one`) which allows them to fold
away.
Change-Id: Idf87a98024dd6831b45d0384285ead2e2e039493
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527656
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
We use multiplication by 1 or -1 to branchlessly choose one of `min` and
`max` in the same function.
Change-Id: I44cf747feeae75a9c3e00f36e112e0a429871e86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527596
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: Id8d943b3eb752bad7f45c852c832c1f1fa0bdaca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527776
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Hard-light is just overlay with the parameters reversed.
Change-Id: I6cf5963b1252cba3a7b71a56f4094a070188f8b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527503
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
These functions were functionally almost identical, except:
- Sometimes sda/dsa are flipped
- Sometimes the saturation is not updated
We now have one method (blend_hslc) which can do all four blend
operations. It takes two new parameters ("flip" and "saturate") to
handle these four variations.
This reduces our shader count on some of our most shader-heavy slides
(e.g. aaxfermodes, xfermodeimagefilter) at a pretty reasonable cost.
Change-Id: Ifa8a48399851a9badb5d50038de1e25e60d44ebd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527281
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This will allow expressions like `-x == -x` or `!y == !y` to be detected
as matching expressions (which enables various constant-folding paths).
(Also, migrated the analysis code into a separate cpp.)
Change-Id: I3e317fdaed3762f8fa19e684a5ed557fc9348c7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527617
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
The clip isn't actually applied, but clip stack manipulation is wired
up. This may have a slight impact on how things draw because the device
clip bounds now reflect the clip actions, and that is currently used as
each draw's scissor.
Bug: skia:12698
Change-Id: I1d2e9cea49762dbfaa008c7c6af6034387b62519
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526917
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This avoids a situation where we didn't know the position of a binary
expression while we were in the middle of evaluating it, which was
leading to problems with upcoming error reporting changes.
Change-Id: Ie41fa82d077de1aa1041cd84c539ba29aaa2f5f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527500
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This avoids a situation where we didn't know the position of a postfix
expression while we were in the middle of evaluating it, which was
leading to problems with upcoming error reporting changes.
Change-Id: Ie6d4dd8411ffb24ac7ee95d3e908483d0d92ba0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527499
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This change does the following:
* Removes 2 Golo Test-TSAN_Vulkan jobs because their counterparts already exist in Skolo.
* Moves 1 Golo Test-TSAN_Vulkan job to Skolo.
Bug: skia:13129
Change-Id: I28b40320c831d109aa4f8778ddc1d03be9473592
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526916
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
This adds egl through swiftshader to unix builds as a separate build target, supporting cl in g3
Change-Id: Ied8c413e9dee0f78f25cbcec1bf937a5eb55dd60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526676
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Followup CLs will improve their output.
Change-Id: I07059348f68cd6cd3154c31a41f81018b26a44e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527616
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>
Previously, we checked for division against zero, but didn't do anything
to prevent division against extraordinarily small values. Now, we only
saturate if the delta between max and min is greater than 0.00001.
Change-Id: I7d1df3430941c7e1a7f94e597d5449f9259612d6
Bug: skia:9320
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527498
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: Ibff49d1928d7f82d04930c8cfd9d574780732c0d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527497
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
We were not propagating the position into a double-negated expression,
leading to an assertion failure in PrefixExpression.
Change-Id: I1970ff1a06d9631582626c68e151f12f6b3ef278
Bug: oss-fuzz:46381
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527507
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>