This CL also adds helper functions (i.e., createPipeline and createPipelineWithStencil) to better encapsulate pipeline creation.
This is a first step towards making GrSimpleMeshDrawOpHelper surface its GrProgramInfos.
Bug: skia:9455
Change-Id: Ic6cc7a01383e42436305358a9b193958d862786c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273556
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I2b1a07dccb5e58dbe2488acf1b87281215b84f98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273799
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Use uniforms rather than fixed function computed varyings to implement
coord transforms for FPs that are sampled explicitly.
Change-Id: I43be3f9649550e36dbb4d1f72090a497dfeb0d31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273798
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
For Flutter, mark each bounds rect as a draw or not.
saveLayer() is the trickiest part: it doesn't draw, but its paired
restore() does, while a restore() paired with save() doesn't.
Change-Id: I5f0dc61ad5543265c5ea2bf41b236f57915847b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273501
Reviewed-by: Emmanuel Garcia <egarciad@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This means we can write a memset32 (load32 -> store32),
tested explicitly with the new unit test.
Slightly changes to the type protocol,
- load and splat now generate scalars or vectors
depending on how `scalar` is set
- store should no longer have to pay attention to `scalar`;
it's input values will already be the right size
Clean up some of the type declarations where we don't
actually need the subclass types, holding llvm::Type* instead.
This makes using ?: easier.
Change-Id: I2f98701ebdeead0513d355b2666b024794b90193
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273781
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 838007f1ff.
Reason for revert: Significant RAM regression detected by Chrome.
Original change's description:
> Add most important intrinsics to the interpreter
>
> Started with component-wise comparison and mix builtins.
>
> Implemented min, max, clamp, and saturate using those.
> Moved dot to SkSL as well. Because we now have builtins
> implemented using other (intrinsic) builtins, I had to
> split the include file in two - this lets the intrinsics
> be marked so we can call them from the second phase of
> builtins that are written in SkSL.
>
> Given that the comparisons and kSelect are now used by
> these, I added vector versions of those instructions.
> I also switched the kSelect args to match GLSL mix(),
> mostly so the logic of mapping intrinsic arguments to
> instruction register args remains simple.
>
> Inspired by the (never-landed):
> https://skia-review.googlesource.com/c/skia/+/230739
>
> Change-Id: Iecb0a7e8dc633625ff2cada7fb962bf2137fa881
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272516
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com,reed@google.com
Change-Id: I931a0ccc254b55339c9b077543a0daaf28146b19
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273800
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
And rearrange a little so that it's more similar
to the other JIT state we track, so this sort
of bug is less likely in the future.
Change-Id: I64ddb791490efdbbcecb53cce823dda5c8d7c68b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273779
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This allows us to move iOS-specific stuff from individual recipes into
the flavor module.
First in a long series of CLs to clean up recipes and move to task drivers.
Change-Id: Iff01610f76c71920639328ead5209e0cd5d93f31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273762
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
This reverts commit 289ecf8b9b.
Reason for revert: The addition made in the autogenerated Go Deps CL was superfluous was by the time I got around to merging and submitting it, now it's breaking CheckGeneratedFiles.
Original change's description:
> Update Go Deps
>
> Change-Id: I4f78bfcbd56e0ba1b318f06c281a9503ff378ed5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272895
> Commit-Queue: Weston Tracey <westont@google.com>
> Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
TBR=skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com,westont@google.com
Change-Id: Iccda32bc10bf19610260eec83816ebe6e69c8ae7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273767
Commit-Queue: Weston Tracey <westont@google.com>
Reviewed-by: Weston Tracey <westont@google.com>
This reverts commit 915b779f9c.
Reason for revert: finally coming back to this, figure out what's wrong on Android
Original change's description:
> Revert "Track device coordinate space as matrix"
>
> This reverts commit b74d5548a4.
>
> Reason for revert: see if this fixes the android roll
>
> Original change's description:
> > Track device coordinate space as matrix
> >
> > This is a required step to be able to cleanly draw image filtered
> > device layers with arbitrary matrices, instead of relying on
> > SkMatrixImageFilter to apply the transformation.
> >
> > Bug: skia:9545
> > Change-Id: I8d84679a281538875cf4a1b73565294fb7f89c86
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249076
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
>
> TBR=robertphillips@google.com,reed@google.com,michaelludwig@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: skia:9545
> Change-Id: Ie374a7500cfbff35cb0782beb863086e118a005a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249986
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=robertphillips@google.com,reed@google.com,michaelludwig@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:9545
Change-Id: If31a9be86cb340a0874533c044c19b6787d5f176
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272340
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Change-Id: If718decf8867cd66d8394a4f7fc646cf3f0950b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273609
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
With the removal of rescaling of NPOT textures this no longer matters.
Change-Id: I313e895407c3a2c616e6113a5bde75dc6a167e7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273519
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
I've also added in a disabled path to do quasi -O1 / -Os
passes, but mem2reg is really all we need, and I think we
can eliminate the need for even that.
Codegen looks great now, e.g.
(lldb) dis -s fJITEntry -c 40
0x10a48c000: movabsq $0x10a48d000, %rax ; imm = 0x10A48D000
0x10a48c00a: vbroadcastss (%rax), %zmm0
0x10a48c010: cmpq $0xf, %rdi
0x10a48c014: jbe 0x10a48c04d
0x10a48c016: nopw %cs:(%rax,%rax)
0x10a48c020: vmovups %zmm0, (%rsi)
0x10a48c026: addq $-0x10, %rdi
0x10a48c02a: addq $0x40, %rsi
0x10a48c02e: cmpq $0xf, %rdi
0x10a48c032: ja 0x10a48c020
0x10a48c034: jmp 0x10a48c04d
0x10a48c036: nopw %cs:(%rax,%rax)
0x10a48c040: movl $0x2a, (%rsi)
0x10a48c046: decq %rdi
0x10a48c049: addq $0x4, %rsi
0x10a48c04d: testq %rdi, %rdi
0x10a48c050: jne 0x10a48c040
0x10a48c052: vzeroupper
0x10a48c055: retq
Change-Id: Ief5d12548d5b1a683060b2b5d207022d673fe761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273606
Reviewed-by: Herb Derby <herb@google.com>
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (recipe_engine) into this repository.
recipe_engine:
https://crrev.com/a36bdfd1c28f088e1c39736babb987e71284d646 (yiwzhang@google.com)
[warning] Support recipe warning registration
More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
TBR=borenet@google.com
Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: Ib4aabdc682910ea9f7243c2f1ac0eba621fa2d71
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273617
Reviewed-by: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Change-Id: Ie50b15323df0a71c8d4276e3bc603061e469824d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273465
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Started with component-wise comparison and mix builtins.
Implemented min, max, clamp, and saturate using those.
Moved dot to SkSL as well. Because we now have builtins
implemented using other (intrinsic) builtins, I had to
split the include file in two - this lets the intrinsics
be marked so we can call them from the second phase of
builtins that are written in SkSL.
Given that the comparisons and kSelect are now used by
these, I added vector versions of those instructions.
I also switched the kSelect args to match GLSL mix(),
mostly so the logic of mapping intrinsic arguments to
instruction register args remains simple.
Inspired by the (never-landed):
https://skia-review.googlesource.com/c/skia/+/230739
Change-Id: Iecb0a7e8dc633625ff2cada7fb962bf2137fa881
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272516
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Replaces GrMesh::SendToGpuImpl with direct draw(), drawIndexed(),
drawInstanced(), and drawIndexedInstanced() calls on GrOpsRenderPass.
For now these calls take the index/instance/vertex buffers, but we
will soon switch to binding those in a separate call.
Change-Id: I55d225b5695d88ecc661916c2aeb3f31d21e5585
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273179
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This is a reland of af5f9f008d
This was reverted due to Metal GMs failing. That is a bug in Metal where
pipeline creation fails with "internal error". Reporting to Apple, filing
Skia bug, and moving on.
Original change's description:
> Remove GrDeviceSpaceTextureDecalFragmentProcessor.
>
> It was used to sample clip masks using device coords.
>
> Replace with a more generic GrDeviceSpaceEffect that simply calls a
> child FP with sk_FragCoord.
>
> Also fix issue in GrQuadPerEdgeAA GP. It wouldn't setup coord transforms
> at all if they are all applied in the FS (explicit coords). Moreover,
> the GrGLSLGeometryProcessor::emitTransforms() helper required a valid VS
> var for local coords even when all FPs use explicit coords and wouldn't
> use a local coords var.
>
> Make CPP SkSL code gen for clone copy the explicit coord status of
> children.
>
> Change-Id: Ib8bb36028354405c8012f6e91e9eb46db75d16a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271658
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: Ia4530e6799019cd92863fe983a2d3c71df6f0620
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273511
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:9935
Change-Id: Id8b851afdd97f8405dbb405e3f142f86dbe1de31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273003
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This brings this op into closer correspondence with the other ops.
Change-Id: Idf4f68dcad5492d9ae66c34a9c8a86ff925de26e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273492
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
With the addition of the DDL program pre-compilation we need to know how it is working.
This CL also fixes some threading bugs.
Bug: skia:9455
Change-Id: I20da58a7f1b19685687fae1d159d4e0db8a4964d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273001
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: Id133cb4c97931fb6a8c7d1d6d6b0bb09cbd47d85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273486
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Change-Id: I0296ff5a68b934f6bc7152a66f57ef045fc94daf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272721
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 1eff9dce5b.
Reason for revert: breaks housekeeper -- don't know why
Original change's description:
> Revert "Skip rewriting headers that reference SkM44.h until we can remove the private copy of it"
>
> This reverts commit 09a73000ea.
>
> include/private/SkM44.h is gone, so we can undo this hack
>
> Change-Id: I770063c8468ad7f4c51fa41ca407e4655c90c15f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273457
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=reed@google.com
Change-Id: I9ce1d7ca55f5464b3ece16cd0d7060e4d402960e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273409
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This reverts commit 09a73000ea.
include/private/SkM44.h is gone, so we can undo this hack
Change-Id: I770063c8468ad7f4c51fa41ca407e4655c90c15f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273457
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Just the basics of getting existing basic structure in place.
Hoping to flesh this out over the next week or so.
Change-Id: Iba3a3023cc779ffa5fa6f79ebedd53499c076442
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273323
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
No color type fallback
Change-Id: I0429491cca1088e877ba2da2ff71ef2219ac9ec7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272521
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: chromium:1054887
Change-Id: I792a416c7071da75460016574f9aef8832f47e9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273319
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Small behavior change: will not check for shader success and program
linking success over the command buffer in a debug build.
Also fail gracefully if stencil renderbuffer allocation fails.
Bug: skia:9938
Bug: chromium:1040186
Change-Id: I623f09d306261d28070078268f6242f92d65fd5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273276
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>