{-# language CPP #-}
-- | = Name
--
-- VK_EXT_border_color_swizzle - device extension
--
-- == VK_EXT_border_color_swizzle
--
-- [__Name String__]
--     @VK_EXT_border_color_swizzle@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     412
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires support for Vulkan 1.0
--
--     -   Requires @VK_EXT_custom_border_color@ to be enabled for any
--         device-level functionality
--
-- [__Special Uses__]
--
--     -   <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#extendingvulkan-compatibility-specialuse OpenGL \/ ES support>
--
--     -   <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#extendingvulkan-compatibility-specialuse D3D support>
--
-- [__Contact__]
--
--     -   Piers Daniell
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_border_color_swizzle] @pdaniell-nv%0A*Here describe the issue or question you have about the VK_EXT_border_color_swizzle extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2021-10-12
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Graeme Leese, Broadcom
--
--     -   Jan-Harald Fredriksen, Arm
--
--     -   Ricardo Garcia, Igalia
--
--     -   Shahbaz Youssefi, Google
--
--     -   Stu Smith, AMD
--
-- == Description
--
-- After the publication of VK_EXT_custom_border_color, it was discovered
-- that some implementations had undefined behavior when combining a
-- sampler that uses a custom border color with image views whose component
-- mapping is not the identity mapping.
--
-- Since VK_EXT_custom_border_color has already shipped, this new extension
-- VK_EXT_border_color_swizzle was created to define the interaction
-- between custom border colors and non-identity image view swizzles, and
-- provide a work-around for implementations that must pre-swizzle the
-- sampler border color to match the image view component mapping it is
-- combined with.
--
-- This extension also defines the behavior between samplers with an opaque
-- black border color and image views with a non-identity component
-- swizzle, which was previously left undefined.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceBorderColorSwizzleFeaturesEXT'
--
-- -   Extending 'Vulkan.Core10.Sampler.SamplerCreateInfo':
--
--     -   'SamplerBorderColorComponentMappingCreateInfoEXT'
--
-- == New Enum Constants
--
-- -   'EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME'
--
-- -   'EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT'
--
-- == Issues
--
-- None.
--
-- == Version History
--
-- -   Revision 1, 2021-10-12 (Piers Daniell)
--
--     -   Internal revisions.
--
-- == See Also
--
-- 'PhysicalDeviceBorderColorSwizzleFeaturesEXT',
-- 'SamplerBorderColorComponentMappingCreateInfoEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_border_color_swizzle Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_EXT_border_color_swizzle  ( SamplerBorderColorComponentMappingCreateInfoEXT(..)
                                                      , PhysicalDeviceBorderColorSwizzleFeaturesEXT(..)
                                                      , EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION
                                                      , pattern EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION
                                                      , EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME
                                                      , pattern EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME
                                                      ) where

import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.ImageView (ComponentMapping)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT))
-- | VkSamplerBorderColorComponentMappingCreateInfoEXT - Structure specifying
-- the component mapping of the border color
--
-- = Description
--
-- The 'Vulkan.Core10.ImageView.ComponentMapping' @components@ member
-- describes a remapping from components of the border color to components
-- of the vector returned by shader image instructions when the border
-- color is used.
--
-- == Valid Usage
--
-- -   #VUID-VkSamplerBorderColorComponentMappingCreateInfoEXT-borderColorSwizzle-06437#
--     The
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-borderColorSwizzle borderColorSwizzle>
--     feature /must/ be enabled.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkSamplerBorderColorComponentMappingCreateInfoEXT-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT'
--
-- -   #VUID-VkSamplerBorderColorComponentMappingCreateInfoEXT-components-parameter#
--     @components@ /must/ be a valid
--     'Vulkan.Core10.ImageView.ComponentMapping' structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_border_color_swizzle VK_EXT_border_color_swizzle>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.ImageView.ComponentMapping',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data SamplerBorderColorComponentMappingCreateInfoEXT = SamplerBorderColorComponentMappingCreateInfoEXT
  { -- | @components@ is a 'Vulkan.Core10.ImageView.ComponentMapping' structure
    -- specifying a remapping of the border color components.
    SamplerBorderColorComponentMappingCreateInfoEXT -> ComponentMapping
components :: ComponentMapping
  , -- | @srgb@ indicates that the sampler will be combined with an image view
    -- that has an image format which is sRGB encoded.
    SamplerBorderColorComponentMappingCreateInfoEXT -> Bool
srgb :: Bool
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SamplerBorderColorComponentMappingCreateInfoEXT)
#endif
deriving instance Show SamplerBorderColorComponentMappingCreateInfoEXT

instance ToCStruct SamplerBorderColorComponentMappingCreateInfoEXT where
  withCStruct :: forall b.
