The compiler can complain about these signed to unsigned conversions.
Explicitly cast them in initWithPreallocatedStorage to match the way
this is already done in init [0].
[0] 311b648013 "pack SkTArray"
Change-Id: I0f723094fd356f9c5971b35998c4ecd59c09332f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/536099
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Bug: skia:13286
Change-Id: Icf09efe04add2418832d6e348190b31fefc79c61
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/536136
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This CL:
Adds a name to each snippet
Labels the output_%d variables w/ the snippet they are the result of
Labels each set of uniforms w/ the snippet they feed into
Bug: skia:12701
Change-Id: Ib28fe265aaa63affe98386ead83ccdf4fb61c7e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535962
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 7d9f07c108.
Reason for revert: fixing public.bzl
Original change's description:
> Revert "Delete HW tessellation shaders for curve/wedge tessellation"
>
> This reverts commit 038818ba8e.
>
> Reason for revert: breaking g3 roll, need to update public bzl file I think
>
> Original change's description:
> > Delete HW tessellation shaders for curve/wedge tessellation
> >
> > GrPathTessellationShader_MiddleOut.cpp is just moved into
> > GrPathTessellationShader.cpp, and a few factories are cleaned up since
> > we don't have to differentiate between middle-out or hardware.
> >
> > Bug: skia:13263
> > Change-Id: I420faa614a89ef1a2c0f1075d1f8a067d15e9a81
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534200
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> Bug: skia:13263
> Change-Id: I42367a21c2bf1a4283e5d9b8d0e00961f9dea2e7
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/536039
> Auto-Submit: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bug: skia:13263
Change-Id: I76101f1dbfee454053c8d7502e83d3b04a768b34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/536096
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Due to a bug in the WebGPU emscripten bindings, the Dawn backend was
only mapping 0-size region of a GPU buffer when invoking
wgpu::Buffer::MapAsync. To map the entire buffer, we now call it with
wgpu::kWholeMapSize.
Note that due to the same Emscripten bug, wgpu::Buffer::GetMappedRange
must be invoked with "size = 0" to obtaine the entire mapped range. This
inconsistency was the root cause for the mapping failures described in
skia:13266.
Also removed the workaround in the webgpu-bazel demo and made the demo
default to rendering a runtime effect because it's cooler.
Bug: skia:13266
Change-Id: Ia42fd33a4c897a99d37f0a43b065c1dd2f45ec22
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534944
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
GrDawnGpu tries to guarantee the CPU mapping invariants of GrDawnBuffer
objects that are managed by a GrStagingBufferManager by issuing and
tracking mapAsync requests following command buffer submission. However,
this logic suffered from some issues where:
1. The code always assumed mapAsync succeeds. If a mapAsync request
failed during shutdown due to a lost GPU connection, the GrDawnGpu
destructor would spin forever waiting for pending mapAsync requests
to complete.
2. If a client unmapped and then re-mapped a buffer that isn't managed
by the async staging buffer logic in GrDawnGpu, the buffer would
never get mapped and likely hit an assertion for a non-staging
buffer.
These are now fixed:
* GrDawnBuffer now has more explicit error handling to make it more
tolerant to mapAsync failures.
* GrGpuBuffer now relies on mapAsync completion callbacks instead of
spinning on `GrGpuBuffer::isMapped` as a buffer may never get mapped
in the case of an error. This also has the benefit of tracking the
mapAsync procedure state on a per-request basis intead of relying on
state stored in GrDawnBuffer. The existing `fBusyStagingBuffers` has
been replaced by a single reference counted `GrDawnAsyncWait` object.
* A synchronous/blocking map function has been provided to satisfy the
`GrGpuBuffer::onMap` contract. This method is not used in the existing
staging buffer use cases in practice but it solves part of problem #2
above.
* GrDawnGpu::onReadPixels now uses a GrDawnBuffer's blocking map
functionality using the public GrGpuBuffer API. This has the same
behavior as the existing blocking map that created and mapped a
wgpu::Buffer directly.
* The invariants around GrDawnBuffer lifetime and CPU mapping are
documented in class level comments.
Bug: skia:12512
Change-Id: I8bb92137fbd60c31066e4071bd696018b3563bb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533758
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
Move header to src/text/gpu.
Bug: skia:13118
Change-Id: Ib830643db7ee86262a695edbe6d91a05c3817fcd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535965
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This reverts commit 038818ba8e.
Reason for revert: breaking g3 roll, need to update public bzl file I think
Original change's description:
> Delete HW tessellation shaders for curve/wedge tessellation
>
> GrPathTessellationShader_MiddleOut.cpp is just moved into
> GrPathTessellationShader.cpp, and a few factories are cleaned up since
> we don't have to differentiate between middle-out or hardware.
>
> Bug: skia:13263
> Change-Id: I420faa614a89ef1a2c0f1075d1f8a067d15e9a81
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534200
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13263
Change-Id: I42367a21c2bf1a4283e5d9b8d0e00961f9dea2e7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/536039
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Add a Mac Mini to test using GrSlug drawing instead of using
GrTextBlob for drawing.
Change-Id: I28ee402b7f82ae235518ee585d5803857490f8e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535964
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Herb Derby <herb@google.com>
GrPathTessellationShader_MiddleOut.cpp is just moved into
GrPathTessellationShader.cpp, and a few factories are cleaned up since
we don't have to differentiate between middle-out or hardware.
Bug: skia:13263
Change-Id: I420faa614a89ef1a2c0f1075d1f8a067d15e9a81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534200
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
In particular fixes issue on GLs that don't support non-clamp modes with
npot textures.
Bug: skia:13036
Change-Id: I196a6d726ac82cf9f6bb36b90a9b05f3a67837de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535957
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
G3 prefers license() first.
This was done mechanically with a big find/replace
Change-Id: I8c33c7bc10a6bec42e966cad81c259954e841811
Bug: skia:13211
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535898
Reviewed-by: Ben Wagner <bungeman@google.com>
D3D: the filter mode was being enabled but the max was always 1.
Dawn: Everything was plumbed but caps wasn't enabled.
Bug: skia:13036
Change-Id: Ib432bb8bc4fa28eddd827dd8337d2592617a6f70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535413
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Rolled emsdk to the latest version to get the updated WebGPU wasm
bindings to fix deprecated WebGPU API usage in the ganesh Dawn backend.
The latest WebGPU headers also define the WGPU_WHOLE_MAP_SIZE constant
which is necessary to land a workaround for skia:13266.
* Roll emsdk to 3.1.9
* Fix Dawn backend to use the updated WebGPU API
* Fix -Wunused-but-set-variable warnings
Bug: skia:13220, skia:13266
Change-Id: I57ad39657c3013f384620302ab12a71ffc426c12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534945
Commit-Queue: Arman Uguray <armansito@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Added a radial gradient and a RuntimeEffect to the WebGPU demo.
Both of these exercise shader creation and staging buffer allocation.
Also refactored the C++ code to reuse a GrDirectContext which highly
improves the per-frame performance when using runtime effects. However
this unfortunately triggers skbug.com/13266 so a work-around has been
provided in which the context can conditionally get re-created every
frame, as before.
Bug: skia:12512
Change-Id: Ic3e71679bf449bd8557577f74001f18e300e952a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534756
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
* Made several changes to the Bazel rules to work around an issue with
the Closure compiler and Asyncify and a WASM code-size issue on debug
builds.
* The native draw code now invokes Skia using the Dawn backend. The
example uses `SkSurface::flushAndSubmit` and Emscripten's Asyncify
feature to synchronize animation frames with the underlying WebGPU
command queue completion.
* Cosmetic changes to the HTML with CSS and an animation loop that
alternates the canvas color between cyan and magenta every second.
Bug: skia:12512
Change-Id: I9888bbec89c2fb01676898ffe4a7071d8690611e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530856
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
Also exclude some additional test cases based on data collected
from Skia's infrastructure for known problematic GPU test cases.
Bug: b/230879386
Bug: b/227806494
Change-Id: Id0bf73828fa04b3139f1e9cb94511db9d62d8d86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535578
Auto-Submit: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
This is a reland of commit e6f23f98de
Original change's description:
> Reland "Add anisotropic option to SkSamplingOptions."
>
> This is a reland of commit 9be2d572d4
>
> Original change's description:
> > Add anisotropic option to SkSamplingOptions.
> >
> > Implement on GPU.
> >
> > Bug: skia:13036
> > Change-Id: I35d760596c4f8faaec27fccf284b70802fcf3f9b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524757
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
>
> Bug: skia:13036
> Change-Id: I3e411aae389dc880ce32bba78852705059fb88b0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535197
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:13036
Change-Id: Icb2513cea6c4ec4cec934f78c66071081c232960
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535437
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Ran the following commands:
find -name "BUILD.bazel" -exec sed -i -e '1iload("//bazel:macros.bzl", "cc_library", "exports_files_legacy")\nexports_files_legacy()' {} +
buildifier --lint=fix --mode=fix -r .
This had the effect of making sure we can export all of our
files in G3 (until we no longer have legacy targets) and
making all of our cc_libraries shim-able.
bazel/macros.bzl has the human-contributed changes, the rest
were mechanical.
Change-Id: I8e24e30e74b038cfd072cdbe4078bfd1d213dd46
Bug: skia:13211
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535359
Reviewed-by: Ben Wagner <bungeman@google.com>
Accidentally left out of a7c2d73.
Change-Id: I237f8734758def36badd33f63ff32859d4ae670e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535440
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: James Godfrey-Kittle <jamesgk@google.com>
This node was only used to detect recursion while inlining. We no longer
need to do this, because we disallow recursion in all programs.
The removal of one IRNode per inlined function actually allows for
slightly more aggressive inlining, since we restrict inlining based on
IRNode consumption. This allows the "ExponentialGrowth" tests to inline
a bit more deeply than before.
Change-Id: I894dbb1ca3096bb785b67facb01cc9c630f694c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534780
Reviewed-by: Arman Uguray <armansito@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
The `wgpu::Device::Tick()` function is not available when the Dawn
backend is compiled using emsdk to target WebAssembly. As an
alternative, this CL introduces code that takes advantage of
emscripten's Asyncify feature to yield execution to the browser's event
loop and allowing it to execute async tasks from blocking Skia code.
* Introduced the GrDawnAsyncWait class which abstracts over Asyncify vs
wgpu::Device::Tick depending on the platform and implements common
busy-wait boilerplate.
* Refactored the fence management in GrDawnGpu to make use of
GrDawnAsyncWait. The GPUQueue.onSubmittedWorkDone is now handled by a
callback on GrDawnGpu instead of per-fence callbacks since the latter
cannot easily prevent a use-after-free if a fence is destroyed before
the callback runs.
Bug: skia:12512
Change-Id: I255e92ec87c799dc7a50bd034a815c0aaca0ef5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530736
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
Change-Id: I23b8c5a37a7ccaddccc042f8a4f70a2e29a41211
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535399
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This warning is about pre-C99 where declarations had to preceed
statements.
Change-Id: Ie029ebc0d2857d2d73c1395b8046e733765d8b17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535439
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Unsurprisingly, this makes more of the GMs and SKPs look correct.
It isn't added exactly as we would like going forward though. I
believe we would prefer something that munges the matrix and then
calls a child.
Bug: skia:12701
Change-Id: Ib50246a8d575a8a2489afdb7e5f6032a22637bd2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535116
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Change-Id: I9a5f3bc84cca209f914c7e40a5fbdc72f1460f47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535403
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:12701
Change-Id: Ia51c9086c20d28af2fea254658730d9bd4179605
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535396
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is a reland of commit 9be2d572d4
Original change's description:
> Add anisotropic option to SkSamplingOptions.
>
> Implement on GPU.
>
> Bug: skia:13036
> Change-Id: I35d760596c4f8faaec27fccf284b70802fcf3f9b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524757
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13036
Change-Id: I3e411aae389dc880ce32bba78852705059fb88b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535197
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>