Commit Graph

144 Commits

Author SHA1 Message Date
Greg Daniel
d50ccf2d53 Remove SK_USE_LEGACY_VK_ALLOCATOR_USAGE_NAMES code.
Bug: skia:11207
Change-Id: I7e6f7bc93bac6d36c61c2e6500a2c5e0f7556bcb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369477
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-02-17 20:30:48 +00:00
Greg Daniel
84b0233bb3 Rename vulkan memory allocator buffer usage enum values to be more specific.
These renames need to be staged so we can update chrome which has their
own implementation of GrVkMemoryAllocator.

Bug: skia:11207
Change-Id: Ic68927217fe0314cdba1b1aa7ffd80261cb5e646
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368856
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-02-10 23:03:44 +00:00
Greg Daniel
1089c0c59c Make sure we are using cached cpu memory for vulkan readback buffers.
Bug: b/175913056 skia:11207
Change-Id: I7fff0e164844850a957ae9374bed13584fd18ae1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357337
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-01-22 23:13:32 +00:00
Brian Salomon
57fd923c20 Add sample count to GrVkImageInfo.
Pre-req for allowing rendering to an externally created MSSA VkImage.


Bug: skia:9832

Cq-Include-Trybots: luci.skia.skia.primary:Test-Debian10-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All-Vulkan,Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Release-All-Vulkan,Test-Win10-Clang-ShuttleA-GPU-RadeonHD7770-x86_64-Release-All-Vulkan,Test-Android-Clang-GalaxyS9-GPU-MaliG72-arm64-Release-All-Android_Vulkan,Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Release-All-Android_Vulkan,Test-Android-Clang-GalaxyS20-GPU-MaliG77-arm64-Release-All-Android_Vulkan,Test-Android-Clang-Pixel4XL-GPU-Adreno640-arm64-Release-All-Android_Vulkan,Test-Android-Clang-P30-GPU-MaliG76-arm64-Release-All-Android_Vulkan
Change-Id: Ibf41944c6946dda7e27bdcd509ecd04976fc9ade
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320262
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-29 18:36:58 +00:00
Greg Daniel
7b62dcae5a Add image usage flags to GrVkImageInfo
Bug: skia:9898
Change-Id: I46a66d4415af0bb013201ce756e8dbceb9e234cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311437
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-08-21 16:34:20 +00:00
Greg Daniel
6a4e145832 Make some public vulkan structs use default initialization.
We will still need to go through clients to remove uses of the main ctors
so that it can be deleted.

Change-Id: I7bdfa00ac56b2404cc7b2f183104ee97b4da1de7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311452
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-08-21 14:33:20 +00:00
Leon Scroggins III
4f4be9bd4b GrVkTypes: Change externalFormat to be uint64_t
This matches the Vulkan type. This also fixes a warning when comparing
to another uint64_t.

Update GrVkSamplerYcbcrConversion::Key to match as well.

Change-Id: I6fc5d9456ee466dc3d98240acf935139a7808a02
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309325
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-08-11 20:33:18 +00:00
John Stiles
955adbe02c Replace various one-liner sorting functor adapters with lambdas.
These tiny adapter classes aren't needed, since all of our clients have
support for lambdas.

Change-Id: Ibf22b1fd0adb3707db570432c50720df9c9329e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302581
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-07-14 17:45:26 +00:00
Greg Daniel
d79197dfb1 Add api to GrVkMemoryAllocator to return VkResult from allocate calls.
Change-Id: I344e5d70126cce210bb9fe442ae040d13ab74c2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298218
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Peng Huang <penghuang@google.com>
2020-06-23 15:27:53 +00:00
Greg Daniel
aa9d99ff6b Add support for vk image sharing mode and handle queues xfers correctly.
Change-Id: I9dbe6020d67cc452c9cbbdeace68f1d01275b419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293559
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-06-02 15:58:28 +00:00
Mike Klein
89c909efee Wsign-conversion for public headers
This is an Android request for our public headers,
much like warning about unused parameters.  See bug.