SamplerBorderColorComponentMappingCreateInfoEXT
-> (Ptr SamplerBorderColorComponentMappingCreateInfoEXT -> IO b)
-> IO b
withCStruct SamplerBorderColorComponentMappingCreateInfoEXT
x Ptr SamplerBorderColorComponentMappingCreateInfoEXT -> IO b
f = Int
-> (Ptr SamplerBorderColorComponentMappingCreateInfoEXT -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT -> IO b)
 -> IO b)
-> (Ptr SamplerBorderColorComponentMappingCreateInfoEXT -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p -> Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> SamplerBorderColorComponentMappingCreateInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p SamplerBorderColorComponentMappingCreateInfoEXT
x (Ptr SamplerBorderColorComponentMappingCreateInfoEXT -> IO b
f Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p)
  pokeCStruct :: forall b.
Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> SamplerBorderColorComponentMappingCreateInfoEXT -> IO b -> IO b
pokeCStruct Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p SamplerBorderColorComponentMappingCreateInfoEXT{Bool
ComponentMapping
srgb :: Bool
components :: ComponentMapping
$sel:srgb:SamplerBorderColorComponentMappingCreateInfoEXT :: SamplerBorderColorComponentMappingCreateInfoEXT -> Bool
$sel:components:SamplerBorderColorComponentMappingCreateInfoEXT :: SamplerBorderColorComponentMappingCreateInfoEXT -> ComponentMapping
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ComponentMapping -> ComponentMapping -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> Int -> Ptr ComponentMapping
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ComponentMapping)) (ComponentMapping
components)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
srgb))
    IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr SamplerBorderColorComponentMappingCreateInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ComponentMapping -> ComponentMapping -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> Int -> Ptr ComponentMapping
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ComponentMapping)) (ComponentMapping
forall a. Zero a => a
zero)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct SamplerBorderColorComponentMappingCreateInfoEXT where
  peekCStruct :: Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> IO SamplerBorderColorComponentMappingCreateInfoEXT
peekCStruct Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p = do
    ComponentMapping
components <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ComponentMapping ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> Int -> Ptr ComponentMapping
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ComponentMapping))
    Bool32
srgb <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32))
    SamplerBorderColorComponentMappingCreateInfoEXT
-> IO SamplerBorderColorComponentMappingCreateInfoEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SamplerBorderColorComponentMappingCreateInfoEXT
 -> IO SamplerBorderColorComponentMappingCreateInfoEXT)
-> SamplerBorderColorComponentMappingCreateInfoEXT
-> IO SamplerBorderColorComponentMappingCreateInfoEXT
forall a b. (a -> b) -> a -> b
$ ComponentMapping
-> Bool -> SamplerBorderColorComponentMappingCreateInfoEXT
SamplerBorderColorComponentMappingCreateInfoEXT
             ComponentMapping
components (Bool32 -> Bool
bool32ToBool Bool32
srgb)

instance Storable SamplerBorderColorComponentMappingCreateInfoEXT where
  sizeOf :: SamplerBorderColorComponentMappingCreateInfoEXT -> Int
sizeOf ~SamplerBorderColorComponentMappingCreateInfoEXT
_ = Int
40
  alignment :: SamplerBorderColorComponentMappingCreateInfoEXT -> Int
alignment ~SamplerBorderColorComponentMappingCreateInfoEXT
_ = Int
8
  peek :: Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> IO SamplerBorderColorComponentMappingCreateInfoEXT
peek = Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> IO SamplerBorderColorComponentMappingCreateInfoEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> SamplerBorderColorComponentMappingCreateInfoEXT -> IO ()
poke Ptr SamplerBorderColorComponentMappingCreateInfoEXT
ptr SamplerBorderColorComponentMappingCreateInfoEXT
poked = Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> SamplerBorderColorComponentMappingCreateInfoEXT
-> IO ()
-> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerBorderColorComponentMappingCreateInfoEXT
ptr SamplerBorderColorComponentMappingCreateInfoEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero SamplerBorderColorComponentMappingCreateInfoEXT where
  zero :: SamplerBorderColorComponentMappingCreateInfoEXT
zero = ComponentMapping
-> Bool -> SamplerBorderColorComponentMappingCreateInfoEXT
SamplerBorderColorComponentMappingCreateInfoEXT
           ComponentMapping
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero


-- | VkPhysicalDeviceBorderColorSwizzleFeaturesEXT - Structure describing
-- whether samplers with custom border colors require the component swizzle
-- specified in order to have defined behavior
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceBorderColorSwizzleFeaturesEXT' structure is
-- included in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. 'PhysicalDeviceBorderColorSwizzleFeaturesEXT' /can/ also be
-- used in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to
-- selectively enable these features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_border_color_swizzle VK_EXT_border_color_swizzle>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceBorderColorSwizzleFeaturesEXT = PhysicalDeviceBorderColorSwizzleFeaturesEXT
  { -- | #features-borderColorSwizzle# @borderColorSwizzle@ indicates that
    -- defined values are returned by sampled image operations when used with a
    -- sampler that uses a
    -- 'Vulkan.Core10.Enums.BorderColor.BORDER_COLOR_FLOAT_OPAQUE_BLACK',
    -- 'Vulkan.Core10.Enums.BorderColor.BORDER_COLOR_INT_OPAQUE_BLACK',
    -- 'Vulkan.Core10.Enums.BorderColor.BORDER_COLOR_FLOAT_CUSTOM_EXT', or
    -- 'Vulkan.Core10.Enums.BorderColor.BORDER_COLOR_INT_CUSTOM_EXT'
    -- @borderColor@ and an image view that uses a
    -- non-<https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#resources-image-views-identity-mappings identity component mapping>,
    -- when either @borderColorSwizzleFromImage@ is enabled or the
    -- 'SamplerBorderColorComponentMappingCreateInfoEXT' is specified.
    PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
borderColorSwizzle :: Bool
  , -- | #features-borderColorSwizzleFromImage# @borderColorSwizzleFromImage@
    -- indicates that the implementation will return the correct border color
    -- values from sampled image operations under the conditions expressed
    -- above, without the application having to specify the border color
    -- component mapping when creating the sampler object. If this feature bit
    -- is not set, applications /can/ chain a
    -- 'SamplerBorderColorComponentMappingCreateInfoEXT' structure when
    -- creating samplers for use with image views that do not have an
    -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#resources-image-views-identity-mappings identity swizzle>
    -- and, when those samplers are combined with image views using the same
    -- component mapping, sampled image operations that use opaque black or
    -- custom border colors will return the correct border color values.
    PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
borderColorSwizzleFromImage :: Bool
  }
  deriving (Typeable, PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
(PhysicalDeviceBorderColorSwizzleFeaturesEXT
 -> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool)
-> (PhysicalDeviceBorderColorSwizzleFeaturesEXT
    -> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool)
-> Eq PhysicalDeviceBorderColorSwizzleFeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
$c/= :: PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
== :: PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
$c== :: PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceBorderColorSwizzleFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceBorderColorSwizzleFeaturesEXT

instance ToCStruct PhysicalDeviceBorderColorSwizzleFeaturesEXT where
  withCStruct :: forall b.
PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> (Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b)
-> IO b
withCStruct PhysicalDeviceBorderColorSwizzleFeaturesEXT
x Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b
f = Int
-> (Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b) -> IO b)
-> (Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p -> Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p PhysicalDeviceBorderColorSwizzleFeaturesEXT
x (Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b
f Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p PhysicalDeviceBorderColorSwizzleFeaturesEXT{Bool
borderColorSwizzleFromImage :: Bool
borderColorSwizzle :: Bool
$sel:borderColorSwizzleFromImage:PhysicalDeviceBorderColorSwizzleFeaturesEXT :: PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
$sel:borderColorSwizzle:PhysicalDeviceBorderColorSwizzleFeaturesEXT :: PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
borderColorSwizzle))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
borderColorSwizzleFromImage))
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDeviceBorderColorSwizzleFeaturesEXT where
  peekCStruct :: Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> IO PhysicalDeviceBorderColorSwizzleFeaturesEXT
peekCStruct Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p = do
    Bool32
borderColorSwizzle <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    Bool32
borderColorSwizzleFromImage <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
    PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> IO PhysicalDeviceBorderColorSwizzleFeaturesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceBorderColorSwizzleFeaturesEXT
 -> IO PhysicalDeviceBorderColorSwizzleFeaturesEXT)
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> IO PhysicalDeviceBorderColorSwizzleFeaturesEXT
forall a b. (a -> b) -> a -> b
$ Bool -> Bool -> PhysicalDeviceBorderColorSwizzleFeaturesEXT
PhysicalDeviceBorderColorSwizzleFeaturesEXT
             (Bool32 -> Bool
bool32ToBool Bool32
borderColorSwizzle)
             (Bool32 -> Bool
bool32ToBool Bool32
borderColorSwizzleFromImage)

instance Storable PhysicalDeviceBorderColorSwizzleFeaturesEXT where
  sizeOf :: PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Int
sizeOf ~PhysicalDeviceBorderColorSwizzleFeaturesEXT
_ = Int
24
  alignment :: PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Int
alignment ~PhysicalDeviceBorderColorSwizzleFeaturesEXT
_ = Int
8
  peek :: Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> IO PhysicalDeviceBorderColorSwizzleFeaturesEXT
peek = Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> IO PhysicalDeviceBorderColorSwizzleFeaturesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO ()
poke Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
poked = Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PhysicalDeviceBorderColorSwizzleFeaturesEXT where
  zero :: PhysicalDeviceBorderColorSwizzleFeaturesEXT
zero = Bool -> Bool -> PhysicalDeviceBorderColorSwizzleFeaturesEXT
PhysicalDeviceBorderColorSwizzleFeaturesEXT
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero


type EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION"
pattern EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION :: forall a. Integral a => a
$mEXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION = 1


type EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME = "VK_EXT_border_color_swizzle"

-- No documentation found for TopLevel "VK_EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME"
pattern EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME = "VK_EXT_border_color_swizzle"