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

Method GetSampler

libs/drape/vulkan/vulkan_object_manager.cpp:458–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458VkSampler VulkanObjectManager::GetSampler(SamplerKey const & key)
459{
460 std::lock_guard<std::mutex> lock(m_samplerMutex);
461
462 auto const it = m_samplers.find(key);
463 if (it != m_samplers.end())
464 return it->second;
465
466 VkSamplerCreateInfo samplerCreateInfo = {};
467 samplerCreateInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
468 samplerCreateInfo.magFilter = samplerCreateInfo.minFilter = GetVulkanFilter(key.GetTextureFilter());
469 samplerCreateInfo.addressModeU = GetVulkanSamplerAddressMode(key.GetWrapSMode());
470 samplerCreateInfo.addressModeV = GetVulkanSamplerAddressMode(key.GetWrapTMode());
471
472 VkSampler sampler;
473 CHECK_VK_CALL(vkCreateSampler(m_device, &samplerCreateInfo, nullptr, &sampler));
474
475 m_samplers.insert(std::make_pair(key, sampler));
476 return sampler;
477}
478} // namespace vulkan
479} // namespace dp

Callers

nothing calls this directly

Calls 8

GetVulkanFilterFunction · 0.85
GetWrapSModeMethod · 0.80
GetWrapTModeMethod · 0.80
findMethod · 0.45
endMethod · 0.45
GetTextureFilterMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected