// Copyright (c) 2014-2017 The Khronos Group Inc.
// Copyright notice at https://www.khronos.org/registry/speccopyright.html

[[VK_KHR_sampler_mirror_clamp_to_edge]]
== VK_KHR_sampler_mirror_clamp_to_edge

*Name String*::
    +VK_KHR_sampler_mirror_clamp_to_edge+
*Extension Type*::
    Device extension
*Registered Extension Number*::
    15
*Status*::
    Final
*Last Modified Date*::
    2016-02-16
*Revision*::
    1
*Dependencies*::
  - This extension is written against version 1.0 of the Vulkan API.
*Contributors*::
  - Tobias Hector, Imagination Technologies
*Contacts*::
  - Tobias Hector (tobias.hector@imgtec.com)

+VK_KHR_sampler_mirror_clamp_to_edge+ extends the set of sampler address
modes to include an additional mode
(ename:VK_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.

=== New Enum Constants

  * Extending elink:VkSamplerAddressMode:
  ** ename:VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE

=== Example

Creating a sampler with the new address mode in each dimension


[source,c++]
----------------------------------------
    VkSamplerCreateInfo createInfo =
    {
        VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO // sType
        // 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);
----------------------------------------

=== Version History

 * Revision 1, 2016-02-16 (Tobias Hector)
   - Initial draft
