{-# language CPP #-}
-- | = Name
--
-- VK_EXT_ycbcr_2plane_444_formats - device extension
--
-- == VK_EXT_ycbcr_2plane_444_formats
--
-- [__Name String__]
--     @VK_EXT_ycbcr_2plane_444_formats@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     331
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_sampler_ycbcr_conversion VK_KHR_sampler_ycbcr_conversion>
--     or
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Version 1.1>
--
-- [__Deprecation State__]
--
--     -   /Promoted/ to
--         <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.3-promotions Vulkan 1.3>
--
-- [__Contact__]
--
--     -   Tony Zlatinski
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_ycbcr_2plane_444_formats] @tzlatinski%0A*Here describe the issue or question you have about the VK_EXT_ycbcr_2plane_444_formats extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2020-07-28
--
-- [__Interactions and External Dependencies__]
--
--     -   Promoted to Vulkan 1.3 Core
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Piers Daniell, NVIDIA
--
--     -   Ping Liu, Intel
--
-- == Description
--
-- This extension adds some Y′CBCR formats that are in common use for video
-- encode and decode, but were not part of the
-- @VK_KHR_sampler_ycbcr_conversion@ extension.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT'
--
-- == New Enum Constants
--
-- -   'EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME'
--
-- -   'EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.Format.Format':
--
--     -   'FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT'
--
--     -   'FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT'
--
--     -   'FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT'
--
--     -   'FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT'
--
-- == Promotion to Vulkan 1.3
--
-- This extension has been partially promoted. The format enumerants
-- introduced by the extension are included in core Vulkan 1.3, with the
-- EXT suffix omitted. However, runtime support for these formats is
-- optional in core Vulkan 1.3, while if this extension is supported,
-- runtime support is mandatory. The feature structure is not promoted. The
-- original enum names are still available as aliases of the core
-- functionality.
--
-- == Version History
--
-- -   Revision 1, 2020-03-08 (Piers Daniell)
--
--     -   Initial draft
--
-- == See Also
--
-- 'PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_ycbcr_2plane_444_formats 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_ycbcr_2plane_444_formats  ( pattern FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT
                                                          , pattern FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT
                                                          , pattern FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT
                                                          , pattern FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT
                                                          , PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(..)
                                                          , EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION
                                                          , pattern EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION
                                                          , EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME
                                                          , pattern EXT_YCBCR_2PLANE_444_FORMATS_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.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.Format (Format(FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16))
import Vulkan.Core10.Enums.Format (Format(FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16))
import Vulkan.Core10.Enums.Format (Format(FORMAT_G16_B16R16_2PLANE_444_UNORM))
import Vulkan.Core10.Enums.Format (Format(FORMAT_G8_B8R8_2PLANE_444_UNORM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT))
-- No documentation found for TopLevel "VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT"
pattern $bFORMAT_G8_B8R8_2PLANE_444_UNORM_EXT :: Format
$mFORMAT_G8_B8R8_2PLANE_444_UNORM_EXT :: forall {r}. Format -> ((# #) -> r) -> ((# #) -> r) -> r
FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT = FORMAT_G8_B8R8_2PLANE_444_UNORM


-- No documentation found for TopLevel "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT"
pattern $bFORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT :: Format
$mFORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT :: forall {r}. Format -> ((# #) -> r) -> ((# #) -> r) -> r
FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT = FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16


-- No documentation found for TopLevel "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT"
pattern $bFORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT :: Format
$mFORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT :: forall {r}. Format -> ((# #) -> r) -> ((# #) -> r) -> r
FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT = FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16


-- No documentation found for TopLevel "VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT"
pattern $bFORMAT_G16_B16R16_2PLANE_444_UNORM_EXT :: Format
$mFORMAT_G16_B16R16_2PLANE_444_UNORM_EXT :: forall {r}. Format -> ((# #) -> r) -> ((# #) -> r) -> r
FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT = FORMAT_G16_B16R16_2PLANE_444_UNORM


-- | VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT - Structure describing
-- whether the implementation supports additional 2-plane 444 Y′CBCR
-- formats
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT' 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. 'PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT' /can/ also
-- be used in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo'
-- to selectively enable these features.
--
-- == Valid Usage (Implicit)
--
-- Note
--
-- Although the formats defined by the @VK_EXT_ycbcr_2plane_444_formats@
-- were promoted to Vulkan 1.3 as optional formats, the
-- 'PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT' structure was not
-- promoted to Vulkan 1.3.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_ycbcr_2plane_444_formats VK_EXT_ycbcr_2plane_444_formats>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT = PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT
  { -- | #features-ycbcr2plane444Formats# @ycbcr2plane444Formats@ indicates that
    -- the implementation supports the following 2-plane 444 Y′CBCR formats:
    --
    -- -   'Vulkan.Core10.Enums.Format.FORMAT_G8_B8R8_2PLANE_444_UNORM'
    --
    -- -   'Vulkan.Core10.Enums.Format.FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16'
    --
    -- -   'Vulkan.Core10.Enums.Format.FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16'
    --
    -- -   'Vulkan.Core10.Enums.Format.FORMAT_G16_B16R16_2PLANE_444_UNORM'
    PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT -> Bool
ycbcr2plane444Formats :: Bool }
  deriving (Typeable, PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT
-> PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT
-> PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT -> Bool
$c/= :: PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT
-> PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT -> Bool
== :: PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT
-> PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT -> Bool
$c== :: PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT
-> PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT

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

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

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

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


type EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION"
pattern EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION :: forall a. Integral a => a
$mEXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION = 1


type EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME = "VK_EXT_ycbcr_2plane_444_formats"

-- No documentation found for TopLevel "VK_EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME"
pattern EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME = "VK_EXT_ycbcr_2plane_444_formats"