VKCOMPONENTMAPPING(3)

NAME
VkComponentMapping - Structure specifying a color component mapping

C SPECIFICATION

The VkComponentMapping structure is defined as:

    typedef struct VkComponentMapping {
        VkComponentSwizzle    r;
        VkComponentSwizzle    g;
        VkComponentSwizzle    b;
        VkComponentSwizzle    a;
    } VkComponentMapping;

MEMBERS

    • r determines the component value placed in the R component of the output vector.

    • g determines the component value placed in the G component of the output vector.

    • b determines the component value placed in the B component of the output vector.

    • a determines the component value placed in the A component of the output vector.

DESCRIPTION

Each of r, g, b, and a is one of the values:

    typedef enum VkComponentSwizzle {
        VK_COMPONENT_SWIZZLE_IDENTITY = 0,
        VK_COMPONENT_SWIZZLE_ZERO = 1,
        VK_COMPONENT_SWIZZLE_ONE = 2,
        VK_COMPONENT_SWIZZLE_R = 3,
        VK_COMPONENT_SWIZZLE_G = 4,
        VK_COMPONENT_SWIZZLE_B = 5,
        VK_COMPONENT_SWIZZLE_A = 6,
    } VkComponentSwizzle;

    • VK_COMPONENT_SWIZZLE_IDENTITY: the component is set to the identity swizzle.

    • VK_COMPONENT_SWIZZLE_ZERO: the component is set to zero.

    • VK_COMPONENT_SWIZZLE_ONE: the component is set to either 1 or 1.0 depending on whether the type of the image view format is integer or floating-point respectively, as determined by the Format Definition section for each VkFormat.

    • VK_COMPONENT_SWIZZLE_R: the component is set to the value of the R component of the image.

    • VK_COMPONENT_SWIZZLE_G: the component is set to the value of the G component of the image.

    • VK_COMPONENT_SWIZZLE_B: the component is set to the value of the B component of the image.

    • VK_COMPONENT_SWIZZLE_A: the component is set to the value of the A component of the image.

Setting the identity swizzle on a component is equivalent to setting the identity mapping on that component. That is:

Table 1. Component Mappings Equivalent To VK_COMPONENT_SWIZZLE_IDENTITY
Component | Identity Mapping
components.r | VK_COMPONENT_SWIZZLE_R
components.g | VK_COMPONENT_SWIZZLE_G
components.b | VK_COMPONENT_SWIZZLE_B
components.a | VK_COMPONENT_SWIZZLE_A

Valid Usage (Implicit)

    • r must be a valid VkComponentSwizzle value

    • g must be a valid VkComponentSwizzle value

    • b must be a valid VkComponentSwizzle value

    • a must be a valid VkComponentSwizzle value

SEE ALSO

VkComponentSwizzle, VkImageViewCreateInfo

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkComponentMapping

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.