MCPcopy Create free account
hub / github.com/begla/Intrinsic / initVkPipelineCache

Method initVkPipelineCache

IntrinsicCore/src/IntrinsicRendererRenderSystem.cpp:1053–1090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1051// <-
1052
1053void RenderSystem::initVkPipelineCache()
1054{
1055 _INTR_LOG_INFO("Creating Vulkan cache...");
1056
1057 _INTR_ARRAY(uint8_t) pipelineCacheData;
1058
1059 _INTR_STRING pipelineCacheFilePath = getPipelineCacheFilePath();
1060 _INTR_IFSTREAM ifs(pipelineCacheFilePath.c_str(), std::ifstream::binary);
1061
1062 ifs.seekg(0, ifs.end);
1063 std::streamoff size = ifs.tellg();
1064 ifs.seekg(0);
1065
1066 if (size != -1)
1067 {
1068 pipelineCacheData.resize(size);
1069 ifs.read((char*)pipelineCacheData.data(), size);
1070 }
1071 else
1072 {
1073 _INTR_LOG_WARNING("No pipeline cache available...");
1074 }
1075
1076 ifs.close();
1077
1078 VkPipelineCacheCreateInfo pipelineCache = {};
1079 {
1080 pipelineCache.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO;
1081 pipelineCache.pNext = nullptr;
1082 pipelineCache.initialDataSize = pipelineCacheData.size();
1083 pipelineCache.pInitialData = pipelineCacheData.data();
1084 pipelineCache.flags = 0u;
1085 }
1086
1087 VkResult result = vkCreatePipelineCache(_vkDevice, &pipelineCache, nullptr,
1088 &_vkPipelineCache);
1089 _INTR_VK_CHECK_RESULT(result);
1090}
1091
1092// <-
1093

Callers

nothing calls this directly

Calls 4

getPipelineCacheFilePathFunction · 0.85
resizeMethod · 0.80
dataMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected