Commit Graph

3288 Commits

Author SHA1 Message Date
Ethan Nicholas
ab0a13d9d9 Removed the final remnants of IRGenerator
This completes the long process of moving all of IRGenerator's code and
data into better homes and finally kills the class altogether. There is
a lot of #include churn here due to poor header hygiene in the past;
IRGenerator.h included a ton of stuff and almost everything included
IRGenerator, allowing us to inadvertently be sloppy with our includes.

Change-Id: I70d854e57dec7bd9a311b72f9f72d978d354da98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459936
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-10-19 13:17:01 +00:00
Robert Phillips
1f766792d5 [graphite] Copy UniformDataManager into Graphite and trim down
This attempts to salvage the reuseable portion of:

https://skia-review.googlesource.com/c/skia/+/440841 (New approach to GrProcessor uniforms)

It also removes the old code's Gr- dependencies.

Bug: skia:12466
Change-Id: I7f7f3a9f9b4f3e282af1caeb02d2b305e6756025
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460556
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-10-18 23:58:59 +00:00
Chris Dalton
8fafb0f633 [graphite] Add setters to Rect
Bug: skia:12466
Change-Id: I69222b60d421d8deebcb977124ee0f5cb06f34dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460638
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-10-18 22:13:35 +00:00
Jim Van Verth
0c56bbaffe [graphite] Add command buffer test
Adds test of command buffer submission with GPU recording (if enabled).
Also adds programmatic GPU recording support.

Bug: skia:12466
Change-Id: I85aba9f7e5e09f62f2ddc7040d1ff84bb9b4ae09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460337
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-10-18 17:49:36 +00:00
John Stiles
319d75d6f6 Add error test for unary-negating and unary-plussing arrays.
At present, we only detect four errors here. We should detect six.

Change-Id: I226854ab930a273695c42cf2f7bdb1d5cd97e50b
Bug: oss-fuzz:39998
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459882
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-10-18 14:30:36 +00:00
Michael Ludwig
4021b947f7 [graphite] Add Transform that wraps matrix, inverse, type and scale factors
Transform.h is named Transform_graphite.h to avoid collision with
Transform.h in skottie/src

Bug: skia:12466
Change-Id: I017eee2bffe1a0aad605221e67540f732c2ee6b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459719
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-10-16 00:06:32 +00:00
Chris Dalton
d0c7f63645 Move Wang's formula back into src/gpu/tessellate
We are making src/gpu/tessellate independent of v1, and more represent
math and types that just know how to tessellate, so this seems like the
right place again for this file.

Bug: skia:12524
Change-Id: I773de3c0f93a57ce7ee16b44480667013f32ebd5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459136
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-10-14 17:34:29 +00:00
John Stiles
c8a96076b1 Added four more reserved words to SkSL.
We now detect attribute, varying, precision and invariant as reserved.

Change-Id: I8c90655a70b1bad31bf6143c3fdcb2ce582320b1
Bug: skia:12484
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459479
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-10-14 16:29:32 +00:00
John Stiles
f7d2673643 Fix up samplerCube/textureCube for ES2 conformance.
`samplerCube` is a type which we don't support at all. It has been added
to the reserved-word list.

`textureCube` was in our list of built-in types, but was not actually
used in any way; it wasn't actually added to the root or private symbol
tables, and was totally unreferenced by the code. It's been deleted.

Change-Id: I4f79ce5d40ac6ebdb2a7067fa60cc79e316b01b6
Bug: skia:12484
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459123
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-10-14 15:21:31 +00:00
John Stiles
ee36412765 Add ES2 conformance test harness to dm.
This CL adds a few more exceptions to our ES2 test import, and adds the
dm code which actually runs the tests.

Change-Id: If6691dd35931f4f10262d3a1eff020c2c347ca59
Bug: skia:12484
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459124
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-10-14 14:50:06 +00:00
Ethan Nicholas
6cfe358193 Moved CheckModifiers out of IRGenerator
Change-Id: Ic9288665fd31bde986720cd259b132a5cb9d87a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459178
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-10-14 14:30:01 +00:00
Kevin Lubick
f541ddf785 Move ToolUtils::make_big_path() to bench/
The ToolUtils file is getting a bit bloated, IMO. I noticed this when
working on Bazel includes.

Including non-header files is a small nuisance in Bazel, so it
is probably better to just make it its own compilation unit.

Change-Id: I06ca3808a37ebef6478f5afa3f14086429899590
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459197
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-10-14 12:57:29 +00:00
John Stiles
21fe518fbb Revert "Disallow matrix ctors which overflow a column."
This reverts commit eb68973c2f.