In general I've made two kinds of source changes:

   1) more commonly, explicitly cast to the type which
      is being implicitly cast to at head;

   2) less commonly, flip signedness of a value we're
      storing to match how it's used more smoothly.

Much of this is self inflicted inconsistent use of size_t, unsigned,
int, int32_t, uint32_t, etc.  SkTArray is particularly tricky because
of its std::vector half-compatibility.  E.g. resize() takes size_t,
but operator[] takes int.    ¯\_(ツ)_/¯

Bug: skia:9847
Change-Id: I64626a529e1662b3d3020bc03d477fc641eda544
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293436
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-06-02 12:34:54 +00:00
Greg Daniel
6c6caf420a Add GrBackendMutableState object to handle shared texture state.
This is will be the main struct used to synchronize changes of certain
texture/image between clients and Skia. With this change we
implement support for the Vulkan shared state as POC.

Bug: skia:10254
Change-Id: I10543357635c347838b193874e4da4496a0dcf06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292311
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-29 16:53:08 +00:00
Jim Van Verth
6ec5688413 Rename GrD3DTextureInfo to GrD3DTextureResourceInfo.
Also renames GrD3DSurfaceResource to GrD3DTextureResource. This makes
things consistent with our naming convention in Vulkan, and with the
terminology used in Direct3D.

Bug: skia:9935
Change-Id: I6e6d2066ac70eb8a0d63c1b5731f31851a3017d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279338
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-03-26 16:26:44 +00:00
Jim Van Verth
05d091935a Flesh out backend textures and rendertargets to support Direct3D.
Add GrD3DTextureInfo and GrD3DBackendSurfaceInfo, and uses those
to initialize GrBackendTexture and GrBackendRendertarget.

Bug: skia:9935
Change-Id: I4571c1b3aa8115250ff748deb8cf4a95f80f1237
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278036
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-03-20 17:12:46 +00:00
Sergey Ulanov
2739fd2f09 Reland: Enable YCbCr sampler support on platforms other than Android
Previously YCbCr Vulkan samplers were supported only on Android for
external images, while Vulkan requires YCbCr sampler for I420 YUV image
formats such as VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
This CL:
 - Adds VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
   VK_FORMAT_G8_B8R8_2PLANE_420_UNORM as supported Vulkan formats
 - Updates GrVkYcbcrConversionInfo to add fFormat field and allow
   fExternalFormat=0.
 - Removes assertions format=VK_FORMAT_UNDEFINED for all images that
   have ycbcr info.

Bug: chromium:981022
Change-Id: Id4d81b20d9fda4d9ad0831f77e6025eed3db2bfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233776
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
2019-08-12 14:21:01 +00:00
Greg Daniel
9fc5e8da98 Revert "Enable YCbCr sampler support on platforms other than Android"
This reverts commit cc4573dfed.

Reason for revert: Seems to be crashing in Win Intel vulkan bots

Original change's description:
> Enable YCbCr sampler support on platforms other than Android
> 
> Previously YCbCr Vulkan samplers were supported only on Android for
> external images, while Vulkan requires YCbCr sampler for I420 YUV image
> formats such as VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
> VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
> This CL:
>  - Adds VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
>    VK_FORMAT_G8_B8R8_2PLANE_420_UNORM as supported Vulkan formats
>  - Updates GrVkYcbcrConversionInfo to add fFormat field and allow
>    fExternalFormat=0.
>  - Removes assertions format=VK_FORMAT_UNDEFINED for all images that
>    have ycbcr info.
> 
> Bug: chromium:981022
> Change-Id: I3989f72e918a257a081b81ae20429a6771229ad6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230918
> Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,sergeyu@chromium.org

Change-Id: Ia9c229fbec4cd397fb04304753fa49f34336ed3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:981022
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233563
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-09 19:09:05 +00:00
Sergey Ulanov
cc4573dfed Enable YCbCr sampler support on platforms other than Android
Previously YCbCr Vulkan samplers were supported only on Android for
external images, while Vulkan requires YCbCr sampler for I420 YUV image
formats such as VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
This CL:
 - Adds VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
   VK_FORMAT_G8_B8R8_2PLANE_420_UNORM as supported Vulkan formats
 - Updates GrVkYcbcrConversionInfo to add fFormat field and allow
   fExternalFormat=0.
 - Removes assertions format=VK_FORMAT_UNDEFINED for all images that
   have ycbcr info.

