28 {
29 VkSamplerCreateInfo sampler_info{};
30 sampler_info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
31 sampler_info.magFilter = VK_FILTER_LINEAR;
32 sampler_info.minFilter = VK_FILTER_LINEAR;
33 sampler_info.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
34 sampler_info.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
35 sampler_info.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
36 sampler_info.anisotropyEnable = VK_FALSE;
37 sampler_info.borderColor = VK_BORDER_COLOR_INT_OPAQUE_BLACK;
38 sampler_info.unnormalizedCoordinates = VK_FALSE;
39 sampler_info.compareEnable = VK_FALSE;
40 sampler_info.compareOp = VK_COMPARE_OP_ALWAYS;
41 sampler_info.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR;
42 if (vkCreateSampler(device, &sampler_info,
nullptr, &texture.
sampler) != VK_SUCCESS) {
43 throw mxvk::Exception(
"mxvk resource helper failed to create texture sampler");
44 }
45 }
VkSampler sampler
Sampler configured for linear filtering and clamp-to-edge addressing.