April 2017
Intermediate to advanced
700 pages
21h 36m
English
Samplers control the way images are read inside shaders. They can be used separately or combined with a sampled image.
Sampling parameters are specified with a variable of type VkSamplerCreateInfo like this:
VkSamplerCreateInfo sampler_create_info = {
VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
nullptr,
0,
mag_filter,
min_filter,
mipmap_mode,
u_address_mode,
v_address_mode,
w_address_mode,
lod_bias,
anisotropy_enable,
max_anisotropy,
compare_enable,
compare_operator,
min_lod,
max_lod,
border_color,
unnormalized_coords
};
This variable is then provided to the function that creates the sampler:
VkResult result = vkCreateSampler( logical_device, &sampler_create_info, ...
Read now
Unlock full access