MCPcopy Create free account
hub / github.com/PacktPublishing/3D-Graphics-Rendering-Cookbook / createDepthSampler

Function createDepthSampler

shared/UtilsVulkan.cpp:2723–2741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2721}
2722
2723bool createDepthSampler(VkDevice device, VkSampler* sampler)
2724{
2725 VkSamplerCreateInfo si = {
2726 .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
2727 .magFilter = VK_FILTER_LINEAR,
2728 .minFilter = VK_FILTER_LINEAR,
2729 .mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR,
2730 .addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
2731 .addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
2732 .addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
2733 .mipLodBias = 0.0f,
2734 .maxAnisotropy = 1.0f,
2735 .minLod = 0.0f,
2736 .maxLod = 1.0f,
2737 .borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE
2738 };
2739
2740 return (vkCreateSampler(device, &si, nullptr, sampler) == VK_SUCCESS);
2741}
2742
2743VkSampleCountFlagBits getMaxUsableSampleCount(VkPhysicalDevice physDevice)
2744{

Callers 1

addDepthTextureMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected