aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkBuffer.cpp
Commit message (Collapse)AuthorAge
* Reland "Use GrVkMemoryAllocator for vulkan memory allocations in ganesh."Gravatar Greg Daniel2018-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of 331c266ed716526478a10885aff66181cec64486 Original change's description: > Use GrVkMemoryAllocator for vulkan memory allocations in ganesh. > > Besides using the new allocator, the big logical change is that map > and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc > instead of a specific offset and size as they did before. As a > consequence of this, we move the handling of non-coherent alignment > for flush/invalidate calls to GrVkMemory instead of the callers. > > Bug: skia: > Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be > Reviewed-on: https://skia-review.googlesource.com/130021 > Commit-Queue: Greg Daniel <egdaniel@google.com> > Reviewed-by: Jim Van Verth <jvanverth@google.com> Bug: skia: Change-Id: Ia9a4192d344449fb444d2adaa1d62ff1ede4b21d Reviewed-on: https://skia-review.googlesource.com/131083 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Use GrVkMemoryAllocator for vulkan memory allocations in ganesh."Gravatar Greg Daniel2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 331c266ed716526478a10885aff66181cec64486. Reason for revert: breaking an intel vulkan bot Original change's description: > Use GrVkMemoryAllocator for vulkan memory allocations in ganesh. > > Besides using the new allocator, the big logical change is that map > and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc > instead of a specific offset and size as they did before. As a > consequence of this, we move the handling of non-coherent alignment > for flush/invalidate calls to GrVkMemory instead of the callers. > > Bug: skia: > Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be > Reviewed-on: https://skia-review.googlesource.com/130021 > Commit-Queue: Greg Daniel <egdaniel@google.com> > Reviewed-by: Jim Van Verth <jvanverth@google.com> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com Change-Id: I5237c00625dc95d3d9b36c1e5591762988d85562 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/131081 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Use GrVkMemoryAllocator for vulkan memory allocations in ganesh.Gravatar Greg Daniel2018-05-30
| | | | | | | | | | | | | | Besides using the new allocator, the big logical change is that map and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc instead of a specific offset and size as they did before. As a consequence of this, we move the handling of non-coherent alignment for flush/invalidate calls to GrVkMemory instead of the callers. Bug: skia: Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be Reviewed-on: https://skia-review.googlesource.com/130021 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Update Flush and Invalidate Memory calls in vulkan to take offset and sizeGravatar Greg Daniel2018-03-02
| | | | | | | | Bug: skia: Change-Id: I4faf9f431422f27096fce4605be281c28935df08 Reviewed-on: https://skia-review.googlesource.com/111782 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Revert "Fixes to alignment issues with regards to mapped vulkan ↵Gravatar Greg Daniel2018-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memory."" This reverts commit 88fdee9bde97df106a8d81b450982b8296a2bc90. Reason for revert: Pre Fixes landed in other repos Original change's description: > Revert "Fixes to alignment issues with regards to mapped vulkan memory." > > This reverts commit 9fb6cf4c49b0f095e5cc005feb05b5522731421b. > > Reason for revert: breaks fuchsia > > Original change's description: > > Fixes to alignment issues with regards to mapped vulkan memory. > > > > Bug: skia: > > Change-Id: Ida9813fe774580a6d157b8eb8d330488c8e8c4bc > > Reviewed-on: https://skia-review.googlesource.com/109483 > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Reviewed-by: Jim Van Verth <jvanverth@google.com> > > TBR=djsollen@google.com,egdaniel@google.com,jvanverth@google.com > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Bug: skia: > Change-Id: If1223313cab27737ada401d1f3fe4b7ab849d03f > Reviewed-on: https://skia-review.googlesource.com/110040 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> Bug: skia: Change-Id: Ifeebf535c3617674846f7ef25e686ee11ceee65c Reviewed-on: https://skia-review.googlesource.com/110160 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Fixes to alignment issues with regards to mapped vulkan memory."Gravatar Greg Daniel2018-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9fb6cf4c49b0f095e5cc005feb05b5522731421b. Reason for revert: breaks fuchsia Original change's description: > Fixes to alignment issues with regards to mapped vulkan memory. > > Bug: skia: > Change-Id: Ida9813fe774580a6d157b8eb8d330488c8e8c4bc > Reviewed-on: https://skia-review.googlesource.com/109483 > Commit-Queue: Greg Daniel <egdaniel@google.com> > Reviewed-by: Jim Van Verth <jvanverth@google.com> TBR=djsollen@google.com,egdaniel@google.com,jvanverth@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: If1223313cab27737ada401d1f3fe4b7ab849d03f Reviewed-on: https://skia-review.googlesource.com/110040 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Fixes to alignment issues with regards to mapped vulkan memory.Gravatar Greg Daniel2018-02-23
| | | | | | | | Bug: skia: Change-Id: Ida9813fe774580a6d157b8eb8d330488c8e8c4bc Reviewed-on: https://skia-review.googlesource.com/109483 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Fix buffer size assertion in VulkanGravatar Chris Dalton2018-01-11
| | | | | | | | Bug: skia: Change-Id: I2b878ec288b6dac891fc3724678a528d2db08b09 Reviewed-on: https://skia-review.googlesource.com/93362 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Convert NULL and 0 to nullptr.Gravatar Ben Wagner2017-08-28
| | | | | | | | | | | | | | This was created by looking at warnings produced by clang's -Wzero-as-null-pointer-constant. This updates most issues in Skia code. However, there are places where GL and Vulkan want pointer values which are explicitly 0, external headers which use NULL directly, and possibly more uses in un-compiled sources (for other platforms). Change-Id: Id22fbac04d5c53497a53d734f0896b4f06fe8345 Reviewed-on: https://skia-review.googlesource.com/39521 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Add support for vkCmdCopyBufferGravatar Greg Daniel2017-08-25
| | | | | | | | | | | | This is then used when need to update GPU only buffers with data of size greater than 65536. We create a temporary transfer buffer and then copy that buffer into our GPU buffer. Bug: skia: Change-Id: I4bb9cb660f2ac1ccbbd1b508bb4ca6876342136f Reviewed-on: https://skia-review.googlesource.com/38725 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Indicate texel buffer support in VulkanGravatar Chris Dalton2017-07-06
| | | | | | | | | | Also adds support for static texel buffer access patterns. Bug: skia: Change-Id: Iadf1b82adbc5f84960841b7526e16d1aa77de621 Reviewed-on: https://skia-review.googlesource.com/21705 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Revert "Indicate texel buffer support in Vulkan"Gravatar Chris Dalton2017-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2dd222639dba16fab4e81dbf3e7916fc1eb2cd29. Reason for revert: Programs test assertion failures Original change's description: > Indicate texel buffer support in Vulkan > > Bug: skia: > Change-Id: I116dd2b15320e3a61afba82b003b13a14ce6122f > Reviewed-on: https://skia-review.googlesource.com/21402 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Chris Dalton <csmartdalton@google.com> TBR=egdaniel@google.com,csmartdalton@google.com Change-Id: I41ee31624636c497125ff38bcb7ce0382d9f386b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/21582 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Indicate texel buffer support in VulkanGravatar Chris Dalton2017-07-05
| | | | | | | | Bug: skia: Change-Id: I116dd2b15320e3a61afba82b003b13a14ce6122f Reviewed-on: https://skia-review.googlesource.com/21402 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Add GrVkTexelBuffer classGravatar Greg Daniel2017-05-08
| | | | | | | | Bug: skia: Change-Id: I6111902f58df3af92702d974a52d9c7f267634d4 Reviewed-on: https://skia-review.googlesource.com/15628 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Various memory leak fixes in VulkanGravatar Greg Daniel2017-01-09
| | | | | | | | | BUG=skia:6101 Change-Id: Iee798dd2d9dcc4521f643b814e65029b9383cc6f Reviewed-on: https://skia-review.googlesource.com/6696 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Some Vulkan memory fixes and cleanupGravatar jvanverth2016-09-23
| | | | | | | | | | | | | * Switch back to not setting transfer_dst on all buffers * Add some missing unit tests * Add tracking of heap usage for debugging purposes * Fall back to non-device-local memory if device-local allocation fails BUG=skia:5031 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2356343003 Committed: https://skia.googlesource.com/skia/+/c5850e9fdb62cc4ae5ed2b6af51aea92cac07455 Review-Url: https://codereview.chromium.org/2356343003
* Revert of Some Vulkan memory fixes and cleanup (patchset #2 id:20001 of ↵Gravatar jvanverth2016-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2356343003/ ) Reason for revert: fHeapIndex is not used in release, need to hide behind SK_DEBUG. Failing on Perf-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Release-GN_Android_Vulkan. Original issue's description: > Some Vulkan memory fixes and cleanup > > * Switch back to not setting transfer_dst on all buffers > * Add some missing unit tests > * Add tracking of heap usage for debugging purposes > * Fall back to non-device-local memory if device-local allocation fails > > BUG=skia:5031 > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2356343003 > > Committed: https://skia.googlesource.com/skia/+/c5850e9fdb62cc4ae5ed2b6af51aea92cac07455 TBR=egdaniel@google.com,brianosman@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:5031 Review-Url: https://codereview.chromium.org/2358123004
* Some Vulkan memory fixes and cleanupGravatar jvanverth2016-09-22
| | | | | | | | | | | | * Switch back to not setting transfer_dst on all buffers * Add some missing unit tests * Add tracking of heap usage for debugging purposes * Fall back to non-device-local memory if device-local allocation fails BUG=skia:5031 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2356343003 Review-Url: https://codereview.chromium.org/2356343003
* Always use transfer_dst for buffers.Gravatar jvanverth2016-09-21
| | | | | | | | | This will allow Adreno to use non-coherent buffers. BUG=skia:5034 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2361473002 Review-Url: https://codereview.chromium.org/2361473002
* Support use of non-coherent memory allocations in Vulkan.Gravatar jvanverth2016-09-20
| | | | | | | BUG=skia:5034 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2348523002 Review-Url: https://codereview.chromium.org/2348523002
* Refactor vulkan buffer mapping and unmappingGravatar egdaniel2016-09-19
| | | | | | | | | | | | | | A lot of this is so we don't have duplicated code in both the map/unmap and updateData functions of GrVkBuffer. Also there were slightly differences in how we handled various things in the two cases that this now unifies. Also I added a barrier after the vkUpdateBuffer call which I believe was missing. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2344323002 Review-Url: https://codereview.chromium.org/2344323002
* Properly recycle uniform buffers in vulkanGravatar egdaniel2016-07-29
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2195713002 Review-Url: https://codereview.chromium.org/2195713002
* Recycle small uniform buffers.Gravatar jvanverth2016-07-22
| | | | | | | BUG=skia:5031 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2159333002 Review-Url: https://codereview.chromium.org/2159333002
* Add offsets to GrVkBuffer.Gravatar jvanverth2016-07-07
| | | | | | | BUG=skia:5031 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2127183002 Review-Url: https://codereview.chromium.org/2127183002
* Only check resource tracking on program shutdown, not context shutdownGravatar jvanverth2016-07-07
| | | | | | | BUG=skia:5496 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2128273002 Review-Url: https://codereview.chromium.org/2128273002
* Deleting void pointers is bad, mmmkay?Gravatar jvanverth2016-07-06
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2129483003 Review-Url: https://codereview.chromium.org/2129483003
* Vulkan fixes for TesselatingPathRenderer testGravatar jvanverth2016-07-06
| | | | | | | | - Be sure to release all secondard command buffers on shutdown - Allow mapping of static buffers GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2123323002 Review-Url: https://codereview.chromium.org/2123323002
* Add static buffer supportGravatar jvanverth2016-06-30
| | | | | | | | | Put resource tracking check in the right place BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2112653002 Review-Url: https://codereview.chromium.org/2112653002
* Create free list heap for suballocationGravatar jvanverth2016-06-13
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2029763002 Review-Url: https://codereview.chromium.org/2029763002
* Add offset to memory allocationsGravatar jvanverth2016-06-01
| | | | | | | | | | | This is setting up for suballocations within one large allocation BUG=skia:5031 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2018933004 TBR=bsalomon@google.com Review-Url: https://codereview.chromium.org/2018933004
* Add OpenGL context to Viewer.Gravatar jvanverth2016-05-20
| | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1978573003 Committed: https://skia.googlesource.com/skia/+/56a11e4d6f3d436a3c2497c9c9e71a117d78a93f Review-Url: https://codereview.chromium.org/1978573003
* Revert of Add OpenGL context to Viewer. (patchset #7 id:120001 of ↵Gravatar jvanverth2016-05-18
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1978573003/ ) Reason for revert: sk_app/WindowContext.cpp is missing. Need to add file and resubmit. Original issue's description: > Add OpenGL context to Viewer. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1978573003 > > Committed: https://skia.googlesource.com/skia/+/56a11e4d6f3d436a3c2497c9c9e71a117d78a93f TBR=brianosman@google.com,bsalomon@google.com,djsollen@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/1990893002
* Add OpenGL context to Viewer.Gravatar jvanverth2016-05-17
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1978573003 Review-Url: https://codereview.chromium.org/1978573003
* Don't create new descriptor set for vulkan uniforms every drawGravatar egdaniel2016-04-08
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1872553005 Review URL: https://codereview.chromium.org/1872553005
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* Use NV glsl shader compiler for VulkanGravatar egdaniel2016-03-28
| | | | | | | | | | | | | | The nvidia direct glsl shader compiler seems to perform much better than using shaderc to compile to spir-v first. This change also includes a change to prefer host cached memory for buffers. Having cached buffers signifcantly improves performance whenever we need to do buffer reads and writes. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1835813003 Review URL: https://codereview.chromium.org/1835813003
* Create new buffer (if necessary) on vkMapGravatar jvanverth2016-03-16
| | | | | | | | | | The assumption here is that we only read via a Map after we sync the command buffer, and that when writing we don't Map to update, but to overwrite. This appears to be true. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1774913005 Review URL: https://codereview.chromium.org/1774913005
* Buffer fix for VkProgram cachingGravatar jvanverth2016-03-08
| | | | | | | | | | | | When caching VkPrograms, we can end up with situations where we overwrite uniform buffers while they're in use (or being prepared for use) in the command buffer. This fix will address that. This also addresses the rare but similar case of overwriting vertex or index buffers when they're in flight. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1774963003 Review URL: https://codereview.chromium.org/1774963003
* Add vulkan files into skia repo. This is an incomplete backend with only ↵Gravatar Greg Daniel2016-02-22
| | | | | | | | | | | | | | partial functionality at this time. R=robertphillips@google.com TBR=bsalomon@google.com BUG=skia:4955 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1718693002 Committed: https://skia.googlesource.com/skia/+/48cf268defad66f58f1aa03b4835e5583be96b2f Review URL: https://codereview.chromium.org/1718693002
* Revert of Add vulkan files into skia repo. (patchset #2 id:20001 of ↵Gravatar egdaniel2016-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1718693002/ ) Reason for revert: breaking builds Original issue's description: > Add vulkan files into skia repo. This is an incomplete backend with only partial functionality at this time. > > R=robertphillips@google.com > TBR=bsalomon@google.com > > BUG=skia:4955 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1718693002 > > Committed: https://skia.googlesource.com/skia/+/48cf268defad66f58f1aa03b4835e5583be96b2f TBR=robertphillips@google.com,bsalomon@google.com,jvanverth@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4955 Review URL: https://codereview.chromium.org/1723503002
* Add vulkan files into skia repo. This is an incomplete backend with only ↵Gravatar Greg Daniel2016-02-22
partial functionality at this time. R=robertphillips@google.com TBR=bsalomon@google.com BUG=skia:4955 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1718693002 Review URL: https://codereview.chromium.org/1718693002