Bug: chromium:981022
Change-Id: I3989f72e918a257a081b81ae20429a6771229ad6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230918
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-08-09 18:01:13 +00:00
Brian Salomon
247ac39ccc Remove old constructor for GrVkImageInfo.
TBR: egdaniel@google.com

Change-Id: I09e5ff84c81617c23235b39edbbe47b5eabfd3a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229616
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-25 23:58:43 +00:00
Brian Salomon
e78454e802 Add temporary constructor to GrVkImageInfo to allow Chrome to compile.
TBR: egdaniel@google.com


Change-Id: Iae8e41ac1f6ba1c77846284f5649592250c206ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228559
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-19 14:10:11 +00:00
Brian Salomon
4456a0d35c Store protectedness on GrVkImageInfo.
Changes the GrBackendSurface to not take it separately.

Change-Id: I5eb9684da1532907e7833e9d7835a74d1e71f5ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228396
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-18 20:03:08 +00:00
Emircan Uysaler
23ca4e7dc5 Enable creating protected vulkan backend
This CL allows user to indicate that they have a protected content in
GrVkBackendContext creation which results in protected CommandPool and Queue
usage.

Bug: skia:9016
Change-Id: I6a478d688b6988c2c5e5e98f18f58fb21f9d26ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210067
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Emircan Uysaler <emircan@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-24 16:04:00 +00:00
Greg Daniel
4d74f605d7 Make feature structs on GrVkBackendContext const.
Change-Id: I6655c2458a4a9b007cb3d5e100f5368697a0f6bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218547
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-05 15:56:00 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Stan Iliev
cb58060404 Pass render target VkImage in GrVkDrawableInfo
Test: Ran CTS
Bug: b/115613038
Change-Id: I9493de41e0bfaa53436676c8eed2a4f178b6e51e
Reviewed-on: https://skia-review.googlesource.com/c/186400
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-02-26 17:07:30 +00:00
Nico Weber
ed632b14ad Remove another semicolon.
Bug: chromium:926235
Change-Id: Id0ead383e1bc11b9baeae61fa5fe94ad75d4e856
Reviewed-on: https://skia-review.googlesource.com/c/193691
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Nico Weber <thakis@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-21 15:19:11 +00:00
Greg Daniel
41f0e28fd5 Add MaxAPIVersion to GrVkBackendContext.
This moves us to the correct way of handling the correct version of
Vulkan that the client wants us to use.

Bug: skia:
Change-Id: I6c7962b5d2d48ae142c6a701c30f5af3801ac99b
Reviewed-on: https://skia-review.googlesource.com/c/187382
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-01-28 19:01:46 +00:00
Greg Daniel
bc84adceaa Move GrVkSecondaryCBDrawContext header into src to hide it.
We want to hide this API from general public use. Chromium can dig into
skia to include it as it does with other Skia API's that are in src

Bug: skia:
Change-Id: I00dc36d181237ea0785eefb31ad6c2d4e50e3c68
Reviewed-on: https://skia-review.googlesource.com/c/180648
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-01-02 22:58:58 +00:00
Greg Daniel
b46add81de Add initial support for creating a vulkan secondary command buffer drawing context.
This sets up the context and adds support for creating RTContexts, RTProxies, RTs,
and GrVkRenderPass's that wrap the external secondary command buffer.

Bug: skia:
Change-Id: I80ebbb690a5fe464f775c5fcad651dfe2a150418
Reviewed-on: https://skia-review.googlesource.com/c/178926
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-02 20:39:23 +00:00
Greg Daniel
487132b828 Don't include system vulkan header when building skia files.
With this change clients will still have to have vulkan/vulkan_core.h
on their include path when compiling files that include Skia. However,
it will not be required when compiling Skia files.

Bug: skia:
Change-Id: I1cd75f4f18d3097c8a1606c3e8a51a371b01b565
Reviewed-on: https://skia-review.googlesource.com/c/179560
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-12-27 19:21:00 +00:00
Greg Daniel
54200e4025 Move vulkan headers from third_party to include/third_party.
Bug: skia:
Change-Id: I7174c6da075c0fd3d6238a5556439f42d6b97659
Reviewed-on: https://skia-review.googlesource.com/c/176680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-12 14:16:43 +00:00
Greg Daniel
b353eeb716 Remove duplicate member of GrVkDrawableInfo struct.
Bug: skia:
Change-Id: I81a38f9920f89f4749fc58458b85a29714cec7a9
Reviewed-on: https://skia-review.googlesource.com/c/174584
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-05 18:20:28 +00:00
Greg Daniel
45723ac931 Take into accout the GrBackendFormat when deciding if we can chain textures together.
Bug: skia:
Change-Id: I8c26bed1bb18318f96d248c227e3b33b190d2a05
Reviewed-on: https://skia-review.googlesource.com/c/173320
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-12-03 16:54:40 +00:00
Greg Daniel
7e000220c3 Reland "Add support for Ycbcr Conversion Samplers in vulkan."
This is a reland of 6cd74900da

Original change's description:
> Add support for Ycbcr Conversion Samplers in vulkan.
> 
> The only thing missing from this CL is that we need to bake the
> ycbcr conversion samplers into the VkPipeline when we create it. As that
> is a larger change, that will be broken up into a few follow on CLs.
> 
> Currently this only supports ycbcr conversion samplers when used with
> external textures.
> 
> Bug: skia:
> Change-Id: I23e95b19469093072589ebbbfb7926ab79dcdea9
> Reviewed-on: https://skia-review.googlesource.com/c/164602
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:
Change-Id: I943398077775ef6396fbe5cb9196d23a29128669
Reviewed-on: https://skia-review.googlesource.com/c/173986
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-03 16:16:55 +00:00
Greg Daniel
f4bf973592 Revert "Add support for Ycbcr Conversion Samplers in vulkan."
This reverts commit 6cd74900da.

Reason for revert: breaking win vulkan bots

Original change's description:
> Add support for Ycbcr Conversion Samplers in vulkan.
> 
> The only thing missing from this CL is that we need to bake the
> ycbcr conversion samplers into the VkPipeline when we create it. As that
> is a larger change, that will be broken up into a few follow on CLs.
> 
> Currently this only supports ycbcr conversion samplers when used with
> external textures.
> 
> Bug: skia:
> Change-Id: I23e95b19469093072589ebbbfb7926ab79dcdea9
> Reviewed-on: https://skia-review.googlesource.com/c/164602
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com

Change-Id: Ib56905821cbfd40cf30ec89269b551ce01605a1a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/173982
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-03 14:34:45 +00:00
Greg Daniel
6cd74900da Add support for Ycbcr Conversion Samplers in vulkan.
The only thing missing from this CL is that we need to bake the
ycbcr conversion samplers into the VkPipeline when we create it. As that
is a larger change, that will be broken up into a few follow on CLs.

Currently this only supports ycbcr conversion samplers when used with
external textures.

Bug: skia:
Change-Id: I23e95b19469093072589ebbbfb7926ab79dcdea9
Reviewed-on: https://skia-review.googlesource.com/c/164602
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-03 14:13:42 +00:00
Greg Daniel
54bfb18dad Privately include our version of vulkan header file in all our src files.
This should allow clients to include Skia and their vulkan files in any
order. However, it does require that when clients are building their
files that include skia with vulkan, they must have vulkan/vulkan_core.h
on their include path somewhere.

Bug: skia:
Change-Id: I969db396c92127be7c8df754926d175f38b8aafa
Reviewed-on: https://skia-review.googlesource.com/c/172147
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-11-26 15:15:44 +00:00
Greg Daniel
e5178243d0 Require vulkan 1.1 headers when compiling skia.
Bug: skia:
Change-Id: Ibfda62cbdc3d78fc2a3b08ff07866c1ee501de7a
Reviewed-on: https://skia-review.googlesource.com/c/163223
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-11-12 14:48:47 +00:00
Greg Daniel
9ed1a2cd71 Add ability for an SkDevice to handle the drawing of an SkDrawable.
If supported, an Sk*Device can take charge of handling of an SkDrawable.
The specific use case right now will be to use this to execute Vulkan
specific SkDrawable's that need to know information about our Vulkan state
and objects at the time the SkDrawable is executed. If a device does not
support the SkDrawable we fall back to the cavans version like we did
previously.

BUG=skia:

Change-Id: I821fa600a80ff645412f296be36990ef390ae0a9
Reviewed-on: https://skia-review.googlesource.com/c/7740
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-19 15:21:54 +00:00
Greg Daniel
b4d895606f Reland "Reland "Always include public/include headers for vulkan and just guard src files with SK_VULKAN.""
This reverts commit a55e214bbe.

Reason for revert:google3 should be fixed now

Original change's description:
> Revert "Reland "Always include public/include headers for vulkan and just guard src files with SK_VULKAN.""
> 
> This reverts commit 55aea84baa.
> 
> Reason for revert: Google3 roll failing like
> 
> third_party/skia/HEAD/include/gpu/vk/GrVkDefines.h:15:10: fatal error: '../../../third_party/vulkan/SkiaVulkan.h' file not found
> #include "../../../third_party/vulkan/SkiaVulkan.h"
> 
> 
> Original change's description:
> > Reland "Always include public/include headers for vulkan and just guard src files with SK_VULKAN."
> > 
> > This reverts commit 684b506f35.
> > 
> > Reason for revert: Chrome change has landed to fix broken chrome roll.
> > 
> > Original change's description:
> > > Revert "Always include public/include headers for vulkan and just guard src files with SK_VULKAN."
> > >
> > > This reverts commit 6e2d607334.
> > >
> > > Reason for revert: chrome roll
> > >
> > > Original change's description:
> > > > Always include public/include headers for vulkan and just guard src files with SK_VULKAN.
> > > >
> > > > This should allow a client to build a skia library that doesn't use vulkan but still
> > > > has all the public headers defined so that they don't have to build two versions of
> > > > their code.
> > > >
> > > > Bug: chromium:862144
> > > > Change-Id: I0eecbe0bc48123619f217e2cf318eb9a8c77ccb2
> > > > Reviewed-on: https://skia-review.googlesource.com/158661
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > >
> > > TBR=egdaniel@google.com,bsalomon@google.com,cblume@chromium.org
> > >
> > > Change-Id: I76ae6f435333755fa5d546fc1e5999a324b4fd05
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: chromium:862144
> > > Reviewed-on: https://skia-review.googlesource.com/c/159000
> > > Reviewed-by: Mike Klein <mtklein@google.com>
> > > Commit-Queue: Mike Klein <mtklein@google.com>
> > 
> > TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,cblume@chromium.org
> > 
> > Change-Id: Id019b428f880efbd7ead8dee4178c6190469a290
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:862144
> > Reviewed-on: https://skia-review.googlesource.com/c/159145
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,cblume@chromium.org
> 
> Change-Id: I0e5c72e2d79dac28021b02168a9e11ac08db765c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:862144
> Reviewed-on: https://skia-review.googlesource.com/c/159155
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,cblume@chromium.org

Change-Id: I58f7f8ca5281cd5fe0c145c01e9b9465c9b9ec31
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:862144
Reviewed-on: https://skia-review.googlesource.com/159260
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-10-03 18:44:59 +00:00
Mike Klein
a55e214bbe Revert "Reland "Always include public/include headers for vulkan and just guard src files with SK_VULKAN.""
This reverts commit 55aea84baa.

Reason for revert: Google3 roll failing like

third_party/skia/HEAD/include/gpu/vk/GrVkDefines.h:15:10: fatal error: '../../../third_party/vulkan/SkiaVulkan.h' file not found
#include "../../../third_party/vulkan/SkiaVulkan.h"


