MCPcopy Create free account
hub / github.com/comaps/comaps / Dump

Method Dump

libs/drape/vulkan/vulkan_pipeline.cpp:208–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208void VulkanPipeline::Dump(VkDevice device)
209{
210 if (!m_isChanged)
211 return;
212
213 size_t constexpr kMaxCacheSizeInBytes = 1024 * 1024;
214
215 size_t cacheSize;
216 VkResult statusCode;
217 statusCode = vkGetPipelineCacheData(device, m_vulkanPipelineCache, &cacheSize, nullptr);
218 if (statusCode == VK_SUCCESS && cacheSize > 0)
219 {
220 if (cacheSize <= kMaxCacheSizeInBytes)
221 {
222 std::vector<uint8_t> dumpData(cacheSize);
223 statusCode = vkGetPipelineCacheData(device, m_vulkanPipelineCache, &cacheSize, dumpData.data());
224 if (statusCode == VK_SUCCESS)
225 {
226 auto const dumpFilePath = GetDumpFilePath();
227 try
228 {
229 FileWriter w(dumpFilePath);
230 WriteToSink(w, m_appVersionCode);
231 w.Write(dumpData.data(), dumpData.size());
232 }
233 catch (FileWriter::Exception const & exception)
234 {
235 LOG(LWARNING, ("Exception while writing file:", dumpFilePath, "reason:", exception.what()));
236 }
237 m_isChanged = false;
238 }
239 }
240 else
241 {
242 LOG(LWARNING, ("Maximum pipeline cache size exceeded (", cacheSize, "/", kMaxCacheSizeInBytes, "bytes)"));
243 }
244 }
245}
246
247void VulkanPipeline::ResetCache(VkDevice device)
248{

Callers 1

ResetSurfaceMethod · 0.45

Calls 6

GetDumpFilePathFunction · 0.85
WriteToSinkFunction · 0.85
dataMethod · 0.45
WriteMethod · 0.45
sizeMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected