This is a reland of 64c971350e
Original change's description:
> Use native std::string_view.
>
> We also used some string_view functionality from C++20/23. These have
> been replaced with free functions with the same name.
>
> Change-Id: I3bf40f99aeb500495f344fd8c6872619267d42be
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500897
> Reviewed-by: Herb Derby <herb@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: I4ff237381c16179f716ecde1929154fdd4ad3442
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501480
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This reverts commit ded2548179.
Reason for revert: Windows breakage on tree
Original change's description:
> Added SkSL dehydrate / rehydrate test
>
> Test that we can dehydrate and then rehydrate every program in our test
> corpus without altering them.
>
> Change-Id: I2286fcb691176b3fbbe1d6515279d03867555647
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501436
> Reviewed-by: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Change-Id: I2dcee0b36e7e316c4ed0889141cf38c2d1508653
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502311
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>
Test that we can dehydrate and then rehydrate every program in our test
corpus without altering them.
Change-Id: I2286fcb691176b3fbbe1d6515279d03867555647
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501436
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This is a reland of 490bb34b29
Original change's description:
> Use native std::optional.
>
> Change-Id: I3bcf7a23eb27e98d24840b492930955125d35bd4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501476
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: If14d35ed78905800b43b656f65bb17fc940e7770
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502298
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Our SkVM code generator will always convert `pow(x, y)` into an
`approx_powf` call. However, in many cases, `x` or `y` might boil down
to an immediate value, and for some immediates, we can reduce the
operation into something much simpler:
- `pow(1, y)` is always 1
- `pow(2, y)` can be converted to `approx_pow2(y)`
- `pow(x, 0.5)` can be converted into `sqrt(x)`.
- `pow(x, 1)` can be converted to `x`
- `pow(x, 2)` can be converted to `x * x`
We could go further if there is a need, e.g. `pow(x, 4)` can become
`a = x * x; return a * a`, but these seemed like the best places to
start.
Change-Id: I02b9d4d3f5067581ebad5e53b2d1d7befa308300
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502308
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: Ia218fb2249abd479db9d27527b965fd0b8ad3367
Bug: skia:12858
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501276
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Test "InlinerHonorsGLSLOutParamSemantics" was failing on Wembley devices
and is now disabled on that GPU.
Also, it turns out that the inliner has ignored functions with out
params for a long time now, but our test names haven't been updated to
account for this. So, did some additional cleanup:
- "InlinerHonorsGLSLOutParamSemantics" (the test in question) has been
moved to shared/ and renamed to "OutParamsAreDistinct."
- Removed test "OutParamsNoInline" as it is functionally the same as
"OutParams".
Change-Id: I1431ed197b9216cb482eee4f5e4eb2579a5303f7
Bug: skia:12858
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502303
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
sk_SecondaryFragColor corresponds to an ES2-only concept
(gl_SecondaryFragColorEXT) and does not have any SPIR-V equivalent.
Two fixes were needed:
- sk_SecondaryFragColor shouldn't be in SPIR-V code at all. Report it as
an error when it appears.
- We don't stop compilation when this error is reported, so we need to
fix up the assertion that the fuzzer initially discovered.
Specifically, the fuzzer found that the `sk_SecondaryFragColor`
variable never got a SPIR-V ID assigned to it in fVariableMap, so the
compiler would assert when assembling an expression containing that
variable. Now, we make sure to populate fVariableMap with an (unused)
ID in `writeGlobalVar` to avoid this crash.
Change-Id: Ib86919dfc9a325b2b82a7f4b2054b747dad7c32f
Bug: oss-fuzz:44096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501976
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Change-Id: If0ecc3c1080b8e44f17dbb34ff6cc1d66794ae0b
Bug: skia:11052, skia:11919, skia:12858
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501843
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Removed a special case from `writeFunctionCallArgument` which avoided
using a scratch variable for out params; now we always use the scratch
variable and copy it back to the original variable at the end.
Change-Id: I0e446a3fde6d19554943384210bd911f6f9c8cfa
Bug: skia:11052, skia:11919, skia:12858
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501836
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I3bcf7a23eb27e98d24840b492930955125d35bd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501476
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Upcoming dehydration / rehydration changes require $intLiteral and
$floatLiteral to be present in the symbol table (as all other private
types are). It turns out that even with them marked private, having
them in the symbol table allows them to be incorrectly accessed without
error due to a code path that fails to check for private types.
This CL takes care of that and ultimately results in better output from
PrivateTypes.
Change-Id: Ic47b77a770834079f28c3195545a7cabca8e6cb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501196
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This reverts commit 64c971350e.
Reason for revert: breaks
Housekeeper-PerCommit-CreateDockerImage_Skia_Release
https://status.skia.org/logs/7PAT8xw23VsUyx4oJgZZ/1327ba91-d03a-4e98-b1dd-0dedb401333b
"<string_view> not found"
Original change's description:
> Use native std::string_view.
>
> We also used some string_view functionality from C++20/23. These have
> been replaced with free functions with the same name.
>
> Change-Id: I3bf40f99aeb500495f344fd8c6872619267d42be
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500897
> Reviewed-by: Herb Derby <herb@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: I3712eddc8ad49ad38d31ca5bf008260e251bdbd7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501396
Auto-Submit: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We also used some string_view functionality from C++20/23. These have
been replaced with free functions with the same name.
Change-Id: I3bf40f99aeb500495f344fd8c6872619267d42be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500897
Reviewed-by: Herb Derby <herb@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This shakes out a few driver issues.
Change-Id: I35041a904fb762a5b933b3e970f2d7a668803dcd
Bug: skia:12858, skia:11919
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501019
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This shook out a few driver issues.
Change-Id: If12f11c4b3b562fec402bddce25edf01a8be83b9
Bug: skia:12858, skia:11919
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500816
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Move to RAII structs wrapping DrawWriter to control the append mode.
This allows each struct to define any extra template parameters/buffers
needed for the appended data, and expose only the appending API that
makes sense.
In follow up CLs, the RAII structs make it easy to support reserving
and returning vertex data, and add new appending modes.
Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Bug: skia:12703
Change-Id: I5ef1bfdf3b4fa175bcfb25cc61fd0c46a62d46c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/498016
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
GLSL ES2 behavior is explicitly undefined if an out-param is never
written to: "If a function does not write to an out parameter, the value
of the actual parameter is undefined when the function returns."
We do see divergence here in practice: SkVM's behavior (the parameter is
left alone) differs from my GPU's behavior (the parameter is zeroed
out).
SkSL will now report an error if an out parameter is never assigned-to.
There is no control flow analysis performed, so we will not report
cases where the out parameter is assigned-to on some paths but not
others. (Technically the return-on-all-paths logic could be adapted
for this, but it would be a fair amount of work.)
Structs are currently exempt from the rule because custom mesh
specifications require an `out` parameter for a Varyings struct, even if
your mesh program doesn't need Varyings.
Bug: skia:12867
Change-Id: Ie828d3ce91c2c67e008ae304fdb163ffa88d744c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500440
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This is mostly mechanical. The only interesting bit is that GrSLType was in include/private while SkSLType is in src/core so some #include patterns changed.
Bug: skia:12701
Change-Id: I80bd86ee93796b145f86ded9b4cbf52f24fa59e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497607
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This was used for one specialized template in Ganesh, and enables the
preferred appending pattern for Graphite.
Change-Id: I561449004923464efeeabaed5bc00c8fd49e036d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/498440
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This is a precursor that makes supporting reserving/returning vertices
easier to implement, and adapt to it PatchWriter for the tessellating
path renderers.
It also has the small benefit of being slightly easier to follow, and
the buffer binding remains valid across pipeline changes.
Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Bug: skia:12703
Change-Id: I84606800937d955d5f4cb98e68cca2ca6c6fb1f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496890
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Previously, when attempting to cast a huge value to an int, SkSL would
report an error, then return the IR for
`ScalarCast(Int, FloatLiteral(huge-value))` . Now, to minimize the blast
radius of the error, we report the error but return `IntLiteral(0)`.
We've already reported an error, so there's no need to preserve the
value, and zero is less likely to produce follow-up errors.
(A similar approach is used here and worked well: https://osscs.corp.google.com/skia/skia/+/main:src/sksl/ir/SkSLConstructorCompoundCast.cpp;l=57-59)
Change-Id: Ie8e8d48380cb963466d1f47d123d64e3301cf87c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499563
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
The test input was removed at http://review.skia.org/497742.
Change-Id: I7b30f2f70cd0812b900c9c67b70e742b3d96930a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499574
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
The test has been moved to shared/, since it's a valid test, but it is
no longer related to inlining, as the inliner no longer attempts to
inline functions with inouts at all.
Also, one function here (outParameterIgnore) actually invoked undefined
behavior and has been removed. According to the GLSL ES2 docs: "If a
function does not write to an out parameter, the value of the actual
parameter is undefined when the function returns." SkVM leaves the value
unchanged, so SKSL_TEST_CPU would pass, but a GPU might clear it (and in
fact, my GPU does).
Change-Id: I77c77ed1354bc980344ec5c406992bd62015f5e5
Bug: skia:11919
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499752
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Now, constant mat+mat, mat-mat, and mat/mat operations can be optimized
away. mat*mat does not operate componentwise and will need to be
handled differently.
Change-Id: Iabac6e58999eac46c256d7dcdb9b95d05de530bc
Bug: skia:12819
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/498716
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
GLSL supports adding, subtracting, multiplying, and dividing matrices
with scalars. This works by splatting the scalar across every matrix
component and then performing the op componentwise. Our constant folder
now knows how to fold out these simplifications.
Change-Id: Idb8751ec16135e1b61da0d58cfd0505ab31ac087
Bug: skia:12819
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497738
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
In a followup CL, these will be updated to properly fold.
Change-Id: I20d125c0d54cbbcf12f7d096beda1fdf75e51b65
Bug: skia:12819
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/498617
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Previously, matrix-scalar operations did not actually fold, so the tests
didn't live in folding/. In a followup CL, these will fold.
Bug: skia:12819
Change-Id: I6fdacf89088920719e7666d6c9b05ddffaf6cb6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497742
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
SkSL is somehow interpreting a large positive value as a negative one.
Change-Id: I299e0bf389a9fcbfe697741bd33a54df07748753
Bug: skia:12863
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499556
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Some paths through swizzle optimization would replace a swizzles with a
constructor--e.g. `float3(1, 2, 3).y` would be replaced with `float(2)`.
(Constructor::Convert was responsible for replacing this trivial
constructor with the literal `2.0`.)
The optimization code asserted that this replacement would succeed, but
the fuzzer managed to construct a counterexample where the constructor
rejected the value. Specifically, by nesting casts between int3 and
float3, it found a case where Constructor::Convert returned null because
the literal value was out of range for `int` types.
This assertion didn't really add value so removing it was harmless.
Constructor::Convert already reports an error when it fails, and null
returns are handled properly throughout.
Change-Id: I575d441ed90d6b696f6399941c3f6d84698794bc
Bug: oss-fuzz:44045
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499382
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This guards against any potential for conflict with user code.
Change-Id: Iecaf3ead5f8ada50b6dc159a4ad9e7f3e371edc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499296
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>
The check in SkIsConvexPolygon that determines if a polygon winds around
multiple times turned out to not be correct in all cases. This has been
changed to a much simpler one -- if the sign of the edge vectors change
more than twice, then we know that we've wrapped around more than one
time.
In SkIsSimplePolygon, if both points adjacent to a vertex are on the
right side, we attempt to add both those edges to the active edge list.
However, if they are the same point, then we'll be adding the same edge
twice, which makes the strict ordering of the edge list invalid. Instead
we check for this case earlier on and reject the polygon.
Bug: oss-fuzz:44004
Change-Id: I6ffe11d73fabd6ae2f75cb027db887bcb8c03cb1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/498916
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit a97a6769b5.
Reason for revert: breaking bot Housekeeper-PerCommit-CheckGeneratedFiles -- see http://screen/5FN75fF9tvcQFKR
Based on the diff, I think this just needs to be synced up to latest code and a rebuild should fix it.
Original change's description:
> [skslc] Generate .hlsl test output files
>
> - The build now generates HLSL output when `skia_compile_sksl_tests` is
> enabled.
> - The "blend" and "shared" tests have been enabled for HLSL with the
> exception of 6 tests that exercise intrinsic inverse hyperbolic
> functions, which don't have HLSL equivalents.
>
> Bug: skia:12691, skia:12352
> Change-Id: Ia970f878f75ff58e8e3d47249c2dc2f756c165b4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482778
> Reviewed-by: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Auto-Submit: Arman Uguray <armansito@google.com>
> Commit-Queue: Arman Uguray <armansito@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:12691, skia:12352
Change-Id: Iaad607d48edd136eee2b60e48c0643b6e90179e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499216
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 build now generates HLSL output when `skia_compile_sksl_tests` is
enabled.
- The "blend" and "shared" tests have been enabled for HLSL with the
exception of 6 tests that exercise intrinsic inverse hyperbolic
functions, which don't have HLSL equivalents.
Bug: skia:12691, skia:12352
Change-Id: Ia970f878f75ff58e8e3d47249c2dc2f756c165b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482778
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Arman Uguray <armansito@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:12845
Change-Id: Iba4fcfe98adf6f0445958322d674ab3dfee87305
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497280
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Previously, any code which emitted a binary expression would always emit
a leading and trailing space. This caused comma expressions to look
goofy: `foo() , bar();` instead of `foo(), bar();`.
Operator::operatorName() now returns the operator token with appropriate
whitespace around it, and tightOperatorName() is a new method which
omits the whitespace. Functions which assemble binary expressions
should now concatenate `x + operatorName() + y` instead of hard-coding
`x + " " + operatorName() + " " + y`. Prefix/postfix expressions should
use `tightOperatorName()` because otherwise negation looks bad (` - 123`
instead of `-123`).
Super low priority, but it was easy to fix.
Change-Id: I3c92832207293a310fb1070b3b5e72455757b0ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497776
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
These identifiers are reserved for SkSL internal use (and can't be
exposed to GLSL or Metal anyway).
Change-Id: Id554cbf21ed2fb66785e77700ff79424ecdf66db
Bug: skia:12854
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/498036
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This reverts commit 0c9b8bae42.
Reason for revert: breaking bots, apparently due to use-after-free?
Could be a real clone bug...!
http://screen/9NenpjnYNoDU58G
Original change's description:
> Added tests for sksl clone() on our test corpus
>
> Change-Id: I9022a6aa53b039e5aec2ceeb0062d536e5e278c9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496601
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Change-Id: Ida8978a38ac24081895cd97a62718b6ec94f57c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497777
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>
Unfortunately, this won't change any behavior until ExtractPaintData is switched over to using PaintParams::toKey
Bug: skia:12701
Change-Id: I2b00256d34de1b8b99a65e26c08f5f082090a341
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497596
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Presumably, SkVM will also need a way to represent the data passed to its programs
This CL attempts to be as mechanical as possible.
Bug: skia:12701
Change-Id: I7fb2c06d645809bf5422a25b8b537cf6c249fede
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497136
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 7e8fdf4706.
Reason for revert: breaking bots
Original change's description:
> [graphite] Add ImageShader and BlendShader SkPaintParamKey support
>
> Unfortunately, this won't change any behavior until ExtractPaintData is switched over to using PaintParams::toKey
>
> Bug: skia:12701
> Change-Id: I4f51dbb43983fe2f01947e26814f581a6d9033cd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496783
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12701
Change-Id: If180bd3753c95d920715f37347559cee4fa2da20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497455
Auto-Submit: Robert Phillips <robertphillips@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Unfortunately, this won't change any behavior until ExtractPaintData is switched over to using PaintParams::toKey
Bug: skia:12701
Change-Id: I4f51dbb43983fe2f01947e26814f581a6d9033cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496783
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
The skvm implementation of pow2 uses a clever bit-twiddling trick to
generate a floating-point value that can be cast to integer, then bit-
punned to float, to generate its result. However, the bit trick fails
for large inputs, and the bit-punning step generates a nonsense result.
This is now fixed by using a well-positioned clamp.
Change-Id: I55143a98324f5f518d0875149a0b6ce6d734ded0
Bug: skia:12847
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497283
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Internally, SkSL breaks apart multiple vardecls into individual vardecls
wrapped inside an unscoped Block. Previously, the Debugger did not
properly distinguish a scoped Block from an unscoped one, and the
variables inside unscoped Block would be considered as "out-of-scope" as
soon as the unscoped Block was closed. This would make them vanish from
the Local Variables pane of the debugger at the end of the vardecl
statement.
(Note that this transformation also means that Step stops once for each
individual variable, but that isn't a big deal.)
Change-Id: I2ee2409e8556d77b58d7645658bd497f87c31e39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497278
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
While working on the debugger, I realized that we had no interface for
getting the current line of any stack frame other than the currently-
executing frame. This can be useful for letting users explore the call
chain on the stack.
(While I was here, I also renamed `tidy` to `tidyState` in order to
match the Typescript implementation.)
Change-Id: Ife8c30d81adc17389a109698e3fba7f93e523e9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496886
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This update removes an unused field (the "slot" value was redundant,
since we always emitted arrays in order and there are no gaps). This CL
mostly exists to test out the ramifications of updating the trace
version and make sure things don't break when we do.
Change-Id: I456837db682b0085fc5afbbc0bcb62af3440c6e5
Bug: skia:12755
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496607
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This eliminates a handful of useless statements. They were harmless, but
presumably this saves optimization work for the GLSL compiler.
(Patterned after http://review.skia.org/496377 )
Change-Id: Ibe135750488a9917b982dcac67f22b3765412ee1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496599
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
These are harmless, but they can cause the Metal compiler to emit a
warning, and these warnings are making some logs messy for Flutter.
Change-Id: I21b7a3c9ae661c55bbbe8bc13d097966180e977d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496377
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This will give us better control (or, at least, the ability to provide a
cleaner error) when we make schema changes.
Change-Id: I4e9a41dd9084647d1c2ceb1d7815b2942f4903ce
Bug: skia:12755
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496602
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
This returns a string_view of the JSON string (via begin() and size()).
Change-Id: I5f92848f4dfdd2be034beb0e48f3fb651ee97640
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496600
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Change-Id: Ic664ad0134d61dcf939dcf585a81d53e29c6afcc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496597
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Bug: skia:12701
Change-Id: Ifa6b600b445a78f4ba936bf763adb2a5bf4d7542
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496299
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
We've run into drivers a few times now that have bugs where they only
expose vkGetInstaneProcAddr and not vkGetDeviceProcAddr. The latest
being swiftshader (which is getting fixed). To avoid this issue in the
future we can just have our tests use vkGetInstanceProcAddr to get
vkGetDeviceProcAddr.
Change-Id: I6d73abde507519c145b873042393f50ce6c4527c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494822
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Angle/Vulkan added GL_ANGLE_rgbx_internal_format extension for RGBX
texture format. Add support for that format in Skia.
Bug: chromium:1261867, chromium:1269826, angle:6690
Change-Id: I74fc91699dc1eaf2b275b29fbcf3d4060e63c5a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/485157
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Adding tests for matrix math and comparison
bug: skia:12681
Change-Id: Ia1537ee2e411383749456fd6ff938b7c9a2e1061
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/493416
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
It is safe to store raw pointers to these objects since they are both
always accessed on the same thread we can safely invalidate their
back pointers when needed. This allows us to remove a ref of Recorder on
Device.
Bug: skia:12794
Change-Id: Icb5e079f7e820824520d52e48012b447e714a9ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494239
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This looks like the GLSL driver in iOS generates wrong results when
returning a value from inside a switch.
Change-Id: I478a045c64c3dae9824f86f52e0c7f8f9685c9af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494476
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Since the SkShaders, etc will need access to SkPaintParamKeys and the SkShaderCodeDictionary they can't be buried in the skgpu namespace.
The currently planned signature for addToKey is:
void addToKey(SkShaderCodeDictionary*, SkBackend, SkPaintParamsKey*) const;
This CL doesn't modify the classes beyond what is needed to move them.
Bug: skia:12701
Change-Id: I18bbf6d6c3a768427112a3d19a9ccf2d46a23ad2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494237
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I3dabd77890a73ea054bb57d466a6ed8273eae3e8
Bug: skia:12811
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494196
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
SkPaintParamsKey can be variable length and is thus the path forward for encapsulating/representing PaintParams.
Note: SkPaintParamsKey isn't in the skgpu namespace bc, ultimately, the individual SkShaders, etc will be responsible for adding their own information to the key.
Bug: skia:12701
Change-Id: I7472dc00706a4548bc3ffb4e287a941a2b8ffcae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492405
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: Iecf1313af5f2938cb899f2a3e750ffc04554bae0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/493977
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>
Bug: skia:11862
Change-Id: Ia21fad6acb82a03c1ba8663be548bf58f5067b85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/493636
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Track the scaling hints as the minimum of the maximum dimension and
the maximum of the maximum dimension. Having the range will allow
for better scaling choices in the drawing of last resort.
The next CL will start using this range to calculate scaling factors.
Bug: chromium:1280180
Change-Id: I2c07303d3303c71ede2a0b1133ee2e218f7bd84e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/493456
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:12700
Change-Id: Icbd1ff6f98f5de8830b40b8a714e8092e40b1c97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/485217
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This CL creates a new build target with a customized set of GN
flags that enable the native components of SkQP to be built using
NDK APIs.
Bug: skia:12777
Change-Id: I8341eafa7fc794cfb759045b7c7238e69c29b0a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491447
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Bug: skia:12701
Change-Id: I8138633dee9eaf65077da8534600393196c7942e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492404
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
The core of this CL is replacing the Combination in GraphicsPipelineDesc with a uniqueID. All the other changes are just in support of that.
Bug: skia:12701
Change-Id: Id5fe9b39d1e497adbc879e7c933a2d9bdb788a58
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491048
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Encapsulate the direct/SDFT decisions in the bool functions
isDirect() and isSDFT().
Encapsulate the notion of glyph approximations in:
approximateTransformedTextSize().
Use these to replace drawingType through the code.
Bug: chromium:1280180
Change-Id: I8de7ee8bc4a24e576e79eeb1ed8670179a860aa9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491448
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
As @johnstiles suggested I add the test first and the fix after.
bug: skia:12712
Change-Id: I9316cf40f71e756fc1730ee630bc0d0377f200d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491936
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
We used to reject ES3-style array declarations in strict-ES2 mode, so
this test originally expected two errors.
Change-Id: I17f71630076cda4b37b7723225dcff951eba9dcc
Bug: skia:12410
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491997
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This reverts commit 6e686b8b8b.
Reason for revert: After internal discussion, we established that nobody was actually sure why this had needed to be an error in the old parser in the first place, so there does not appear to be a reason to carry the behavior forward.
Original change's description:
> Fixed SkSL error reporting on array types
>
> The DSLParser was not reporting errors when the array type appeared
> before the variable name (float[2] x) as opposed to after (float x[2])
> in strict ES2 mode.
>
> Bug: skia:12410
>
> Change-Id: Ia388aa150f65916dc3ccc58f7680dbde0a636c5f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491819
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:12410
Change-Id: I355fd1ad89e2e64b0377be7672b7f3f824eebac8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491996
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>
The DSLParser was not reporting errors when the array type appeared
before the variable name (float[2] x) as opposed to after (float x[2])
in strict ES2 mode.
Bug: skia:12410
Change-Id: Ia388aa150f65916dc3ccc58f7680dbde0a636c5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491819
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Previously, type aliases ('vec2') were just an additional name which
could be used to refer to a type ('float2'). This was simple and worked,
except that error messages would be wrong - any type-related error
message would refer to the type as 'float2' rather than the 'vec2' that
the user actually typed.
This CL adds an AliasType class so that we can track which name was
used to refer to an aliased type and report messages using the correct
type name.
Bug: skia:12737
Change-Id: I40e234239ab47557033e0695e4fbbd5f01da354e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/490256
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This will make it possible for drawVertices and drawCustomMesh to share
implementation in Ganesh.
Bug: skia:12720
Change-Id: I8b84119a29b47071ef389879bb5287873629ed3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487978
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: oss-fuzz:43062
Change-Id: I10d8fa40c81c5b1595d30221d89c84f5cc3478fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/490857
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
SkRuntimeEffect::MakeForXxxxx compiles its shaders before MakeTraced()
is invoked, with optimizations enabled. When MakeTraced() is called,
we recompile the shader with optimizations disabled; this allows us to
present the user with a shader that is as close to the original as
possible. (This obviously costs time, but debug trace generation isn't
focused on speed.)
Note that in some rare instances, disabling optimizations can cause
compilation to fail (e.g. optimization can simplify control flow and
eliminate "unreachable" paths). In those cases, we fall back to the
existing behavior of debugging an optimized shader.
Change-Id: Iba0f31bc42374c7048694fde5415b122177a9a68
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489716
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Previously, the VariableData returned from a DebugTracePlayer contained
values in an int32_t, regardless of the slot's NumberKind. We had a
helper function which could stringize the bits, but otherwise the caller
was responsible for bit-casting the value manually.
Now, the DebugTracePlayer will automatically manage bit-casting for the
caller. The value returned in the VariableData is now a double (so it
is able to store an int32, uint32, or float at full precision).
This change was inspired by the recent Typescript port. (The value in
the Typescript VariableData uses a compound `number | boolean` type, so
it is able to fully represent any slot value natively.)
Change-Id: I5eec414236f76ad0ff51b0b19974e4a0025c4d62
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489896
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Interface blocks now guard against naming their member variables with
built-in type names like "float" or "bool".
Change-Id: Ia767542ace76fb8fbc2d50c81772b7f54b1bf973
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489616
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Structs already handled this appropriately, but interface blocks did not
guard against naming their member variables built-in type names like
"float" or "bool".
Change-Id: I12ec054b3f158b83e35031449cf2a088ff8d0dc2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489596
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Anonymous function parameters are now automatically assigned a name,
"_skAnonymousParamN", where N is the parameter index.
Change-Id: I87adcd51ed025c76ae2b333317f21b523a4632b4
Bug: skia:12769
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489538
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
SkSL will reject ES2-compatible code because function parameters always
require a name in SkSL. (A followup CL relaxes this restriction and
allows anonymous parameters in SkSL.)
Change-Id: Ifdcf0fcbe0f52d16007c018b545631ca4033a8c4
Bug: skia:12769
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489537
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>
Structs and interface blocks allow a trailing identifier which is added
to the symbol table. This identifier is now prohibited from
overlapping built-in types.
Change-Id: I33b9d6156a27ce017e6744a05979748c04a04767
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489516
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Structs and interface blocks allow a trailing identifier which is added
to the symbol table. This identifier should be prohibited from
overlapping built-in types; at present, this is not checked. Add a test
demonstrating the issue.
Change-Id: I99aa915c1715c468cc369c97b7f12e031b86ea4a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489496
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
When the SkVM interpreter is operating in "stride=1" mode, we should
only look at the first lane of the trace/execution masks. The other
lanes are not being actively used, but the "index" opcode still fills
all the lanes, so it's entirely possible for the trace coordinate to
match in an unused lane.
Change-Id: I7f04f5c59431b3c50b4b072bc3ea4f52f8aa1a1b
Bug: skia:12752
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/488796
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
We'll want to reuse this key class for Graphite resources as well. There
is nothing special about these keys that is Ganesh specific.
Bug: skia:12754
Change-Id: I39fe5a9968156985865bccbfc4978583120ac2e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487384
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Since we know the entire flow of execution ahead of time, at any point
during trace playback, we can know if a line will be reached again or
not. We no longer highlight lines as reachable (or allow setting
breakpoints) if the line will not be reached again during trace
playback.
Change-Id: Iff563b13e2f6efb5d4f2ff37215f2ff4fb5945ed
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486496
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
At this point SkPromiseImageTexture is not much more than a wrapper
around a GrBackendTexture. The next steps would be to switch to just
directly using GrBackendTexture in the fulfill procs and deleting
SkPromiseImageTexture.
Bug: skia:12758
Change-Id: Ic0526b869a0730c25b41b46fd6523604dedaba40
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487382
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Renderer::StencilAndFill() chooses between two instances based on fill
type (more to come when we add stencil pass). The inverse fill uses
different stencil settings and different geometry (hence why it must be
a distinct renderer, since stencil is part of the pipeline).
Also updates the command buffer asserts and types to support float3
attributes and has the fill bounds render step pre-transform vertices.
This matches the intended plan of device-space control points to
avoid matrix transform uniforms when no other coords are needed.
Makes DepthStencilSettings constexpr so they can be declared constants.
Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Bug: skia:12703
Change-Id: I5be4151f533e4cc5c560baf96c59193162b48dab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484559
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Change-Id: Ibff6f08e569b5365732404a56fc3b9bf7c2fa1f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487377
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>