Flutter Engine
The Flutter Engine
VulkanMemory.h
Go to the documentation of this file.
1/*
2* Copyright 2015 Google Inc.
3*
4* Use of this source code is governed by a BSD-style license that can be
5* found in the LICENSE file.
6*/
7
8#ifndef skgpu_VulkanMemory_DEFINED
9#define skgpu_VulkanMemory_DEFINED
10
13
14#include <functional>
15
16namespace skgpu {
17enum class Protected : bool;
18struct VulkanAlloc;
19
20namespace VulkanMemory {
21 using CheckResult = bool(VkResult);
22
24 VkBuffer buffer,
26 bool shouldPersistentlyMapCpuToGpu,
27 const std::function<CheckResult>&,
28 VulkanAlloc* alloc);
29
31
33 VkImage image,
34 skgpu::Protected isProtected,
35 bool forceDedicatedMemory,
36 bool useLazyAllocation,
37 const std::function<CheckResult>&,
38 VulkanAlloc* alloc);
39
41
42 // Maps the entire skgpu::VulkanAlloc and returns a pointer to the start of the allocation.
43 // Underneath the hood, we may map more than the range of the skgpu::VulkanAlloc (e.g. the
44 // entire VkDeviceMemory), but the pointer returned will always be to the start of the
45 // skgpu::VulkanAlloc. The caller should also never assume more than the skgpu::VulkanAlloc
46 // block has been mapped.
48 const VulkanAlloc&,
49 const std::function<CheckResult>&);
50 void UnmapAlloc(VulkanMemoryAllocator*, const VulkanAlloc& alloc);
51
52 // For the Flush and Invalidate calls, the offset should be relative to the skgpu::VulkanAlloc.
53 // Thus this will often be 0. The client does not need to make sure the offset and size are
54 // aligned to the nonCoherentAtomSize, the internal calls will handle that.
56 const skgpu::VulkanAlloc&,
59 const std::function<CheckResult>&);
61 const VulkanAlloc& alloc,
64 const std::function<CheckResult>&);
65
66 // Helper for aligning and setting VkMappedMemoryRange for flushing/invalidating noncoherent
67 // memory.
71 VkDeviceSize alignment,
73} // namespace VulkanMemory
74
75} // namespace skgpu
76
77#endif
sk_sp< const SkImage > image
Definition: SkRecords.h:269
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
void FreeBufferMemory(VulkanMemoryAllocator *, const VulkanAlloc &alloc)
bool AllocBufferMemory(VulkanMemoryAllocator *, VkBuffer buffer, skgpu::VulkanMemoryAllocator::BufferUsage, bool shouldPersistentlyMapCpuToGpu, const std::function< CheckResult > &, VulkanAlloc *alloc)
void GetNonCoherentMappedMemoryRange(const VulkanAlloc &, VkDeviceSize offset, VkDeviceSize size, VkDeviceSize alignment, VkMappedMemoryRange *)
void FreeImageMemory(VulkanMemoryAllocator *, const VulkanAlloc &alloc)
void * MapAlloc(VulkanMemoryAllocator *, const VulkanAlloc &, const std::function< CheckResult > &)
void FlushMappedAlloc(VulkanMemoryAllocator *, const skgpu::VulkanAlloc &, VkDeviceSize offset, VkDeviceSize size, const std::function< CheckResult > &)
bool AllocImageMemory(VulkanMemoryAllocator *, VkImage image, skgpu::Protected isProtected, bool forceDedicatedMemory, bool useLazyAllocation, const std::function< CheckResult > &, VulkanAlloc *alloc)
bool(VkResult) CheckResult
Definition: VulkanMemory.h:21
void UnmapAlloc(VulkanMemoryAllocator *, const VulkanAlloc &alloc)
void InvalidateMappedAlloc(VulkanMemoryAllocator *, const VulkanAlloc &alloc, VkDeviceSize offset, VkDeviceSize size, const std::function< CheckResult > &)
Definition: GpuTools.h:21
Protected
Definition: GpuTypes.h:61
SeparatedVector2 offset
uint64_t VkDeviceSize
Definition: vulkan_core.h:96
VkResult
Definition: vulkan_core.h:140