The GPU thread has privileged access to the GPU so its work can't be easily borrowed.
Change-Id: I1eae4c86ff1c36cc1248f74fc48d76b1c243f0b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284764
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Moves this logic to happen directly ion GrTessellatePathOp instead.
Change-Id: Ia972b8c686bdf8efb8e414fbddc856401fe44920
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284999
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Now it returns the actual curve count instead of an "isLinear" bool.
Change-Id: Iaf2d5c6d96a59972bc7481c17580f2ac5e4b0a25
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284979
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Remove comparison function from SamplerDescriptor, to avoid new
validation error.
Also remove other values which are at default.
Change-Id: I99631187f02d6b26748a34cf07c0bc672e2f0607
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285014
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Clarity refactors: rename alias_reg() to try_alias() and add in_reg().
Let dst() hint what register to try_alias(), and use this anywhere
aliasing is safe and we have an argument that's either already in a
register or is guaranteed to be pulled back into one, e.g r(x).
Cases like vsqrtps(dst(), any(x)) are somewhat interesting, in that if x
is in a register, it is a good thing to alias, but if it's on the stack,
it's better to just vsqrtps directly into the new register.
Change-Id: I05ecb78f660e9e4ea0df44f03e5de03b85a49cc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285086
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This is the last thing needed for creating the pipeline state so this
change also starts creating the pipeline state and fixes errors involving
it.
Change-Id: Ifd1b63016d692d98cfa2a931957e857a5c53bec5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284527
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This allows us to create the binary shaders for d3d. We generate spirv
from sksl, then use spirv-cross to turn it into hlsl. Then that gets
compiled into binary to be used in the pipeline.
Adds hooks GrD3DOpsRenderPass to start creating the pipeline.
Change-Id: Ie731dd945cdd9a00cebd78c1371a3d9784e4e1a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284526
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
It occurs to me that now that we have some values living on the stack,
we might actually want to change our codegen based on what's in
registers or what's not.
E.g.
a->vaddps(dst(), r(x), any(y))
is great if x is in a register, but it'd have been better as
a->vaddps(dst(), r(y), any(x))
if x is on the stack. I've made every symmetric op make this choice.
Change-Id: I1c65940d8e1a53d9dba44dd3a5f3e443517c8e20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284983
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This adds alias_reg(Val v), aliasing dst() to r(v) if dies_here(v).
We can use this to execute most FMAs without that first vmovups.
Still thinking about the more general case of aliasing to reduce
register usage and not to cut instructions. I've seen zero perf
impact from this change which _does_ actually remove instructions,
so I'm suspicious whether we'll find value doing more, and this
is a little complicated by having some arguments on the stack.
I guess you're using the metric of counting total spills? That
might be worth minimizing even if I'm not seeing a wall clock diff.
Latest patch set restores all the ARM aliasing cases too.
Change-Id: Icd5241b58f36403a447e575f5edf88c5aca63e60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284982
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
In certain corner cases the RenderTargetContext can end up injecting a
clear op into the op stream, so we need to handle that.
Bug: skia:10163
Change-Id: I57722d335bbc59bb9f0a767f774a4620dfde3f39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284878
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This is mostly a no-op bookkeeping change, converting our cleanup
fingers from pointing into regs[] to register IDs themselves, following
the usual convention of NA meaning none.
But this does allow us a future flexibility, letting us think of regs[]
as the inter-instruction register state, tracking intra-instruction
dst,x,y,z registers a little more carefully.
Under the old system, if you alias id and x into register 7, which Val
do we write in regs[7]? Neither is exactly correct, and writing either
one breaks calls to r(the other). But long term, the right answer will
be id... that's the Val that's in the register as the next instruction
begins.
So rx can answer "which register holds Val x?" during the instruction
even when we alias x and the destination, when regs[rx] == id, not x.
Spinning this off a precursor CL, but probably no point landing it
unless the CL that builds on this works out.
Change-Id: I528c46ec2d00a965125749562ef10b76f973a3cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284955
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
b7d6949b91..913f4f4213
git log b7d6949b9112..913f4f421381 --date=short --first-parent --format='%ad %ae %s'
2020-04-23 timvp@google.com Vulkan: Support VS, FS, and CS in the same PPO
2020-04-22 j.vigil@samsung.com Refactor SyncHelper with vk::Resource
2020-04-22 jmadill@chromium.org Re-land: "Vulkan: Forward RenderBuffer/Surface dirty messages."
2020-04-22 timvp@google.com Vulkan: PPO: Allocate uniform descriptor set if list is empty
2020-04-22 lehoangq@gmail.com Implement GL_APPLE_clip_distance
2020-04-22 cclao@google.com Vulkan: add vulkan error code in the error message
2020-04-22 courtneygo@google.com Add capture support for FenceSync
2020-04-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/vulkan-validation-layers/src 09f4b08483bb..36d7cca6fdc9 (1 commits)
2020-04-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/SwiftShader ff772a7bcc98..ceb6258ae101 (1 commits)
2020-04-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/glslang/src 3f4e5c456306..c9b28b9f3388 (1 commits)
Created with:
gclient setdep -r third_party/externals/angle2@913f4f421381
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC jcgregorio@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: None
Tbr: jcgregorio@google.com
Change-Id: I11f435bfa8efaba8fdff7f4e53240fe92339a39d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284989
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
This fixes in issue on some mobile gpu's where the larger negative value
caused precision issues when trying to interpolate.
Change-Id: Id76e6f96be2a7e46720794f54c24dafe567c5836
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284956
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
We only need this used_in_loop bit now to decide whether to clean up
values in registers when they die. Instead we can just extend the
lifetime of these values (anything that is can_hoist and used_in_loop
today) to the end of the program.
Change-Id: Ia0d29eccf81b97927add26f2f0f8226141485b8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284833
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Looks like this is a libstdc++ bug, not being able to make a const
structured binding to OptimizedInstruction? There are non-const
OptimizedInstruction structured bindings in the file already...
Anyway, this structured binding was already a bit of a pain for
not being able to close over its elements in a lambda. So toss
the whole thing and manually unpack a bunch of const variables.
Kind of nice to not have to unpack fields we don't use too.
All the const here is not particularly important, but I found it
reassuring during a dark time of unknown bugs.
Change-Id: I0942ff5a0ea20f29c54d9a6a49883d17e9b40e58
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284943
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
- cheap search for available registers before
falling back on expensive scoring (big deal)
- free dying registers proactively (medium)
- free TMP registers manually (peanuts)
This drops the SkVM_Overhead_VM bench from 49µs to
38µs on my laptop. It was 32µs before the refactor,
so there may still be some potatoes to dig up here.
Change-Id: I6822613e9186278e80ec045e84517ac3a32d6f43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284832
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Main ideas:
A) Register / stack bookkeeping separated again from
the code generation. Each instruction can ask for
registers, and we'll take care of tracking where
the values should live uniformly.
B) No registers we use during an instruction overlap.
This makes reasoning about correctness much easier,
and eliminates the need for most temporaries and
strange manual register allocation (e.g. vgatherdps).
C) r(Val) always gives a value in a register,
but also any(Val) lets us use it from the stack.
Redid all the register management this time around
to be as simple as possible, hopefully eliminating
bugs. A single `regs` array tracks the state of each
register, either holding a value ID or one of a few
sentinels.
Hoisting was hard but so obvious now!
Glad we worked out those phi nodes.
Tests pass, no diffs.
Perf looks improved everywhere I have looked, e.g.
nanobench --config 8888 -m bitmap_RGBA_8888_A_scale_bilerp --skvm
100µs -> 78µs
nanobench --config 8888 -m bitmap_RGBA_8888_A_scale_bicubic --skvm
631µs -> 245µs
In exchange a noticeable overhead hit, I'm sure fixable:
nanobench -m SkVM_Overhead_VM
32µs -> 49µs
Lots of TODOs left for follow ups:
- allow some degree of dst/arg overlap, particularly for FMAs
- track what values are on the stack, don't spill them twice
- better heuristics for spilling
- clean up any unused bits in OptimizedInstruction
Change-Id: Ib18c0adb1fe637a1242df3de30fbc37ccbc3c009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284553
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
More sites to update, but can happen later
Change-Id: I75e8b60050c6af2a1563057f7fe9da84bc017370
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284876
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Placeholders should not be taken in MinIntrinsicWidth.
Placeholders should allow Inf in some style values (as weird as it
sounds)
Bugs: skia:10138, skia:10159
Change-Id: I6ecc57b6ce778faf84b4d5752d24552b12c69fdb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284731
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
8f48ba9f25..b7d6949b91
git log 8f48ba9f256f..b7d6949b9112 --date=short --first-parent --format='%ad %ae %s'
2020-04-21 m.maiya@samsung.com Vulkan: Enable persistently mapped buffer objects
2020-04-21 tobine@google.com Vulkan: Allow commands to completely fill allocation
2020-04-21 geofflang@chromium.org GL: Make sure primitive restart emulation is disabled below GL 3.1
2020-04-21 cclao@google.com Vulkan: Skip load if depth/stencil value are undefined
2020-04-21 tobine@google.com Vulkan: Refactor SecondaryCommandBuffers class
2020-04-21 geofflang@google.com Don't redefine VMA_IMPLEMENTATION in build files and source
2020-04-21 jmadill@chromium.org Revert "Vulkan: Forward RenderBuffer/Surface dirty messages."
2020-04-21 tobine@google.com Vulkan: Manual validation roll
2020-04-21 geofflang@chromium.org Fix quotes around emails in WATCHLISTS
2020-04-21 cwallez@chromium.org CGL/EAGL: Fix default FBO size on Retina displays
2020-04-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/vulkan-loader/src 50eaecd721a2..4fb0e0374a39 (1 commits)
2020-04-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/spirv-tools/src 61b7de3c39f0..67f4838659f4 (1 commits)
2020-04-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/SwiftShader 068611f07d28..ff772a7bcc98 (1 commits)
2020-04-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/vulkan-tools/src 8824107d57d3..84463fe2902f (1 commits)
2020-04-21 cnorthrop@google.com Capture/Replay: More mid-execution capture support
2020-04-21 cnorthrop@google.com Capture/Replay: Handle default uniforms during MEC
Created with:
gclient setdep -r third_party/externals/angle2@b7d6949b9112
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC jcgregorio@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: None
Tbr: jcgregorio@google.com
Change-Id: I9b625ff8ff7581c04a7c27bf61ee0200936d1e69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284835
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Makes nomenclature more conistent across different classes.
Change-Id: I9f052bbd38082d95714702b2ae960c4e15fdc181
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284718
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Make it more explicit when we're converting between SkMatrix and
SkM44 (in either direction).
The IsScaleTranslate helper could have been static in SkCanvas,
but we're probably going to need it when we start pushing SkM44
down to SkDevice.
Change-Id: Ia013c7f59cdbac78b5a04fdcaafb62a0a626cb53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284735
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
The trimbytes were being set to values based on the texture rather than
the given inputs.
Bug: skia:9935
Change-Id: Ic3227236e4c3920ca4586c35791b15f5a596c069
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284798
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: I44ed5306155af089fab6d97b0e2108e637c46d63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284732
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:10139
Change-Id: I20cd95fcf5f11832366c32e48ed4d442c82b0719
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284082
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This fixes several issues:
* sysopen.py was moved to bin/sysopen in previous CL. Change to
use os.system to run it
* "adb push" doesn't follow symlinks.
* SkQP added a new commandline flag for rendertests file.
* The report path was wrong in old code.
Bug: skia:10156
Change-Id: I821a49c49bffe588f34d1216d9406c97ae5a903b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284524
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Auto-Submit: Lepton Wu <lepton@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
This is to avoid conflicts with macros defined by Windows include files.
We were previously #undefing these macros, but that ended up causing its
own problems.
Change-Id: Ib16dd93bd5dbdb4ffd87d560c21c5b344bf67a9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284277
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Inside SkOpEdgeBuilder::walk(), when current segment is cubic curve, its shape may be reduced, therefore, the curve points should be determined by the reduction result ‘split->fVerb’ instead of ‘verb’.
Actually, inside this switch case, ‘verb’ is always ‘SkPath::kCubic_Verb’, which makes the ‘fCanAdd’ always true. The outcome of this bug makes the subsequent logic which depends on ‘fCanAdd’ (L301-332) incorrect, and in some cases, fails the whole boolean operation at L329.
The Fiddle below demonstrates how this bug fails a union operation of two paths, by returning an empty path.
https://fiddle.skia.org/c/e528567b62bc338cd99f4a89f0c5342e
Screen shot of the fiddle:
https://www.dropbox.com/s/4bnzlponq6gen27/pathOpsBug.png?dl=0
2nd Fiddle drawing the results (larger)
https://fiddle.skia.org/c/1f2a513c2ee0395b9d05fb1eb987b01f
Change-Id: If07f54cef1b9409f9b6db27d6294a3e3461b0181
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284426
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This reverts commit 198393b2de.
Reason for revert: android crash
Original change's description:
> Notify RTC when OpsTask is closed so it can drop ownership
>
> Change-Id: I95d32ed89447995541f33bf80730876ce9c0747a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284519
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: I5133fa1b8f90182864ffbee3b60bfd5781dc16bd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284728
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This moves the dawn spirv implementation of these classes into a shared
class that will be used by d3d backend. We can look into further extending
the class to see if it can be shared with vulkan as well.
Change-Id: I138d403dd55053f534d0c97a55c0fa5d2c5171f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284525
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
* Add resource copy routines to command list
* Be sure to release resources from command list
Change-Id: I174c5a026d5e2289e6db56215b0d140c19ccf39e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284156
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>