Original change's description:
> Reland "Always include public/include headers for vulkan and just guard src files with SK_VULKAN."
> 
> This reverts commit 684b506f35.
> 
> Reason for revert: Chrome change has landed to fix broken chrome roll.
> 
> Original change's description:
> > Revert "Always include public/include headers for vulkan and just guard src files with SK_VULKAN."
> >
> > This reverts commit 6e2d607334.
> >
> > Reason for revert: chrome roll
> >
> > Original change's description:
> > > Always include public/include headers for vulkan and just guard src files with SK_VULKAN.
> > >
> > > This should allow a client to build a skia library that doesn't use vulkan but still
> > > has all the public headers defined so that they don't have to build two versions of
> > > their code.
> > >
> > > Bug: chromium:862144
> > > Change-Id: I0eecbe0bc48123619f217e2cf318eb9a8c77ccb2
> > > Reviewed-on: https://skia-review.googlesource.com/158661
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com,cblume@chromium.org
> >
> > Change-Id: I76ae6f435333755fa5d546fc1e5999a324b4fd05
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:862144
> > Reviewed-on: https://skia-review.googlesource.com/c/159000
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Commit-Queue: Mike Klein <mtklein@google.com>
> 
> TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,cblume@chromium.org
> 
> Change-Id: Id019b428f880efbd7ead8dee4178c6190469a290
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:862144
> Reviewed-on: https://skia-review.googlesource.com/c/159145
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,cblume@chromium.org

Change-Id: I0e5c72e2d79dac28021b02168a9e11ac08db765c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:862144
Reviewed-on: https://skia-review.googlesource.com/c/159155
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-03 16:34:23 +00:00
Greg Daniel
55aea84baa Reland "Always include public/include headers for vulkan and just guard src files with SK_VULKAN."
This reverts commit 684b506f35.

Reason for revert: Chrome change has landed to fix broken chrome roll.

Original change's description:
> Revert "Always include public/include headers for vulkan and just guard src files with SK_VULKAN."
>
> This reverts commit 6e2d607334.
>
> Reason for revert: chrome roll
>
> Original change's description:
> > Always include public/include headers for vulkan and just guard src files with SK_VULKAN.
> >
> > This should allow a client to build a skia library that doesn't use vulkan but still
> > has all the public headers defined so that they don't have to build two versions of
> > their code.
> >
> > Bug: chromium:862144
> > Change-Id: I0eecbe0bc48123619f217e2cf318eb9a8c77ccb2
> > Reviewed-on: https://skia-review.googlesource.com/158661
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,cblume@chromium.org
>
> Change-Id: I76ae6f435333755fa5d546fc1e5999a324b4fd05
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:862144
> Reviewed-on: https://skia-review.googlesource.com/c/159000
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,cblume@chromium.org

Change-Id: Id019b428f880efbd7ead8dee4178c6190469a290
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:862144
Reviewed-on: https://skia-review.googlesource.com/c/159145
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-10-03 13:30:30 +00:00
Mike Klein
684b506f35 Revert "Always include public/include headers for vulkan and just guard src files with SK_VULKAN."
This reverts commit 6e2d607334.

Reason for revert: chrome roll

Original change's description:
> Always include public/include headers for vulkan and just guard src files with SK_VULKAN.
> 
> This should allow a client to build a skia library that doesn't use vulkan but still
> has all the public headers defined so that they don't have to build two versions of
> their code.
> 
> Bug: chromium:862144
> Change-Id: I0eecbe0bc48123619f217e2cf318eb9a8c77ccb2
> Reviewed-on: https://skia-review.googlesource.com/158661
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,cblume@chromium.org

Change-Id: I76ae6f435333755fa5d546fc1e5999a324b4fd05
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:862144
Reviewed-on: https://skia-review.googlesource.com/c/159000
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-02 18:05:54 +00:00
Greg Daniel
6e2d607334 Always include public/include headers for vulkan and just guard src files with SK_VULKAN.
This should allow a client to build a skia library that doesn't use vulkan but still
has all the public headers defined so that they don't have to build two versions of
their code.

