VK_KHR_sampler_mirror_clamp_to_edge extends the set of sampler address modes to include an additional mode (SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE) that effectively uses a texture map twice as large as the original image in which the additional half of the new image is a mirror image of the original image.
This new mode relaxes the need to generate images whose opposite edges match by using the original image to generate a matching “mirror image”. This mode allows the texture to be mirrored only once in the negative s, t, and r directions.
All functionality in this extension is included in core Vulkan 1.2. However, if Vulkan 1.2 is supported and this extension is not, the VkSamplerAddressMode SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE is optional. Since the original extension did not use an author suffix on the enum SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, it is used by both core and extension implementations.
Creating a sampler with the new address mode in each dimension
VkSamplerCreateInfo createInfo =
{
.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
// Other members set to application-desired values
};
createInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE;
createInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE;
createInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE;
VkSampler sampler;
VkResult result = vkCreateSampler(
device,
&createInfo,
&sampler);
VK_KHR_sampler_mirror_clamp_to_edge| Modifier and Type | Field and Description |
|---|---|
| public static final String | VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME
The extension name. |
| public static final int | VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION
The extension specification version. |
| public static final int | VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE
Extends |
| public static final int | VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE_KHR
Extends |
| Access | Constructor and Description |
|---|---|
| private |
| VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME | back to summary |
|---|---|
| public static final String VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME The extension name. | |
| VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION | back to summary |
|---|---|
| public static final int VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION The extension specification version. | |
| VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE | back to summary |
|---|---|
| public static final int VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE Extends Enum values: | |
| VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE_KHR | back to summary |
|---|---|
| public static final int VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE_KHR Extends Enum values: | |
| KHRSamplerMirrorClampToEdge | back to summary |
|---|---|
| private KHRSamplerMirrorClampToEdge() | |