Reason for revert: ES2 conformance test checks this

Original change's description:
> Disallow matrix ctors which overflow a column.
>
> 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>

Bug: skia:12443
Change-Id: I5a32744c88b9b830ad657488824c8c7dd0b0a652
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458056
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2021-10-14 01:30:08 +00:00
John Stiles
64c907c052 Mark private types as invalid in the public symbol table.
Previously, in public code, private types didn't exist anywhere in the
symbol table chain, and those names were free for the taking. Now, we
register them as invalid types in the public symbol table. This prevents
them from being used as variable names, and gives a more explicit error
if you try to use them as a type.

Change-Id: I9a943bf923639b72cbf36b1acf4b4fbe70982786
Bug: skia:12538
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459119
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>
2021-10-13 20:41:09 +00:00
Chris Dalton
1d910efd24 Delete TessTypes.h
The flags here are specific to v1 behavior. Move them into v1 only.

Bug: skia:12524
Change-Id: I27f06d0c153f95e1510bb11c8486d59e5242056a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458997
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-10-13 18:54:35 +00:00
Greg Daniel
b9924539bb [graphite] Add Buffer and MtlBuffer classes.
Bug: skia:12466
Change-Id: I3252f36c3f78642c55f127379ceba99b4845822e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458717
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-10-13 18:28:12 +00:00
Chris Dalton
0de8a96a72 Create an skgpu::tess namespace
This is just a bunch of renaming, and for now the tessellate/shaders
directory remains untouched. The next steps will be to clean up and
remove all Ganesh v1 dependencies from tessellation.

Bug: skia:12524
Change-Id: I8cc166c0c78f9fb160de807131fa53fcc0765818
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458876
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-10-13 16:54:28 +00:00
Robert Phillips
297d096cfb [graphite] More testing infrastructure
With this CL we can run as:

     dm --src gm skp tests --config grmtl -v --nocpu --nogpu

and not get all the non-Graphite unit tests.

Bug: skia:12466
Change-Id: Ib3f04f315fe4b5731a54e4c72979a0c1e00baf24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457898
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-10-13 15:15:29 +00:00
John Stiles
980169a5b5 Allow non-trivial constant expressions for array sizes.
This fixes GLSL ES2 conformance test `array`.

Change-Id: I6ebee9253e1e8c394d9ddb6899e3a0940b7a38ef
Bug: skia:12495
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458718
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-10-12 21:04:33 +00:00
Jim Van Verth
dc6a9e3e12 [graphite] Add command buffer submission and tracking
Bug: skia:12466
Change-Id: I965417fc1de471af33a31155abf2760d5d1b4f62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457317
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-10-12 20:04:29 +00:00
Chris Dalton
117596bc8a [graphite] Add a fast SIMD Rect type
Implements a Rect type whose standard operations use float4. The intent
of this class is to make calculations on draw bounds as fast as
possible.

Change-Id: I3bdb219b242bb7097809507c345b613670ff386e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457136
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-10-12 18:42:07 +00:00
Brian Salomon
87a0078b89 Support building on clang with -std=c++14 but no C++17 extension warning.
Classes of issues addressed:

1. static constexpr class variables aren't automatically inline. Already handled in a separate CL

2. Lack of C++17 copy elision means classes of objects constructed at function return need a copy or move constructor even if RVO will mean it isn't called.

3. Nested braced init no longer allowed for base classes of subclasses without constructors.

4. template static constexpr var in template class throws error about redundant initialization. Adding inline and removing defn outside of class fixes it.

5. Some places that should have been including std headers now actually need to include them.

6. No auto template parameters.

7. No lambdas in constexpr funcs.


Bug: chromium:1257145
Change-Id: Icb24c6b4ed039287fb4cf27a21a1bb7dc9821728
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457298
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-10-12 16:34:30 +00:00
John Stiles
732e4ebd20 Add test slide that mirrors the Chrome fillrect_gradient test.
This test page exercised some cases in our gradient code that were
not hit by any of our existing tests in Skia. (Specifically, simple
gradients with large numbers of redundant stops that can be optimized
away.)

Change-Id: If3309487ddc3d4057e2f160ae3bd319ea356669a
Bug: skia:8401
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457658
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-10-12 00:43:58 +00:00
Michael Ludwig
6c8e2e832e Fix winding when splitting edges at out-of-bounds vertices
Add GM repros and up triangulation verb count to match chromium's define
The GMs draw incorrectly in (base->p2) with the updated verb count, but
would draw fine w/o the increased verb count because a different path
renderer would be chosen.

