{-# language CPP #-}
-- | = Name
--
-- VK_EXT_rgba10x6_formats - device extension
--
-- == VK_EXT_rgba10x6_formats
--
-- [__Name String__]
--     @VK_EXT_rgba10x6_formats@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     345
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires Vulkan 1.0
--
--     -   Requires @VK_KHR_sampler_ycbcr_conversion@
--
-- [__Contact__]
--
--     -   Jan-Harald Fredriksen
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_rgba10x6_formats] @janharaldfredriksen-arm%0A<<Here describe the issue or question you have about the VK_EXT_rgba10x6_formats extension>> >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2021-09-29
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Jan-Harald Fredriksen, Arm
--
--     -   Graeme Leese, Broadcom
--
--     -   Spencer Fricke, Samsung
--
-- == Description
--
-- This extension enables the
-- 'Vulkan.Core10.Enums.Format.FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16'
-- format to be used without a
-- <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#samplers-YCbCr-conversion sampler Y′CBCR conversion>
-- enabled.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceRGBA10X6FormatsFeaturesEXT'
--
-- == New Enum Constants
--
-- -   'EXT_RGBA10X6_FORMATS_EXTENSION_NAME'
--
-- -   'EXT_RGBA10X6_FORMATS_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT'
--
-- == Issues
--
-- 1) Should we reuse the existing format enumeration or introduce a new
-- one?
--
-- __RESOLVED__: We reuse an existing format enumeration,
-- 'Vulkan.Core10.Enums.Format.FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16',
-- that was previously exclusively used for YCbCr and therefore had a set
-- of limitations related to that usage. The alternative was to introduce a
-- new format token with exactly the same bit representation as the
-- existing token, but without the limitations.
--
-- 2) Should we only introduce
-- 'Vulkan.Core10.Enums.Format.FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16'
-- or also 1-3 component variations?
--
-- __RESOLVED__: Only the 4-component format is introduced because the 1-
-- and 2- component variations are already not exclusive to YCbCr, and the
-- 3-component variation is not a good match for hardware capabilities.
--
-- == Version History
--
-- -   Revision 1, 2021-09-29 (Jan-Harald Fredriksen)
--
--     -   Initial EXT version
--
-- == See Also
--
-- 'PhysicalDeviceRGBA10X6FormatsFeaturesEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_rgba10x6_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_rgba10x6_formats  ( PhysicalDeviceRGBA10X6FormatsFeaturesEXT(..)
                                                  , EXT_RGBA10X6_FORMATS_SPEC_VERSION
                                                  , pattern EXT_RGBA10X6_FORMATS_SPEC_VERSION
                                                  , EXT_RGBA10X6_FORMATS_EXTENSION_NAME
                                                  , pattern EXT_RGBA10X6_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.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT))
-- | VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT - Structure describing
-- whether rendering to VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16
-- formats can be supported by an implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceRGBA10X6FormatsFeaturesEXT' structure
-- describe the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceRGBA10X6FormatsFeaturesEXT' 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. 'PhysicalDeviceRGBA10X6FormatsFeaturesEXT' /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_rgba10x6_formats VK_EXT_rgba10x6_formats>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceRGBA10X6FormatsFeaturesEXT = PhysicalDeviceRGBA10X6FormatsFeaturesEXT
  { -- | #features-formatRgba10x6WithoutYCbCrSampler#
    -- @formatRgba10x6WithoutYCbCrSampler@ indicates that
    -- 'Vulkan.Core10.Enums.Format.FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16'
    -- /can/ be used with a 'Vulkan.Core10.Handles.ImageView' with
    -- @subresourceRange.aspectMask@ equal to
    -- 'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_COLOR_BIT' without
    -- a
    -- <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#samplers-YCbCr-conversion sampler Y′CBCR conversion>
    -- enabled.
    PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> Bool
formatRgba10x6WithoutYCbCrSampler :: Bool }
  deriving (Typeable, PhysicalDeviceRGBA10X6FormatsFeaturesEXT
-> PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> Bool
(PhysicalDeviceRGBA10X6FormatsFeaturesEXT
 -> PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> Bool)
-> (PhysicalDeviceRGBA10X6FormatsFeaturesEXT
    -> PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> Bool)
-> Eq PhysicalDeviceRGBA10X6FormatsFeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceRGBA10X6FormatsFeaturesEXT
-> PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> Bool
$c/= :: PhysicalDeviceRGBA10X6FormatsFeaturesEXT
-> PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> Bool
== :: PhysicalDeviceRGBA10X6FormatsFeaturesEXT
-> PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> Bool
$c== :: PhysicalDeviceRGBA10X6FormatsFeaturesEXT
-> PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceRGBA10X6FormatsFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceRGBA10X6FormatsFeaturesEXT

instance ToCStruct PhysicalDeviceRGBA10X6FormatsFeaturesEXT where
  withCStruct :: PhysicalDeviceRGBA10X6FormatsFeaturesEXT
-> (Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> IO b) -> IO b
withCStruct PhysicalDeviceRGBA10X6FormatsFeaturesEXT
x Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> IO b
f = Int
-> (Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> IO b) -> IO b)
-> (Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
p -> Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
-> PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
p PhysicalDeviceRGBA10X6FormatsFeaturesEXT
x (Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> IO b
f Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
p)
  pokeCStruct :: Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
-> PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
p PhysicalDeviceRGBA10X6FormatsFeaturesEXT{Bool
formatRgba10x6WithoutYCbCrSampler :: Bool
$sel:formatRgba10x6WithoutYCbCrSampler:PhysicalDeviceRGBA10X6FormatsFeaturesEXT :: PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
p Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
p Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> 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 PhysicalDeviceRGBA10X6FormatsFeaturesEXT
p Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
formatRgba10x6WithoutYCbCrSampler))
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
p Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT
p Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> 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 PhysicalDeviceRGBA10X6FormatsFeaturesEXT
p Ptr PhysicalDeviceRGBA10X6FormatsFeaturesEXT -> 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))
    IO b
f

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

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

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


type EXT_RGBA10X6_FORMATS_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_RGBA10X6_FORMATS_SPEC_VERSION"
pattern EXT_RGBA10X6_FORMATS_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_RGBA10X6_FORMATS_SPEC_VERSION :: a
$mEXT_RGBA10X6_FORMATS_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
EXT_RGBA10X6_FORMATS_SPEC_VERSION = 1


type EXT_RGBA10X6_FORMATS_EXTENSION_NAME = "VK_EXT_rgba10x6_formats"

-- No documentation found for TopLevel "VK_EXT_RGBA10X6_FORMATS_EXTENSION_NAME"
pattern EXT_RGBA10X6_FORMATS_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_RGBA10X6_FORMATS_EXTENSION_NAME :: a
$mEXT_RGBA10X6_FORMATS_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_RGBA10X6_FORMATS_EXTENSION_NAME = "VK_EXT_rgba10x6_formats"