Bug: chromium:862144
Change-Id: I0eecbe0bc48123619f217e2cf318eb9a8c77ccb2
Reviewed-on: https://skia-review.googlesource.com/158661
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-10-02 17:41:53 +00:00
Greg Daniel
ecddbc0126 Add support for switching family queues in vulkan.
Bug: skia:
Change-Id: Ie4f620a96d1a6f7662819590d97073a694159f96
Reviewed-on: https://skia-review.googlesource.com/150483
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-08-31 13:25:22 +00:00
Greg Daniel
a0651acaf2 Update vulkan features (again) to support extension features.
We need to handle all the possible ways a client is allowed to initialize
features on Vulkan.

Bug: skia:
Change-Id: I98b1dee2efa2c22c26ce093c590c7ccd0b626969
Reviewed-on: https://skia-review.googlesource.com/145530
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-08 13:48:38 +00:00
Greg Daniel
c0b03d8dfc Start adding support for some base extensions which others build on.
Many of the other extensions in Vulkan rely on these some just want to
get these landed so we can start building on top of them.

Bug: skia:
Change-Id: Icef82c169cd50ff51b97fe065923531ef2940319
Reviewed-on: https://skia-review.googlesource.com/145362
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-08-06 14:26:15 +00:00
Greg Daniel
92aef4b125 Support using vulkan 1.1.
Bug: skia:
Change-Id: Ic1fc109557f64c748c9ba5427b400795dbde7250
Reviewed-on: https://skia-review.googlesource.com/137882
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-08-02 18:37:02 +00:00
Greg Daniel
3644360c8d Have GrVkBackendContext take a VkPhysicalDeviceFeatures struct.
Bug: skia:
Change-Id: Ic7992c89c06789ee631c9f5b4f047c6486e792a5
Reviewed-on: https://skia-review.googlesource.com/137390
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-02 17:24:48 +00:00
Greg Daniel
a31f4e51d5 Make sure we check the version number of Vulkan Extensions.
Bug: skia:
Change-Id: Iff02911491cc61e39f94370c644b6666e5f9118f
Reviewed-on: https://skia-review.googlesource.com/137881
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-02 14:57:45 +00:00
Greg Daniel
98bffae9c1 Reland "Reland "Let client pass in full extension to GrVkBackendContext.""
This reverts commit dc13c21b1e.

Reason for revert: fuchsia should be fixed

Original change's description:
> Revert "Reland "Let client pass in full extension to GrVkBackendContext.""
> 
> This reverts commit a782dcb3c4.
> 
> Reason for revert: fuchsia changes reverted
> 
> Original change's description:
> > Reland "Let client pass in full extension to GrVkBackendContext."
> > 
> > This reverts commit cb92b26e5c.
> > 
> > Reason for revert: <INSERT REASONING HERE>
> > 
> > Original change's description:
> > > Revert "Let client pass in full extension to GrVkBackendContext."
> > > 
> > > This reverts commit 45c9dab4c3.
> > > 
> > > Reason for revert: fucshia uses GrVkBackendContext. Need to revert earlier changes
> > > 
> > > Original change's description:
> > > > Let client pass in full extension to GrVkBackendContext.
> > > > 
> > > > Bug: skia:
> > > > Change-Id: I772ab4ccbca0f4f7e7d429d6c421b07d97f0606f
> > > > Reviewed-on: https://skia-review.googlesource.com/131880
> > > > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > 
> > > TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com
> > > 
> > > Change-Id: I1a765ff406c83cb234c3614b804fbed677d5a382
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:
> > > Reviewed-on: https://skia-review.googlesource.com/137901
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > 
> > TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com
> > 
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> > 
> > Bug: skia:
> > Change-Id: I0af797c51dde705473e9afaccb1d4b4423e8c41e
> > Reviewed-on: https://skia-review.googlesource.com/138302
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com
> 
> Change-Id: Idf760d5ac6b82df33a4408079a0223be833058ad
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/138420
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: Ied1323b7197b600e895d85ac7e85d6f65985dabc
Reviewed-on: https://skia-review.googlesource.com/139002
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-08-01 19:40:45 +00:00