This fixes a latent bug that was in the edge splitting code of the
triangulator that was exposed by https://skia-review.googlesource.com/c/skia/+/432196
Before that CL, intersections of two lines would be clamped to one of the
4 vertices of the 2 segments. In the CL linked, the clamping was adjusted
to clamp X and Y axes separately, so it increased the chance that a
clamped intersection would have its X or Y coord equal to line's vertex
but differ along the other coord (when they both equaled, they were
considered coincident and splitting that edge did nothing).

Splitting an edge at its intersection was intended to split (p0 to p1)
into new lines (p0 to v) and (v to p1) where p0 < v < p1 according to the
vertical or horizontal sorting that was imposed on the mesh. For a given
line segment and a clamped vertex, there are 8 ways the intersection
could be clamped (4 edges and 4 corners). If the edge has a positive
non-zero slope, a zero slope, or an infinite slope, in all cases the
clamped intersection will be sorted correctly and satisfy p0 < v < p1.

However, if the edge has negative slope
  vertical: p0.y<p1.y and p0.x>p1.x,
  horizontal: p0.x<p1.x and p0.y<p1.y
then intersections snapped to the primary sorting axis will be out of
order and produce a split such that v < p0 < p1 or p0 < p1 < v. This
was already detected, but it didn't update the winding of the new edge
to preserve the original winding from p0 to p1.

In these out-of-order cases, the intersection point is the top of both
the new and old edge, or the bottom of both the new and old edge. This
means that winding "top to bottom" on the new edge would go in the
opposite direction as the original winding from p0 to p1. Flipping the
winding on the new edge preserves the intended winding of the contour
while still allowing the edges/vertices to be sorted consistently.

This showed up as large gradients in the AA triangulator because w/o the
winding adjustment, the winding flip at the new edge would confuse the
border extractor that was used to compute insets and outsets for the 1px
coverage ramp. It would then use edges that were normally unrelated to
each and declare their line intersections as the "interior" with full
coverage. Obviously these could be anywhere so the 1px coverage ramp
would get smeared across that shape.

Bug: chromium:1257515
Change-Id: I015d6b4767db352e3eecfc53047958e74320268d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458057
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-10-11 23:49:37 +00:00
Robert Phillips
3062759ffd [graphite] Set up unit testing system
Bug: skia:12466
Change-Id: I401a185d818a964327d323b9ebcd0850ec0b1c9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457318
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-10-11 16:18:05 +00:00
John Stiles
eafb39fc7e Create hardstop_gradients_many test slide.
This GM presents different gradients with an increasing number of
hardstops, from 1 to 100.

Change-Id: I1c279c6ea1a25f9785001aa29db632547a38ab68
Bug: skia:8401
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457437
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-10-11 13:44:02 +00:00
Chris Dalton
1ab7ff6abf [graphite] Clean up bitwise operators for enum masks
* Rename TFlagsMask<> to Mask<>
* Make Mask<> implicitly convertible to bool
* Rename SKGPU_MAKE_BITFIELD_CLASS_OPS to SKGPU_MAKE_MASK_OPS
* Remove the macro for non-class enums

Change-Id: I86059335d731f34c9c9c20a4cd6d5491543aa3b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456816
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-10-08 00:32:54 +00:00
Ethan Nicholas
c845272b4e Broke DSLWriter into two separate classes
As DSLWriter evolved, it ended up performing two unrelated duties:

1. Holding per-thread state which is referenced throughout SkSL
   (including non-DSL code)
2. DSL-specific utility functions

There's no reason for those to be contained in the same class, and
there's also no reason the per-thread state should be held in a
DSL-specific class. This breaks out an SkSL::ThreadContext class to hold
the state info, leaving the DSL utility functions behind in DSLWriter
(which should perhaps be renamed, but that's a job for a future CL).

Change-Id: Iccd45314bd9b37d4a1d3e27920e32a50c0b07d7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456736
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-10-07 15:28:58 +00:00
Greg Daniel
e47c5d16aa [graphite] Add TextureProxy support.
With this change it should now be safe to start using Proxys and Textures
everywhere. There is no caching the Proxys/Textures will live as long as
someone holds a ref.

Bug: skia:12466
Change-Id: I3c657b65b44b9dca0a77a255d6a4fc89e3862124
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456916
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-10-07 14:56:25 +00:00
John Stiles
042a197ce2 Migrate compiler elimination passes to Transform.
Change-Id: Ibb8695917d0a8ff43467542ee7a7b36f573513f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456798
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-10-07 13:50:07 +00:00
Michael Ludwig
2aff315093 [graphite] Add Shape variant over path, rect, rrect, convex poly
This is basically GrShape except that I removed some of the API that
GrStyledShape used. I also changed the set of types that Shape can
represent to be better match what I imagine our final set will be in
graphite: {empty,point,line,rect,rrect,path,arc}
       -> {empty,rect,rrect,path,convex-polygon}

The convex polygon is used to store points and lines as well. I also
imagine that it will subsume the need for migrating GrQuad over.

I'm doing this on its own in preparation for moving the ClipStack over
and consolidating the draw handling in Device/DrawList, all of which
get a lot easier if there is a single type that stores the geometry.

For the first milestone, actual rendering will still likely use
Shape::asPath() for the path renderer, but it's not a lot of extra work
to preserve the logical type at the high level, so may as well do that.

There are a few functions internal to Shape that still need to be
implemented (converting a path to a list of vertices, and doing point
containment), but those can come in a later CL.

Bug: skia:12466
Change-Id: I1040c54e3b8004f3bc1767d72ded60b572b39596
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456257
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-10-07 13:48:25 +00:00
John Stiles
2dfbf99edf Migrate IsConstantExpression out of SkSLAnalysis.
Change-Id: I08717dd9e9ad20a18a623e06f0c66a0f697effa4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456796
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-10-07 13:40:00 +00:00
John Stiles
2153a87064 Migrate GetLoopUnrollInfo out of SkSLAnalysis.
Change-Id: Ic0d1b04ee09a144dbb13cc98dff8e10409186a8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456648
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-10-07 13:39:22 +00:00
John Stiles
8db7cd008d Migrate CanExitWithoutReturningValue out of SkSLAnalysis.
Change-Id: I0e59da9dda8917e2bc9d6959fdfeeaeae9372c3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456647
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-10-07 13:24:26 +00:00
John Stiles
a7827d6ac1 Migrate EliminateDeadLocalVariables into Transform.
Change-Id: Idc0c51c0d293121fd306e7153b2e47f7e7dec222
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456646
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-10-06 21:09:23 +00:00
John Stiles
7176637442 Migrate EliminateUnreachableCode into Transform.
Change-Id: Ib32895a78a8de4c49ce1208f0c1b9b111d092b42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456643
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-10-06 20:49:38 +00:00
John Stiles
da4bcb6891 Migrate ProgramUsage out of SkSLAnalysis.
Change-Id: I005eccfa262ed047409cce0417f50f93fb6341a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456641
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-10-06 20:46:12 +00:00
John Stiles
a272914cbb Add SkSL prefix to SwitchCaseContainsExit filename.
Change-Id: Ia5bf3423fa75ac610fd34db252fee493d5a53877
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456644
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>
2021-10-06 20:44:24 +00:00
John Stiles
b691ce4151 Migrate CheckProgramUnrolledSize out of SkSLAnalysis.
Change-Id: I97c4d1b4c870367d6457f4dd851f48a6d2211e5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456640
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>
2021-10-06 20:39:34 +00:00
John Stiles
a1b44b72eb Migrate SwitchCaseContainsExit out of SkSLAnalysis.
This CL also removes `SwitchCaseFallsThrough` entirely; it was
not referenced anywhere.

Change-Id: I58298bf2a603615e37f4cced9db6d2f4c2c54d5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456473
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-10-06 18:50:59 +00:00
Robert Phillips
47da0ac577 [graphite] Add stub classes for Recorder, Recording and TaskGraph
Bug: skia:12466
Change-Id: I730c227a78040ea8747d11437032504527b3ee81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456463
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-10-06 16:32:52 +00:00
Greg Daniel
fbc64be806 [graphite] Add Caps getters for default TextureInfos
Bug: skia:12466
Change-Id: I9165e5f49e4b897f4b315662221b944e362b7b41
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456456
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-10-06 15:11:29 +00:00
Greg Daniel
d4ca5e11a1 Add Texture creation to ResourceProvider.
The caller to ResourceProvider should be passing in the TextureInfo
they want. Thus we don't need all the specialized factores on
mtl::Texture.

Also removes UsageFlags from Texture which aren't needed.

Bug: skia:12466
Change-Id: Iad51a7da6efe481382a3f5fbaefc6d2504d1c013
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456236
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-10-05 21:13:53 +00:00
Jim Van Verth
efdb1f0a3b [graphite] Add pipeline cache to ResourceProvider
Copied from GrMtlResourceProvider, and stripped down to the barest minimum.

Bug: skia:12466
Change-Id: I63cb52ee4bbc4c6ce5a1de16312bd4c69911d32c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455619
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-10-05 14:34:22 +00:00
Michael Ludwig
65e848d6b5 Reland "[graphite] SurfaceDrawContext -> DrawContext"
This reverts commit 9602a4fad0.

Reason for revert: fixed var ref

Original change's description:
> Revert "[graphite] SurfaceDrawContext -> DrawContext"
>
> This reverts commit a525fd141b.
>
> Reason for revert: missed updating sdc->dc in one spot
>
> Original change's description:
> > [graphite] SurfaceDrawContext -> DrawContext
> >
> > Bug: skia:12466
> > Change-Id: If4a06bc0ab8befab8a155276c316ba9378b90a48
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455658
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> Bug: skia:12466
> Change-Id: I60e316225d44d7046bc82c80fe42345d8941f99e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455662
> Auto-Submit: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>

Bug: skia:12466
Change-Id: I693b1e39fd65fe20cd5bb3f36bcc5f3da011c6b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455663
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>
2021-10-04 21:43:52 +00:00
Michael Ludwig
9602a4fad0 Revert "[graphite] SurfaceDrawContext -> DrawContext"
This reverts commit a525fd141b.

Reason for revert: missed updating sdc->dc in one spot

Original change's description:
> [graphite] SurfaceDrawContext -> DrawContext
>
> Bug: skia:12466
> Change-Id: If4a06bc0ab8befab8a155276c316ba9378b90a48
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455658
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: skia:12466
Change-Id: I60e316225d44d7046bc82c80fe42345d8941f99e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455662
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-10-04 20:36:17 +00:00
Michael Ludwig
a525fd141b [graphite] SurfaceDrawContext -> DrawContext
Bug: skia:12466
Change-Id: If4a06bc0ab8befab8a155276c316ba9378b90a48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455658
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-10-04 19:51:53 +00:00
John Stiles
a106472197 Reland "Disallow constructors of ES3 types in ES2 code."
This is a reland of 36f53ec7e1

Original change's description:
> Disallow constructors of ES3 types in ES2 code.
>
> The fuzzer found that we constructed TypeReferences without first
> checking for disallowed tyoes. (In fact, TypeReference creation had no
> error checking at all; it didn't even have Convert/Make functions.)
>
> Added proper Convert/Make to TypeReference, and used those calls to
> report errors or cause assertions if trying to make a TypeReference to a
> type that the program did not support.
>
> (While tracking down this bug, I added strict-ES2 type assertions to our
> constructor IR nodes as well. This helped pinpoint the error and seem
> reasonable to leave in, just in case.)
>
> Change-Id: I896b68ae9d3d9e1f30d7eba9fa594617ab851c74
> Bug: oss-fuzz:39540
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455498
> 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>

Bug: oss-fuzz:39540
Change-Id: Id8e323c22b18726214613b6061c08873048b7c69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455617
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-10-04 17:51:00 +00:00
John Stiles
e03f1c101c Revert "Disallow constructors of ES3 types in ES2 code."
This reverts commit 36f53ec7e1.

Reason for revert: breaks DS3Types test

Original change's description:
> Disallow constructors of ES3 types in ES2 code.
>
> The fuzzer found that we constructed TypeReferences without first
> checking for disallowed tyoes. (In fact, TypeReference creation had no
> error checking at all; it didn't even have Convert/Make functions.)
>
> Added proper Convert/Make to TypeReference, and used those calls to
> report errors or cause assertions if trying to make a TypeReference to a
> type that the program did not support.
>
> (While tracking down this bug, I added strict-ES2 type assertions to our
> constructor IR nodes as well. This helped pinpoint the error and seem
> reasonable to leave in, just in case.)
>
> Change-Id: I896b68ae9d3d9e1f30d7eba9fa594617ab851c74
> Bug: oss-fuzz:39540
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455498
> 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>

Bug: oss-fuzz:39540
Change-Id: I1dc3ccca477fcb9fe3f39cfe8af1fd54dcb18d6b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455616
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-10-04 15:36:08 +00:00
John Stiles
36f53ec7e1 Disallow constructors of ES3 types in ES2 code.
The fuzzer found that we constructed TypeReferences without first
checking for disallowed tyoes. (In fact, TypeReference creation had no
error checking at all; it didn't even have Convert/Make functions.)

Added proper Convert/Make to TypeReference, and used those calls to
report errors or cause assertions if trying to make a TypeReference to a
type that the program did not support.

(While tracking down this bug, I added strict-ES2 type assertions to our
constructor IR nodes as well. This helped pinpoint the error and seem
reasonable to leave in, just in case.)

Change-Id: I896b68ae9d3d9e1f30d7eba9fa594617ab851c74
Bug: oss-fuzz:39540
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455498
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>
2021-10-04 15:02:24 +00:00