This also adds a base class BufferWriter which Vertex, Index, and
Uniform Writers inherit from
Bug: skia:12466
Change-Id: Icbac1210fbbd07321f9d88728ddde1e761fe4bb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463496
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
The original values assumed that `half` types would be sized the same as
a `float`. This is still the case (as skia:12339 is not yet fully
implemented) but this CL now contains the expected half values as well.
Change-Id: I94ff73446d29318f127600fb681c222a759936cc
Bug: skia:12339
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463736
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
inherit_if_needed(currentNode->fX , attrs->fX) |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: cast one or both operands to int to silence this warning
Change-Id: I6d59a5c33826af29560c0e30ddf9f4e16581882c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463896
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
- Drop the following dimensions:
reserved_for_xcode_version:*
gpu:none
- Loosen the cpu dimension.
- Restrict to cores:12 to avoid using the VMs.
The failing iPhone6 bots are failing on the main waterfall today
so they are WAI.
See also: https://bugs.chromium.org/p/chromium/issues/detail?id=1257420
Change-Id: I9f0eef7c6904e652a011937ab99c465e9d483172
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463141
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
This makes use of Bazel's pre-defined platforms
https://github.com/bazelbuild/platforms
and some of our own defined values (see
//bazel/common_config_settings/BUILD.bazel) to customize
the build rules.
I verified this by building bazel_test locally for
linux x64 as well as using the third_party deps for
a WASM build (using build files not seen in this CL).
Suggested Review Order:
- https://docs.bazel.build/versions/main/platforms.html if not
already familiar with Bazel Platforms
- third_party/BUILD.bazel to see that 1) all globs have
been removed and 2) select() targets various
platform constants or groups of constants to control
sources, headers, and local_defines.
- common_config_settings/ to see the groups of constraints
created, as well as new constraint_settings defined
(skdebug_impl)
- supported_combinations/ to see how we can define supported
sets of the constraint values (aka Bazel platforms).
I imagine expanding this more, so we might have platforms
named "linux_x64_emptyfontmgr_vulkan" or such.
- //BUILD.bazel and bazel_test.cpp to see use of SkDebugf.
- Everything else.
Change-Id: I49e4abdbcf7b76f0674efdbb1f53dc8823d110ee
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463517
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
On linux we need to support drm format modifiers on vulkan images. When
we have a modifier it can restrict the allowed usages/features of the
VkImage.
The current use case we have for images coming into skia that have
these modifiers are from video decoders. All these images are only used
as sampled images in draws and they have no filtering applied.
Therefore, for now, instead of tracking all format and modifier pairs
to know what is supported, we internally set these images to be external
which already restricts their use to basic in shader sampling.
Additionally in chrome, all these images are coming in ycbcr conversions
already which we treat as external.
Bug: skia:12336
Change-Id: I59a564f937f49a6d906efe954b24cebe5c7470ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441298
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: I1e7812e3600cacc8fe678e924d48c27fb8b88138
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463716
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Ideally we could move fPtr on VertexWriter to be private to force all
users of VertexWriter to go through the write functions. This CL at
least removes all users that were using fPtr for validity checking of
the VertexWriter.
I also move fPtr to private and added a temporary public getter. This
will allow us to make a base Writer class where fPtr is private and
we'll only expose the getter on the VertexWriter.
Change-Id: Ib389778d0f530fb31cef85460f00bd9f687c5219
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463456
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Gerrit didn't do so well on this CL. What's changed in the UniformManager is:
a lot of unused stuff was pared out of the UniformDataManager
the Write methods now return the number of bytes written in the call (incl. padding)
all the "#ifdef SK_DEBUG" stuff is new to validate against the prior way of writing uniforms
Bug: skia:12466
Change-Id: I172a74273c774257f751750aef37f4bd4c4e7e7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463458
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Byte types were removed from SkSL in http://review.skia.org/404219.
Change-Id: Iec726de0be2ce371a20e21638638a495fae282a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463498
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>
Bug: skia:12466
Change-Id: Ie4c1973427e96d84b77f28edb5a4d6f1d53ef8aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463316
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
These are not very interesting right now, because the in and out types
boil down to the same thing (int/int, float/float). When half-
precision types are enabled, these helpers will be more useful. They
will return an array which casts each element from int-to-short or
float-to-half (or vice versa).
Change-Id: Ida716ddd27d370ba33fd23f17a1b07fa5a201e40
Bug: skia:12339
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463337
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12466
Change-Id: Ic312ce41b5eb0ae0c20e6b76032b984d9a406d89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462884
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: I734c3a9595948dfb74f8ec72684183fe743bfefb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462883
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Keep RenderPass-related routines together
* Rename setRenderPipeline to bindRenderPipeline
* Pass resources as const& to platform-specific routines, to avoid
copies.
Bug: skia:12466
Change-Id: I4c3ea006263ace4a050b6c86f70163f5fd5e254a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463336
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
The inverse, outerProduct and matrixCompMult polyfill functions in Metal
were written assuming that all float matrices would use the `float`
type. They now use a template so that `half` matrices will work too.
Change-Id: I7696c8ad1e4aaffbd71c56b9245485e74cd96c5a
Bug: skia:12339
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463338
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
With this you should be able to set skia_enable_gpu=false in your gn
args and still be able to compile and run graphite.
Bug: skia:12466
Change-Id: Ibffc8774a8c46afad3f717dabc54fa831338a807
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463317
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I8a31cd8480199a941dfc1d9d1092f8a1dafdb0da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462882
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I794de6af814ab1b3e9517e139582e06382ecf957
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462881
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I273fbb51730d85cda6921747e72ace2b9d7601e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462880
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:12466
Change-Id: If90c17634de9caa2ac3a928187226339523d53eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462879
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: Ifd70300896504f8567e6395c3d3683f0d37c905b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463056
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Using a switch is overkill now that Types are implemented in subclasses.
Change-Id: If7874dfa9a5b02f168ac7c6c3f69a2bd6f9c2a80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463156
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>
This class can now be shared with Graphite.
Bug: skia:12524
Change-Id: I7841410b3e8e111a12298efe0a1898a33295873a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462556
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This reverts commit 9dd63710f1.
Reason for revert: The actual issue was related to cached shaders recorded on a different device. No evidence of actual driver bug.
Original change's description:
> Disable GL_NV_shader_noperspective_interpolation on PowerVR
>
> There's probably a more specific check we could use, but we're seeing
> shaders fail to compile when enabling this extension on some MediaTek
> devices.
>
> Bug: b/177473804
> Change-Id: Ic91f60c6935386f44d9386c362e9f778c28a4099
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460576
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
Bug: b/177473804
Change-Id: Iea36dd74a2a530f8347517bee76d83ceacc262a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463057
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Also adds test of texture copyback to CommandBufferTest, and
endEncoding() to BlitCommandEncoder.
Bug: skia:12466
Change-Id: I57e4646aacc1d950cc16b70d7feeced1a04e6867
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462078
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This code originally contained 16 extremely similar versions of the same
logic. (set1i, 1iv, 1f, 1fv, 2i, 2iv...)
Now the core logic has been boiled down to two (set, setv) templated
helper functions, one for array and one for non-array uniforms. Template
arguments fill in the minor variations between each type.
Structuring the logic in this way makes it easier to perform sweeping
changes as needed, and guarantees that the setters all work the same.
Change-Id: Iaa74d25c612b12ab26d7f32879c174bca6c850c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462099
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This allows GrQuad to be written as a quad without the header needing
knowledge of it.
Bug: skia:12524
Change-Id: I22f67021877de426f710981d4fa2bd48c88a4d52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462319
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>