72 {
75
76
77
78
83
86
87
93
94
95 switch (bufferType) {
98 allocUsage = requiresMappable ? BufferUsage::kCpuWritesGpuReads : BufferUsage::kGpuOnly;
99 break;
102 allocUsage = requiresMappable ? BufferUsage::kCpuWritesGpuReads : BufferUsage::kGpuOnly;
103 break;
106 allocUsage = requiresMappable ? BufferUsage::kCpuWritesGpuReads : BufferUsage::kGpuOnly;
107 break;
110 allocUsage = BufferUsage::kCpuWritesGpuReads;
111 break;
114 allocUsage = BufferUsage::kTransfersFromCpuToGpu;
115 break;
118 allocUsage = BufferUsage::kTransfersFromGpuToCpu;
119 break;
120 }
121
122
123
124
125 if (!requiresMappable) {
127 }
128
132
135 if (err) {
136 return nullptr;
137 }
138
140 auto checkResult = [gpu, allocUsage, shouldPersistentlyMapCpuToGpu](
VkResult result) {
142 "(allocUsage:%d, shouldPersistentlyMapCpuToGpu:%d)",
143 (int)allocUsage, (int)shouldPersistentlyMapCpuToGpu);
145 };
149 allocUsage,
150 shouldPersistentlyMapCpuToGpu,
151 checkResult,
152 &alloc)) {
154 return nullptr;
155 }
156
157
162 if (err) {
165 return nullptr;
166 }
167
168
172 if (!uniformDescSet) {
175 return nullptr;
176 }
177 }
178
181 "MakeVkBuffer"));
182}
@ kDynamic_GrAccessPattern
@ kStream_GrAccessPattern
static const GrVkDescriptorSet * make_uniform_desc_set(GrVkGpu *gpu, VkBuffer buffer, size_t size)
#define GR_VK_LOG_IF_NOT_SUCCESS(GPU, RESULT, X,...)
#define GR_VK_CALL_RESULT(GPU, RESULT, X)
GrAccessPattern accessPattern() const
bool shouldPersistentlyMapCpuToGpuBuffers() const
bool gpuOnlyBuffersMorePerformant() const
const GrVkCaps & vkCaps() const
bool protectedContext() const
bool checkVkResult(VkResult)
skgpu::VulkanMemoryAllocator * memoryAllocator() const
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
void FreeBufferMemory(VulkanMemoryAllocator *, const VulkanAlloc &alloc)
bool AllocBufferMemory(VulkanMemoryAllocator *, VkBuffer buffer, skgpu::VulkanMemoryAllocator::BufferUsage, bool shouldPersistentlyMapCpuToGpu, const std::function< CheckResult > &, VulkanAlloc *alloc)
VulkanMemoryAllocator::BufferUsage BufferUsage
uint32_t queueFamilyIndexCount
const uint32_t * pQueueFamilyIndices
VkBufferCreateFlags flags
VkSharingMode sharingMode
@ VK_SHARING_MODE_EXCLUSIVE
@ VK_BUFFER_USAGE_TRANSFER_DST_BIT
@ VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT
@ VK_BUFFER_USAGE_INDEX_BUFFER_BIT
@ VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT
@ VK_BUFFER_USAGE_VERTEX_BUFFER_BIT
@ VK_BUFFER_USAGE_TRANSFER_SRC_BIT
@ VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO