This has been replaced by findOrCreateRuntimeEffectSnippet.
Change-Id: I26e1f85c74071b14b75ab86410e4cc30a81bf873
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552716
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This checks the padding of a matrix followed by a scalar/vector, and the
padding of a scalar/vector followed by a matrix. The checks support
all mixes of 16- and 32-bit sized elements.
After some investigation, this CL also removes some TODOs in
`get_ubo_aligned_offset`. Our uniform system does not support structs,
which is a large source of disparity between layouts. With structs
removed from the equation, the only difference between layouts seems to
be related to std140 array padding. (std430 and Metal seem to be
entirely the same.)
Change-Id: I76c48ae1e597b98aad8a8f8495ab4a8ad262845b
Bug: skia:13478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/556356
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Thankfully, this was already working; no changes in the uniform manager
were needed.
Change-Id: Ic2c4807e8efa63a05127d6f96d8a58ce785bbc1e
Bug: skia:13478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/556316
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
The UniformManager would previously assert if it detected an alignment
error, but did not actually have any mechanism for automatically adding
padding between misaligned elements. If a user specifies a uniform
layout like `uniform float a; uniform float4 b;`, we now insert padding
between `a` and `b` so that `b` will be properly aligned. (This reuses
the logic that was originally used to trigger the alignment assertion.)
This CL fixes the bug and adds a test. The test is only active for
elements of matching size; mixed half- and full-precision elements
will need improved test logic.
Change-Id: I8c04eb6350fa73bdbcd1a08e1a45b17fee0d4194
Bug: skia:13478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/555440
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
The Stride() function in the UniformManager, when given a matrix type,
was intended to return the stride of a single matrix column. However, it
accidentally called `Stride(1)` instead of `Stride(kNonArray)`, which
meant that it was returning the stride for a `vec2[1]` (four floats)
instead of the stride of a `vec2` (two floats). Interestingly, this
still returned the correct answer for mat3 and mat4, because `vec3`,
`vec4`, `vec3[1]` and `vec4[1]` all have the same stride--four floats.
This CL fixes the bug and adds a test.
Change-Id: I9c06b7da7253a86c1d9545c7e177bc916b49c9b9
Bug: skia:13478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/555161
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
std140, std430, and Metal all agree that non-array vec3 types should
pack like the equivalent vec4.
std140: http://screen/5NHiYze3sk4CbWv
std430: http://screen/8G6CuomyEkxge5t
Metal: http://screen/7t9LfvmuZmtJ4zq
Our Stride() function in the UniformManager, however, did not pad out
vec3 types. This would manifest as an assertion when the _next_
uniform was added; we would assert because get_ubo_aligned_offset
would mismatch our expected values.
This CL fixes the bug and adds a test.
Change-Id: I33f04f37d68b0099236576f69250ed73d9e010cd
Bug: skia:13478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554404
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
The pattern of treating Metal half-precision uniforms differently was
affecting both existing and upcoming tests, so it's factored out to a
helper function.
Also, added in calls to `doneWithExpectedUniforms`--these aren't
required, but it will give us more thorough test coverage.
Change-Id: I3f76a775816242cd1e5de9be1a96486738ddb12f
Bug: skia:13478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554998
Reviewed-by: James Godfrey-Kittle <jamesgk@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: James Godfrey-Kittle <jamesgk@google.com>
Similar to floats, Metal expects short-int uniforms to be passed in 16
bits, but other layouts always use 32 bits for integers.
Change-Id: I99575349d8547876ab6dab00f393158fbeea5385
Bug: skia:13478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554345
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Bug: skia:13430
Change-Id: I4958b0d14f7805889ed2061fe929778f69d40c48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549566
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This test verifies that float scalars and vectors can be added as
uniforms. In Metal, this is a particularly interesting challenge because
we represent half values as 16-bit floats.
Change-Id: I4ce2280a61afee905ac5980792b6dbe6e4be572f
Bug: skia:13478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554344
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 6c05f9064f.
Reason for revert: fixed in release
Original change's description:
> Revert "Create simple unit test for UniformManager types and layouts."
>
> This reverts commit c42782ad74.
>
> Reason for revert: breaks in release
>
> Original change's description:
> > Create simple unit test for UniformManager types and layouts.
> >
> > The first test is an extremely simple check (can we create a uniform of
> > every allowed type in every layout?) and already uncovered a bug, so
> > we're off to a good start.
> >
> > Change-Id: If9d6aa9c0845727c5422185094711734951c2e0a
> > Bug: skia:13478
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554339
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
>
> Bug: skia:13478
> Change-Id: I75c051c3daee63cad0ffd55e3823d9eb333980ee
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554398
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bug: skia:13478
Change-Id: Ic8fafda7c2149cbb07e3469fe7165787e110114e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554400
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This reverts commit c42782ad74.
Reason for revert: breaks in release
Original change's description:
> Create simple unit test for UniformManager types and layouts.
>
> The first test is an extremely simple check (can we create a uniform of
> every allowed type in every layout?) and already uncovered a bug, so
> we're off to a good start.
>
> Change-Id: If9d6aa9c0845727c5422185094711734951c2e0a
> Bug: skia:13478
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554339
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
Bug: skia:13478
Change-Id: I75c051c3daee63cad0ffd55e3823d9eb333980ee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554398
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
The first test is an extremely simple check (can we create a uniform of
every allowed type in every layout?) and already uncovered a bug, so
we're off to a good start.
Change-Id: If9d6aa9c0845727c5422185094711734951c2e0a
Bug: skia:13478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554339
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Bug: skia:13357
Change-Id: Ib2566e9c38f667368b20f18ed2b1851615602cad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548480
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:13430
Change-Id: I6c577b459bc3a699e6c660d21d2b119643fe1f88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553877
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Graphite expects uniforms to be passed in as a span of SkUniforms.
When making a runtime effect, we now convert the SkRuntimeEffect's
`Uniform` data into SkUniforms as well.
I briefly looked at sharing a single uniform type, but
SkRuntimeEffect::Uniform is public API, so changing it is non-trivial,
and Uniform would not be usable as a direct replacement for SkUniform.
(Uniform is non-POD since it contains an SkString; SkUniform is POD
and we declare a bunch of them at global scope. Also, each class
represents types using a separate enum.)
Change-Id: Idef2141d3a4860529719382840a157b7b0c41643
Bug: skia:13457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553595
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
`findOrCreateRuntimeEffectSnippet` takes a pointer to the runtime effect
and returns a code-snippet ID associated with the runtime effect, with
matching uniform layout, etc. The SkShaderCodeDictionary will maintain a
persistent map from {sksl-hash, uniform set} to code-snippet ID.
http://go/runtime-effects-in-graphite
Change-Id: I9c51667aad96f850184899f3df00a8206a1fe354
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552686
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Pointer data is obliterated when we assemble draw passes, so this
feature didn't work for its intended purpose.
Change-Id: I85331aa7b6212c55fe16081937465c2f38e5a103
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552718
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This reverts commit fc51827b56.
Reason for revert: Appears to have broken Mac (https://logs.chromium.org/logs/skia/5baefe22efa21e11/+/steps/dm/0/stdout)
Original change's description:
> Add removeUserDefinedSnippet method to ShaderCodeDictionary.
>
> We need to purge out user snippets when they are no longer needed, to
> avoid unbounded memory usage.
>
> Change-Id: Ib33909ec8c94cd6272f1a28e52a7ab92b27dfb0d
> Bug: skia:13405
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552577
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13405
Change-Id: I914eca4f017697fc4c82316b805ebaaa8c72e162
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552679
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
We need to purge out user snippets when they are no longer needed, to
avoid unbounded memory usage.
Change-Id: Ib33909ec8c94cd6272f1a28e52a7ab92b27dfb0d
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552577
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
If we are going to create a new snippet ID every time a runtime effect
is painted, we will overflow a byte very rapidly.
Change-Id: Ic094af2a81e590488bf90b60492b004e9135d4a2
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551843
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
We can now fully round-trip pointers through a PaintParamsKey safely.
Change-Id: I1a2133b39d895996f6c94211a0c5741ad0933398
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550703
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This undoes http://review.skia.org/550018, and also eliminates the
pointer-related additions to Stack in http://review.skia.org/550179.
When this was originally added, the plan was that pointers would not be
represented in the data payload at all, so we needed a mechanism to
track whether pointers were needed for each snippet type. This is now
handled by the existence of the kPointerIndex data payload field--
you'll assert on field-type mismatch/missing field if you skip the
pointer.
Change-Id: Ie868526d8d9da47819ea08e16aab1a5566f9cff8
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550700
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
It has served use well, but its time to let it enjoy its life in
retirement.
Change-Id: I47213a7a74a890aa0b04e906fb236c7cc4aabb61
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550621
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
The API for keys containing colors was unfinished--there was a way to
add a single color to a key, but there were was no support in
BlockReader to read the color back out, and only fCount == 1 was
supported.
This CL fills in these gaps, and adds a test verifying that SkColor4f
data can round-trip through a PaintParamsKey successfully.
Change-Id: I9586fbd59e1a091970f44751322c03ad493888f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550698
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This will give us stable data in the payload, so that the key itself
will match with operator== regardless of the pointer value. We can
extract pointers from the pointer-data block efficiently, even in the
case of multiple/nested children with embedded pointers, by using the
pointer-index value to fetch from the pointer-span.
Change-Id: Ic3b5f823a631257fd50ec6989b7c0fd1c70e6178
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550497
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This was originally done with the intent of adding a third field
(number of pointers in the data) but we may be able to get away with
keeping the two-byte Header after all. Having the data in an actual
struct does make refactoring a lot easier, at any rate.
Change-Id: I25a4e46b45f3f9c93eb16bc4d51b6624d7e319ba
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550183
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:12701
Change-Id: I53bbabb2aba44e3bfc215df81dae1ae59d149263
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544319
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
And a little bit of unit tests and benchmarking...
Change-Id: I56252846c2c00f35e70472e5d8272717d6ec4b25
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/545897
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
The BlockReader does not yet support pointer-data; that will be
implemented in a followup CL.
Change-Id: I01cd3712241071095fdb9cde741b8566d2761926
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550179
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: I33121076bac3ceca19c81ff9fb47e4b024a14230
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549838
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Create a new Geometry class that encapsulates Shapes, but can later encapsulate Vertices & text subruns. DrawGeometry has been renamed to DrawParams for clarity and now stores a Geometry object instead of a Shape.
Bug: skia:13352
Change-Id: I42781b3eecff9845b893aa99fe78c08fd50fb995
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/547281
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Nicolette Prevost <nicolettep@google.com>
Previously, we were storing sk_sp<SkRuntimeEffect> objects in static
variables. This would presumably lead to destructors executing during
atexit time, which is unnecessary and can lead to shutdown bugs. We no
longer attempt to free these objects.
Change-Id: I0b09d7ab3dc67c9b8fbc35c81d72ff57b0592c03
Bug: skia:13426
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549658
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
We didn't have any unit tests confirming that BlockReader can read back
the data out of a block. This seemed like a gap worth filling.
Change-Id: Iefbd5aec199a520ca1ca84b53faef4fd2f2d9ab4
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550017
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
After making http://review.skia.org/549837 I realized we also needed to
check the case of data matching, but snippet IDs mismatching.
Change-Id: Iff9d3ec9921e66c1d65e2c4fe8ca0aa279444d7d
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549841
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Previously, we didn't seem to have any tests verifying the behavior of
operator== and operator!=.
Change-Id: I1f76b8307a551f687d172782e8a30a01c0718e85
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549837
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
The tests themselves are the same, just split up into their logical
groupings. From the principle go/unit-testing-overview#properties
"Focused. Above all, unit tests are narrow in scope, validating the
correctness of individual pieces of code rather than the correctness of
the system as a whole."
Change-Id: If4219c7ea447155314db885a1e1f0beb3c444b74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549836
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Runtime shaders are now distinguished by the hash of their shader text
and number of uniform bytes that they will use. Fortunately, we were
already computing the shader text hash so all we needed to do was
bring it into our data payload.
Change-Id: Ifc0bba6a7f18acd9affca5822e1a54fbff594d88
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549100
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This adds a new SkShaderType for runtime shaders, but it doesn't do
anything interesting yet; for now, we draw solid magenta as a
placeholder.
Change-Id: If0e4af9000d97fcf1184fbed004a64fff8fa4e63
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548477
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
In an upcoming CL the CombinationBuilderTestAccess object will need
to be accessed in multiple test .cpp files.
Bug: skia:12701
Change-Id: I66c969dbe054b7fd333bcd201fcebed4c1dfcc91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548698
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12701
Change-Id: Ibaeedcbf478546f2942df95d362bee8632ba0ded
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548419
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
and rename it BeginBlock.
The motivation for this CL is that it is simpler for the combination
system and the shaders to iterate over their children themselves rather
than shoehorning it into AddToKey.
Bug: skia:12701
Change-Id: I334fbcb7ce83af0681fb06d8449125fdbe8b05f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/547446
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12701
Change-Id: Ibf7b4ac280eb853e3f5d786bd188ae0ac208609b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/545367
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
gazelle ended up being more liability than asset for our C++ rules.
It required devs to manually run the command frequently (and was
easy to forget until the CQ failed). The fact that we still had to
edit the source files (e.g. the "srcs" cc_libraries) meant that
the mixture between generated and hand-written caused some
tension (see include/third_party/vulkan for a good example).
The combination of gazelle and our IWYU enforcement added several
bits of churn without any real benefit. The generated rules
also didn't help identify cases where we were not keeping tight
boundaries (e.g. non-gpu code and gpu code).
Identifying third_party deps automatically ended up being trickier
than anticipated (see the deleted //third_party/file_map_for_bazel.json)
Using the "maximum set of dependencies" worked ok, but ended up
increasing build time unnecessarily. For example, compiling
CanvasKit for WebGL always needed to compile Dawn because
SkSLCompiler.cpp sometimes needs to include tint/tint.h.
Follow-up CLs will rebuild the BUILD.bazel rules without gazelle.
Note to Reviewers:
- The only file worth manually reviewing here is bazel/Makefile.
Change-Id: I36d6fc3747487fabaf699690780c95f1f6765770
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543976
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This is cleanup left over from a prior CL's review. We will want to
use the combination builder outside of graphite.
This CL is mainly just moving stuff around except for the addition
of the SkCombinationBuilder.buildCombinations method and CreateKey
more accessible outside of Graphite.
Bug: skia:12701
Change-Id: If2cae6fcff5670e488bc14473b7b1d2f9b1fecd7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543196
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This also adds support for making a Resources unbudgeted state when it
is pulled out of the cache to be used for an SkImage or Surface. It
then puts the resources back as budgeted when returned to the cache.
Bug: skia:12754
Change-Id: I469ace602aa6f5f708b82655e94557ff8ad45a72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538046
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The ShaderType enum seems like it will persist while the ShaderCombo will not.
Bug: skia:12701
Change-Id: Idf9ed89a50bac46b93a81da3e814207c83b3a1ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541723
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>