Change-Id: I793495c2a0c220b919a9f8b2ead2c784548c0211
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479757
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
The direct mask sub runs were only shifting the device bounds,
and never really transforming them. This adds code to do the full
bounds transform when the positionMatrix does not represent an
integer offset.
Add a meaningful clip to the slug GM to demonstrate change. With
the old code, the slugs did not respect the clip. Now they do.
Bug: chromium:1254726
Change-Id: I1f3ce2b5068ec5824e814ca9ac67c9aeae307187
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479397
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Use that to preserve the alpha type of (unpremul) SkImages when
serializing. This ensures that the new GM works correctly in
serialize-8888, and is required for an upcoming "raw" image feature.
Change-Id: I747803c2928cbb5872d4c97a421701248d8f6a51
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478957
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Change-Id: I0695614a68a0d05d3a30163b4da5a75486f1d0b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479060
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Previously, the trace opcodes took a single mask argument, which was
computed as `execution mask & trace mask`. This led to extra bit_ands in
the output, as this value would be need to be recalculated every time
the execution mask changed.
To reduce this cost on program size, the trace ops now take two mask
arguments and require that both must be true. We have four register
slots at our disposal in an Op, which is more than we need, so this
doesn't really cost us anything.
(As an extra minor optimization, if one of the masks is "always-on", we
optimize it away. This avoids burning a register just to hold a ~0
immediate value.)
Change-Id: I9eb71292a1983e71b03c7ac842534beb3d6bbf17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478456
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Add an array which represents the trace itself into the SkVMDebugInfo.
Since we expect complex programs to emit a lot of trace data, we try to
keep the JSON representation here compact. Ops and their data are
represented as a compact array of integers. Data fields can be left
unspecified; these are assumed to be zero.
Change-Id: Ia52ad280ab5989496eb495c4efb8b99aa72cda5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477983
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: I7f0998f159e0bc3f32f813f8150f4f12477760cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479056
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This mirrors the SkRuntimeEffect accessor in SkShaderBase and
SkBlenderBase, and will be used in a followup CL which will allow
hooking up debug traces to runtime effects of any type.
Change-Id: I4449333dac3f2af7b11868d9baf0a82b35ca5aaf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478960
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
switch is no longer an ES3-specific feature.
Change-Id: Ic878a77268e517e17699c2e35a37da6b0a7765dd
Bug: skia:12450
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452320
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This also hides the ctors for the respective classes so you can't just
arbitrarily make one outside of the factories.
Change-Id: If31ac8ea9b54c9e10c162081251e77d7e9d07147
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478956
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
With this CL, rt adjust is handled automatically by the backend of the
CommandBuffer when setViewport is called, so DrawPass and the
CommandBufferTest are updated to configure that (and the geometry of
command buffer test is rewritten to be in Skia's coord system instead
of NDC).
Currently, the metal command buffer uses push constants to set the
rtAdjust uniform. Hypothetically, D3D12 could use the root descriptor,
etc. There is some coupling here between the intrinsics the SkSL
programming environment operates in, and the backends configuring the
pipelines, but I don't think it's unreasonable and it seems cleaner
to me than having DrawPass bind and upload uniforms for all of the
intrinsics.
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-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite,Build-Mac-Clang-arm64-Release-Graphite
Bug: skia:12466
Change-Id: Id91e9ffc31688886c5bf3ee6134567070820207a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478656
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This way we can avoid breaking the existing flow until
we are sure it is building correctly.
Change-Id: I619f44e3d217eaabbd2f92c319cbd521451ee07e
Bug: skia:10614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478616
Reviewed-by: Eric Boren <borenet@google.com>
Passes the Transform for each draw to the RenderStep, to both
writeVertices and writeUniforms, since any given RenderStep could
choose to transform vertices on the CPU, pack the matrix as instance
attributes, or upload it as a uniform.
Also updates UniformManager to take the source data as const void*
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-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite,Build-Mac-Clang-arm64-Release-Graphite
Bug: skia:12466
Change-Id: I7ac40af0b7c123d068478f5672dda455c0bbbfb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478376
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Before this change, asking skslc to convert a .sksl file to .skvm would
result in a crash:
$ out/Debug/skslc resources/sksl/folding/CastFolding.sksl ~/CastFolding.skvm
../../src/sksl/codegen/SkSLVMCodeGenerator.cpp:428: fatal error: "Unsupported builtin 10001"
(10001 is SK_FRAGCOLOR_BUILTIN.)
We now silently change the program kind from kFragment to
kRuntimeShader. For a typical SkSL shader, this does the right thing.
Change-Id: Ia8eb80a9ab596ea8a67a1a6ea4feafd20982a22f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478637
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Bug: skia:12685
Change-Id: Ie8785be73fd2f2670291e9c1295985ac7ad1d714
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478497
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This prevents google.visualization.TreeView errors I encountered while visualizing the output of bloaty against a debug build of dm.
This CL also changes the unique symbol naming scheme to use number suffixes for more human-friendly symbol names.
These changes will be reflected in the Golang port of bloaty_treemap.py (see https://skia-review.googlesource.com/c/buildbot/+/478216).
Bug: skia:12151
Change-Id: I798a8556cab4ecbcc22d960733b88eac990aa78e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478636
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12466
Change-Id: Id17222170984731eb36b8158c5c97b9880d3a814
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478496
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Now that we emit so much more tracing information, we no longer see
multiple trace_lines back to back. This pass does not actually do
anything useful anymore.
Change-Id: I29dac3ffc36a9abfa8b8eae0b687102232eeef88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478457
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This demonstrates how much additional non-trace code can be generated
when debug traces are turned on. A followup CL adds a setting to disable
`trace_var`, which eliminates a significant percentage of the additional
ops (at the cost of removing valuable debug info).
Change-Id: I238e28e6f6531f1dbccfef8f1dcd24a1e8481669
Bug: skia:12692
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478416
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
It used to be that SkScalerContext::generateMetrics could not reliably
set the fMaskFormat and generateImage could modify it. This has since
changed and the code not generally depends on generateMetrics properly
setting fMaskFormat and generateImage not changing it.
Change-Id: I9723d71370de587ef3968624d4a7eebed134b321
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477816
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
I'm not sure why this happens; the encoding does appear to be utf-8 but
some of the characters are not valid.
Bug: chromium:1256037
Change-Id: I5865d2ee237addf0680079f7072bf70aefaa6de8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478396
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
DrawWriter was using == to compare buffer bindings, but that hadn't
actually been added yet.
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-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite,Build-Mac-Clang-arm64-Release-Graphite
Bug: skia:12466
Change-Id: I769cd3cb9f58f9ffc1558da9f24b2b6000c27388
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478262
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12466
Change-Id: I85d23e73a37a368ed68c81191d072014df110080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/475645
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
In practice it has been seen that the cost of spinning up and thread and
sending over this small bit of work is not worth the savings of moving
the command pool reset to another thread. Thus we don't currently have
clients taking advantage of this feature. For now I am removing this
feature and we can add it back in later if we find a better use case or
have more total work to send to a helper thread.
Also in this change I reverse the order of resetting the VkCommandPool
and freeing the resources attached to the pool to workaround a driver
bug.
Bug: chromium:1161411
Change-Id: I8c399ecd8005ada29090902ba9b18b6837096716
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477659
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
ASTNodes were removed when we switched to DSL parsing.
Change-Id: I2cbd42f279087c14d6f5b7f4690679b8cb317b8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478356
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>
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:12466
Change-Id: If1d4c29a434a1ad3445ceadb98bd7f3b8abb5ee4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/475639
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
The device clip rectangle was not properly adjust for transformations.
It's still not quite correct, but I need to also go through the code
to reduce the number of calculations. I will fix it then.
Change-Id: Ice56601cc42bb4fd7a966d84efc8e458cb1b9529
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478058
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This was enabled by moving the iPhones off of the old RPI2 hosts.
This reverts commit 04cd6fba97.
This reverts commit a726978ae7.
Bug: chromium:1256037
Change-Id: I35069089aa39baf62a18235c8d0514923f327c53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477987
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Change-Id: Ic088fd5ac60c9218ce252cbbbf5dedbb3d62e503
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478060
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:12633
Change-Id: Ida78c4145423376dc0267096a1d758b74144fd0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477139
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>