That's what we care about at the moment.
Change-Id: I71a6538492d1d26be12a8d7a02c9d47667813e92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276752
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
While I think trunc(mad(x, scale, 0.5)) is fine for doing our float
to fixed point conversions, round(mul(x, scale)) was kind of better
all around:
- better rounding than +0.5 and trunc
- faster when mad() is not an fma
- often now no need to use the constant 0.5f or have it in a register
- allows the mul() in to_unorm to use mul_f32_imm
Those last two points are key... this actually frees up 2 registers in
the x86 JIT when using to_unorm().
So I think maybe we can resurrect round and still guarantee our desired
intra-machine stability by committing to using instructions that follow
the current rounding mode, which is what [v]cvtps2dq inextricably uses.
Left some notes on the ARM impl... we're rounding to nearest even there,
which is probably the current mode anyway, but to be more correct we
need a slightly longer impl that rounds float->float then "truncates".
Unsure whether it matters in practice. Same deal in the unit test that
I added back, now testing negative and 0.5 cases too. The expectations
assume the current mode is nearest even.
I had the idea to resurrect this when I was looking at adding _imm Ops
for fma_f32. I noticed that the y and z arguments to an fma_f32 were by
far most likely to be constants, and when they are, they're by far likely
to both be constants, e.g. 255.0f & 0.5f from to_unorm(8,...).
llvm disassembly for SkVM_round unit test looks good:
~ $ llc -mcpu=haswell /tmp/skvm-jit-1231521224.bc -o -
.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 15
.globl "_skvm-jit-1231521224" ## -- Begin function skvm-jit-1231521224
.p2align 4, 0x90
"_skvm-jit-1231521224": ## @skvm-jit-1231521224
.cfi_startproc
cmpl $8, %edi
jl LBB0_3
.p2align 4, 0x90
LBB0_2: ## %loopK
## =>This Inner Loop Header: Depth=1
vcvtps2dq (%rsi), %ymm0
vmovupd %ymm0, (%rdx)
addl $-8, %edi
addq $32, %rsi
addq $32, %rdx
cmpl $8, %edi
jge LBB0_2
LBB0_3: ## %hoist1
xorl %eax, %eax
testl %edi, %edi
jle LBB0_6
.p2align 4, 0x90
LBB0_5: ## %loop1
## =>This Inner Loop Header: Depth=1
vcvtss2si (%rsi,%rax), %ecx
movl %ecx, (%rdx,%rax)
decl %edi
addq $4, %rax
testl %edi, %edi
jg LBB0_5
LBB0_6: ## %leave
vzeroupper
retq
.cfi_endproc
## -- End function
Change-Id: Ib59eb3fd8a6805397850d93226c6c6d37cc3ab84
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276738
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Also adds a drawIndexPattern() helper method to GrOpsRenderPass, and
starts testing a base index with drawIndexedInstanced.
Change-Id: I3fbb1b5a2a1012a4fcbe126c54ddbc8c17ce80b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276739
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Seems very one-off (esp. given SkSL). No one seems to use it.
Change-Id: Iaded54c5b4183fa4aa9c318b5dbe1d410cca539a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276617
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
'$' lets you see what the serialized version looks like. Helps diagnose
failures in dm/fm
Change-Id: I0c3acdeb6e7f170f5caeba1c0516b449eb7402ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276756
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
This CL moves the boiler-plate implementation of onPrePrepareDraws up to GrMeshDrawOp. This, unfortunately, required the addition of a 'programInfo' virtual but that may go away in the future.
The only GrMeshDrawOp-derived classes left are:
AAHairlineOp - which has 3 programInfos
AAFlatteningConvexPathOp - which has >=1 mesh (but just 1 programInfo)
GrAtlasTextOp - which has inline uploads
SmallPathOp - which, maybe, has inline uploads
TextureOp - which has chaining
Bug: skia:9455
Change-Id: Id10f70e764054134751545ad38b99f0a0778de76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276642
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Directly compute things like stride and vertex attribute types from the
underlying state, rather than trying to keep two tiers of flags
correctly in sync.
With these changes, createProgramInfo can be pushed to onExecute.
Change-Id: I0b021b3880a92e5782f821ebe95ac5aee288f7bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276643
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
SkCanvas keeps its non-exotic drawBitmap calls for now but they
immediately wrap the bitmap in SkImage::MakeFromBitmap. This will
add a copy for mutable bitmaps, but this can be worked around by using
images directly (preferred), or marking the bitmap as immutable. In
practice, mutable bitmaps do not seem to be widely used so this is
deemed acceptable for now.
Several GMs are updated to mark the bitmaps as immutable in order to
avoid pixel churn in how CPU vs. GPU mipmaps are generated. As we move
towards explicit mipmap generation, this distinction will become less
critical, so I'm just avoiding it for now. See skbug.com/9337 for mipmap
proposal. The image diffs encountered in this CL directly related to
generating mipmaps for bitmaps already cached on the GPU vs. not on the
GPU yet.
It was decided to copy if mutable vs. never copying the bitmap because
it preserves the image guarantees the devices and canvas' rely on,
and imposing the need to inspect an image for mutability is undesired.
Bug: skia:10037, skia:9337
Change-Id: If152e6cae1e155ccf6bd2cd755895f3c7a0135a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276004
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Until now I've been setting this in GN args, but that leads to slow
complete rebuilds. Defining it in SkVM.h makes for a smaller rebuild.
(WFH optimization)
Change-Id: Iaebebd49efaa2df6ef09606989d608cb6a5e630e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276690
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Change-Id: Id3313169be2fecfb8a11045f08a55490fbec9b9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276486
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
- Switch to using GrVertexWriter to eliminate bookkeeping
- Hoist the position transform out of the loop with a call to
MapPointsWithStride. This lets us do the matrix type checking and
proc lookup once, rather than N times.
- Remove another branch (local coords) by just making localCoord point
at positions if they're not present in the mesh.
- Compute the stride directly from flags, paving the way for delaying
the program info creation until onExecute.
Bug: skia:9984
Change-Id: I2b8b2ce60b3cd97361ae9562c0412b65251f58f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276483
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This CL:
Renames the existing createProgramInfo method to onCreateProgramInfo and makes it a virtual on GrMeshDrawOp
Moves the non-virtual createProgramInfo (helper) calls to GrMeshDrawOp
Changes onCreateProgramInfo to not return a ProgramInfo*. This is setting up to handle ops that create >1 programInfo (e.g., AAHairlineOp)
This CL leaves the following 8 ops in need of an onCreateProgramInfo implementation:
AAHairlineOp
AAFlatteningConvexPathOp
GrAtlasTextOp
GrShadowRRectOp
SmallPathOp
GrTextureOp
PrimitiveProcessorTest::Op
VertexColorSpaceBench::Op
Bug: skia:9455
Change-Id: Id7e2b8a40cac86ede6bf3c0e544da5500ff47d8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276403
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Change-Id: I7b62a8c94d1afde1bbec0c476ef8cf8d0e09b677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276636
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
c5b3cbdb45..2e5bd9b1e6
git log c5b3cbdb4502..2e5bd9b1e658 --date=short --first-parent --format='%ad %ae %s'
2020-03-11 ynovikov@chromium.org Update SimpleStateChangeTest.DrawRepeatUnalignedVboChange suppression
2020-03-11 timvp@google.com Fix SearchProvider
2020-03-11 geofflang@google.com Refactor ANGLE target to allow GoogleANGLE to override it.
2020-03-11 geofflang@google.com Use ANGLE's vulkan-headers dep when rolling ANGLE into Android.
2020-03-11 jonahr@google.com Add -rpath entries for non-component builds on Mac
2020-03-11 jonahr@google.com Relax GL_DEPTH_COMPONENT32_OES format support rules
2020-03-11 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/vulkan-validation-layers/src 014968c3b6b3..2ff8b6a6f4d5 (4 commits)
2020-03-11 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/SwiftShader 8be72df60462..16ae92a4ee52 (1 commits)
2020-03-11 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/glslang/src 343d4f6f1870..e2176c91b23c (2 commits)
2020-03-11 jie.a.chen@intel.com Remove MultisampleCompatibilityTest suppression
Created with:
gclient setdep -r third_party/externals/angle2@2e5bd9b1e658
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 brianosman@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-Debian9-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: brianosman@google.com
Change-Id: Iabc19d57019d9074c12b90877624a4682f76f40e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276598
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Metal and D3D don't require the GrGpu to delete resources, and for
Vulkan, we'll store the GrVkGpu in each individual resource. This will
allow us to use sk_sp<SomeManagedResource> in the future.
Bug: skia:9935
Change-Id: Id51022b935ad360367976a6bdf60cdda9e3f7dee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276456
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
It's not clear that this ever happens, so I'd rather keep the code as
simple as possible.
Bug: skia:9984
Change-Id: I2c78eb411d9259f10d208306b173ad7395421c3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276477
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Locally this looks to have a perf win especially on Android. We no longer
have to update the values in the uniform descriptor every draw. Also since
we essentially have one uniform buffer per draw already, we were making a
descriptor set per draw as well. Now we just tie them to the uniform buffers
and we should end up with about the same amount.
Change-Id: I65c6a8b2ad5c631c4dbb7ea50068f71a0ed4c894
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276476
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This was a convenience for Cary to not have to use extra_cflags,
and iterferes with using prebuilt C++ code by breaking the ABI.
Change-Id: I9e14ec04106a0abf9b55e5803242c2eb226d6e3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276445
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
A significant number of spatial keyframes have trivial Bezier control
points - e.g. located on the linear interpolation segment. The
corresponding cubics have no effect and can be discarded.
Change-Id: I706546653c3621fd0d3eb9c285627ccd4d0bc549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276410
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
No one was using this, and it added significant complexity to
GrDrawVerticesOp.
Bug: skia:9984
Change-Id: I23f38b3f5d853a8e531f13b6931cd57b5985a2c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276407
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This implements SkCanvas::drawAtlas so doesn't actually have any of the (text) atlas complications.
Bug: skia:9455
Change-Id: I36a2aabe5a667d85bed75b400981defcaf421feb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276276
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Here is another Op w/ multiple GrMeshes drawn w/ a single programInfo (cf., AAConvexPathOp).
Bug: skia:9455
Change-Id: I3d1eec03d1d9d4fc8e117aa2960472027ea96105
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276220
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit a19ea58aa9.
Reason for revert: As expected perf slowdowns, but we have the data now
Original change's description:
> Experiment with no longer avoiding uploading same uniforms in vulkan.
>
> The plan is to land this and see what the perf bots report. Only local
> desktop a little less than half the time we skip the upload for not being
> dirty. But we're not sure if this is saving us much. Unless there is no
> regression at all, we will revert this.
>
> Bug: skia:10035
> Change-Id: I8a3a8862ccd10ba109b5ddc2f3473d30b3ceccaf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276211
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,michaelludwig@google.com
Change-Id: Iea44b13c70cd075e93bb52b3a6773cc8b5df731a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10035
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276396
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
abcc536b62..c5b3cbdb45
git log abcc536b6207..c5b3cbdb4502 --date=short --first-parent --format='%ad %ae %s'
2020-03-10 cclao@google.com Vulkan: Use VK_FORMAT_D24_UNORM_S8_UINT for 24 bit depth if available
2020-03-10 tikuta@chromium.org use go swarming client in trigger.py
2020-03-10 rafael.cintron@microsoft.com Enable allowClearForRobustResourceInit for NVidia hardware
2020-03-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/glslang/src 6861ea4e10a1..343d4f6f1870 (3 commits)
2020-03-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/vulkan-validation-layers/src 97484d689869..014968c3b6b3 (11 commits)
2020-03-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/SwiftShader b44162fdbb25..8be72df60462 (1 commits)
2020-03-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/spirv-tools/src 4c027048d88b..dd3d91691f1e (3 commits)
Created with:
gclient setdep -r third_party/externals/angle2@c5b3cbdb4502
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 brianosman@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-Debian9-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: brianosman@google.com
Change-Id: Ia27e014e5665b7cc5bbc3d922a94bf677f974196
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276117
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
This removes the need for overhead like NoClip and the second call to
hash_shader() by treating null clip shaders specially.
Change-Id: I409fb6eb890e1dbaf242ecf94188aa9c477f39f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276230
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This appears to work.
As a follow up, I want to try taking a little care handling a null and
opaque clip shaders explicitly, to cut down on the overhead in the
common case when it's null and we burn non-zero CPU determining NoClip
is a no-op.
Change-Id: Ie30c4995b3242a5b52935a90005e5af79c9eae7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276227
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Got distracted when looking at SkCTMShader
and implemented this for SkVM instead.
Nothing tricky at all. Exactly like SkRP impl.
Added some commented out SkDebugf() to help me
find what impls are missing.
Change-Id: Ie11e1996c5d1b72f202cc1635cf13e4f2e1f14d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276234
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Bug: skia:9935
Change-Id: Ie13b9077c5db805020973e5cbab1aa8468c88742
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276214
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:3803
Change-Id: If2b529bf9167e2a94784d8797ce28a9618e86d11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276203
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
The SkVM bots set this define, overriding the check at head.
Change-Id: Icbd7cb8c06ccba15a60855aefc92a43d624f51ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276224
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Previously, the CPU backend would catch this later (ByteCodeGenerator),
and the GPU backend would assert in expandFormatArgs (out-of-range
function index).
Change-Id: Ib84bf7c477ddcc9fd3091c5b106ebdd654e9a30b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276000
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
No need for an intermediate adapter object - just bind individual/scalar
fields using existing mechanisms.
No functional side effects.
TBR=
Change-Id: I16be769e5fb92dba0ebb6ce3b0584c5cdcc2b92c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276215
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
This Op is interesting bc it has multiple draws (i.e., it has multiple GrMeshes).
Bug: skia:9455
Change-Id: Ifdd0f07c713cfd88f77038f9a63289d004ffe83b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276208
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>