{-# language CPP #-}
-- | = Name
--
-- VK_QNX_external_memory_screen_buffer - device extension
--
-- == VK_QNX_external_memory_screen_buffer
--
-- [__Name String__]
--     @VK_QNX_external_memory_screen_buffer@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     530
--
-- [__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>
--              and
--             
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_external_memory VK_KHR_external_memory>
--              and
--             
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_dedicated_allocation VK_KHR_dedicated_allocation>
--          or
--         
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Version 1.1>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_queue_family_foreign VK_EXT_queue_family_foreign>
--
-- [__Contact__]
--
--     -   Mike Gorchak
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_QNX_external_memory_screen_buffer] @mgorchak-blackberry%0A*Here describe the issue or question you have about the VK_QNX_external_memory_screen_buffer extension* >
--
--     -   Aaron Ruby
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_QNX_external_memory_screen_buffer] @aruby-blackberry%0A*Here describe the issue or question you have about the VK_QNX_external_memory_screen_buffer extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2023-05-17
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Mike Gorchak, QNX \/ Blackberry Limited
--
--     -   Aaron Ruby, QNX \/ Blackberry Limited
--
-- == Description
--
-- This extension enables an application to import QNX Screen
-- 'Screen_buffer' objects created outside of the Vulkan device into Vulkan
-- memory objects, where they can be bound to images and buffers.
--
-- Some 'Screen_buffer' images have implementation-defined /external
-- formats/ that /may/ not correspond to Vulkan formats. Sampler Y′CBCR
-- conversion /can/ be used to sample from these images and convert them to
-- a known color space.
--
-- 'Screen_buffer' is strongly typed, so naming the handle type is
-- redundant. The internal layout and therefore size of a 'Screen_buffer'
-- image may depend on native usage flags that do not have corresponding
-- Vulkan counterparts.
--
-- == New Commands
--
-- -   'getScreenBufferPropertiesQNX'
--
-- == New Structures
--
-- -   'ScreenBufferPropertiesQNX'
--
-- -   Extending 'Vulkan.Core10.Image.ImageCreateInfo',
--     'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.SamplerYcbcrConversionCreateInfo':
--
--     -   'ExternalFormatQNX'
--
-- -   Extending 'Vulkan.Core10.Memory.MemoryAllocateInfo':
--
--     -   'ImportScreenBufferInfoQNX'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX'
--
-- -   Extending 'ScreenBufferPropertiesQNX':
--
--     -   'ScreenBufferFormatPropertiesQNX'
--
-- == New Enum Constants
--
-- -   'QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME'
--
-- -   'QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION'
--
-- -   Extending
--     'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.ExternalMemoryHandleTypeFlagBits':
--
--     -   'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.EXTERNAL_MEMORY_HANDLE_TYPE_SCREEN_BUFFER_BIT_QNX'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX'
--
-- == Version History
--
-- -   Revision 1, 2023-05-17 (Mike Gorchak)
--
--     -   Initial version
--
-- == See Also
--
-- 'ExternalFormatQNX', 'ImportScreenBufferInfoQNX',
-- 'PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX',
-- 'ScreenBufferFormatPropertiesQNX', 'ScreenBufferPropertiesQNX',
-- 'getScreenBufferPropertiesQNX'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_QNX_external_memory_screen_buffer Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_QNX_external_memory_screen_buffer  ( getScreenBufferPropertiesQNX
                                                               , ImportScreenBufferInfoQNX(..)
                                                               , ScreenBufferPropertiesQNX(..)
                                                               , ScreenBufferFormatPropertiesQNX(..)
                                                               , ExternalFormatQNX(..)
                                                               , PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX(..)
                                                               , QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION
                                                               , pattern QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION
                                                               , QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME
                                                               , pattern QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME
                                                               , Screen_buffer
                                                               ) where

import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Type.Equality ((:~:)(Refl))
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 GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core11.Enums.ChromaLocation (ChromaLocation)
import Vulkan.Core10.ImageView (ComponentMapping)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkGetScreenBufferPropertiesQNX))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.Core10.Enums.FormatFeatureFlagBits (FormatFeatureFlags)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core11.Enums.SamplerYcbcrModelConversion (SamplerYcbcrModelConversion)
import Vulkan.Core11.Enums.SamplerYcbcrRange (SamplerYcbcrRange)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetScreenBufferPropertiesQNX
  :: FunPtr (Ptr Device_T -> Ptr Screen_buffer -> Ptr (SomeStruct ScreenBufferPropertiesQNX) -> IO Result) -> Ptr Device_T -> Ptr Screen_buffer -> Ptr (SomeStruct ScreenBufferPropertiesQNX) -> IO Result

-- | vkGetScreenBufferPropertiesQNX - Get Properties of External Memory QNX
-- Screen Buffers
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Extensions.VK_KHR_external_memory.ERROR_INVALID_EXTERNAL_HANDLE_KHR'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QNX_external_memory_screen_buffer VK_QNX_external_memory_screen_buffer>,
-- 'Vulkan.Core10.Handles.Device', 'ScreenBufferPropertiesQNX'
getScreenBufferPropertiesQNX :: forall a io
                              . ( Extendss ScreenBufferPropertiesQNX a
                                , PokeChain a
                                , PeekChain a
                                , MonadIO io )
                             => -- | @device@ is the logical device that will be importing @buffer@.
                                --
                                -- #VUID-vkGetScreenBufferPropertiesQNX-device-parameter# @device@ /must/
                                -- be a valid 'Vulkan.Core10.Handles.Device' handle
                                Device
                             -> -- | @buffer@ is the QNX Screen buffer which will be imported.
                                --
                                -- #VUID-vkGetScreenBufferPropertiesQNX-buffer-08968# @buffer@ /must/ be a
                                -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-external-screen-buffer-validity valid QNX Screen buffer>
                                --
                                -- #VUID-vkGetScreenBufferPropertiesQNX-buffer-parameter# @buffer@ /must/
                                -- be a valid pointer to a valid 'Screen_buffer' value
                                (Ptr Screen_buffer)
                             -> io (ScreenBufferPropertiesQNX a)
getScreenBufferPropertiesQNX :: forall (a :: [*]) (io :: * -> *).
(Extendss ScreenBufferPropertiesQNX a, PokeChain a, PeekChain a,
 MonadIO io) =>
Device -> Ptr Screen_buffer -> io (ScreenBufferPropertiesQNX a)
getScreenBufferPropertiesQNX Device
device Ptr Screen_buffer
buffer = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetScreenBufferPropertiesQNXPtr :: FunPtr
  (Ptr Device_T
   -> Ptr Screen_buffer
   -> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
   -> IO Result)
vkGetScreenBufferPropertiesQNXPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr Screen_buffer
      -> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
      -> IO Result)
pVkGetScreenBufferPropertiesQNX (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr Screen_buffer
   -> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
   -> IO Result)
vkGetScreenBufferPropertiesQNXPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetScreenBufferPropertiesQNX is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetScreenBufferPropertiesQNX' :: Ptr Device_T
-> Ptr Screen_buffer
-> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
-> IO Result
vkGetScreenBufferPropertiesQNX' = FunPtr
  (Ptr Device_T
   -> Ptr Screen_buffer
   -> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
   -> IO Result)
-> Ptr Device_T
-> Ptr Screen_buffer
-> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
-> IO Result
mkVkGetScreenBufferPropertiesQNX FunPtr
  (Ptr Device_T
   -> Ptr Screen_buffer
   -> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
   -> IO Result)
vkGetScreenBufferPropertiesQNXPtr
  Ptr (ScreenBufferPropertiesQNX a)
pPProperties <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @(ScreenBufferPropertiesQNX _))
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetScreenBufferPropertiesQNX" (Ptr Device_T
-> Ptr Screen_buffer
-> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
-> IO Result
vkGetScreenBufferPropertiesQNX'
                                                                   (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                   (Ptr Screen_buffer
buffer)
                                                                   (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (ScreenBufferPropertiesQNX a)
pPProperties)))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  ScreenBufferPropertiesQNX a
pProperties <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @(ScreenBufferPropertiesQNX _) Ptr (ScreenBufferPropertiesQNX a)
pPProperties
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (ScreenBufferPropertiesQNX a
pProperties)


-- | VkImportScreenBufferInfoQNX - Import memory from a QNX Screen buffer
--
-- = Description
--
-- The implementation /may/ not acquire a reference to the imported Screen
-- buffer. Therefore, the application /must/ ensure that the object
-- referred to by @buffer@ stays valid as long as the device memory to
-- which it is imported is being used.
--
-- == Valid Usage
--
-- -   #VUID-VkImportScreenBufferInfoQNX-buffer-08966# If @buffer@ is not
--     @NULL@, QNX Screen Buffers /must/ be supported for import, as
--     reported by
--     'Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities.ExternalImageFormatProperties'
--     or
--     'Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities.ExternalBufferProperties'
--
-- -   #VUID-VkImportScreenBufferInfoQNX-buffer-08967# @buffer@ is not
--     @NULL@, it /must/ be a pointer to
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-external-screen-buffer-validity valid QNX Screen buffer>
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkImportScreenBufferInfoQNX-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QNX_external_memory_screen_buffer VK_QNX_external_memory_screen_buffer>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ImportScreenBufferInfoQNX = ImportScreenBufferInfoQNX
  { -- | @buffer@ is a pointer to a @struct@ 'Screen_buffer', the QNX Screen
    -- buffer to import
    ImportScreenBufferInfoQNX -> Ptr Screen_buffer
buffer :: Ptr Screen_buffer }
  deriving (Typeable, ImportScreenBufferInfoQNX -> ImportScreenBufferInfoQNX -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportScreenBufferInfoQNX -> ImportScreenBufferInfoQNX -> Bool
$c/= :: ImportScreenBufferInfoQNX -> ImportScreenBufferInfoQNX -> Bool
== :: ImportScreenBufferInfoQNX -> ImportScreenBufferInfoQNX -> Bool
$c== :: ImportScreenBufferInfoQNX -> ImportScreenBufferInfoQNX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImportScreenBufferInfoQNX)
#endif
deriving instance Show ImportScreenBufferInfoQNX

instance ToCStruct ImportScreenBufferInfoQNX where
  withCStruct :: forall b.
ImportScreenBufferInfoQNX
-> (Ptr ImportScreenBufferInfoQNX -> IO b) -> IO b
withCStruct ImportScreenBufferInfoQNX
x Ptr ImportScreenBufferInfoQNX -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr ImportScreenBufferInfoQNX
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImportScreenBufferInfoQNX
p ImportScreenBufferInfoQNX
x (Ptr ImportScreenBufferInfoQNX -> IO b
f Ptr ImportScreenBufferInfoQNX
p)
  pokeCStruct :: forall b.
Ptr ImportScreenBufferInfoQNX
-> ImportScreenBufferInfoQNX -> IO b -> IO b
pokeCStruct Ptr ImportScreenBufferInfoQNX
p ImportScreenBufferInfoQNX{Ptr Screen_buffer
buffer :: Ptr Screen_buffer
$sel:buffer:ImportScreenBufferInfoQNX :: ImportScreenBufferInfoQNX -> Ptr Screen_buffer
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportScreenBufferInfoQNX
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 ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Screen_buffer))) (Ptr Screen_buffer
buffer)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ImportScreenBufferInfoQNX -> IO b -> IO b
pokeZeroCStruct Ptr ImportScreenBufferInfoQNX
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportScreenBufferInfoQNX
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 ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Screen_buffer))) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ImportScreenBufferInfoQNX where
  peekCStruct :: Ptr ImportScreenBufferInfoQNX -> IO ImportScreenBufferInfoQNX
peekCStruct Ptr ImportScreenBufferInfoQNX
p = do
    Ptr Screen_buffer
buffer <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Screen_buffer) ((Ptr ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Screen_buffer)))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr Screen_buffer -> ImportScreenBufferInfoQNX
ImportScreenBufferInfoQNX
             Ptr Screen_buffer
buffer

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

instance Zero ImportScreenBufferInfoQNX where
  zero :: ImportScreenBufferInfoQNX
zero = Ptr Screen_buffer -> ImportScreenBufferInfoQNX
ImportScreenBufferInfoQNX
           forall a. Zero a => a
zero


-- | VkScreenBufferPropertiesQNX - Properties of External Memory QNX Screen
-- Buffers
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkScreenBufferPropertiesQNX-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX'
--
-- -   #VUID-VkScreenBufferPropertiesQNX-pNext-pNext# @pNext@ /must/ be
--     @NULL@ or a pointer to a valid instance of
--     'ScreenBufferFormatPropertiesQNX'
--
-- -   #VUID-VkScreenBufferPropertiesQNX-sType-unique# The @sType@ value of
--     each struct in the @pNext@ chain /must/ be unique
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QNX_external_memory_screen_buffer VK_QNX_external_memory_screen_buffer>,
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getScreenBufferPropertiesQNX'
data ScreenBufferPropertiesQNX (es :: [Type]) = ScreenBufferPropertiesQNX
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). ScreenBufferPropertiesQNX es -> Chain es
next :: Chain es
  , -- | @allocationSize@ is the size of the external memory.
    forall (es :: [*]). ScreenBufferPropertiesQNX es -> DeviceSize
allocationSize :: DeviceSize
  , -- | @memoryTypeBits@ is a bitmask containing one bit set for every memory
    -- type which the specified Screen buffer /can/ be imported as.
    forall (es :: [*]). ScreenBufferPropertiesQNX es -> Word32
memoryTypeBits :: Word32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ScreenBufferPropertiesQNX (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (ScreenBufferPropertiesQNX es)

instance Extensible ScreenBufferPropertiesQNX where
  extensibleTypeName :: String
extensibleTypeName = String
"ScreenBufferPropertiesQNX"
  setNext :: forall (ds :: [*]) (es :: [*]).
ScreenBufferPropertiesQNX ds
-> Chain es -> ScreenBufferPropertiesQNX es
setNext ScreenBufferPropertiesQNX{Word32
DeviceSize
Chain ds
memoryTypeBits :: Word32
allocationSize :: DeviceSize
next :: Chain ds
$sel:memoryTypeBits:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Word32
$sel:allocationSize:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> DeviceSize
$sel:next:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Chain es
..} Chain es
next' = ScreenBufferPropertiesQNX{$sel:next:ScreenBufferPropertiesQNX :: Chain es
next = Chain es
next', Word32
DeviceSize
memoryTypeBits :: Word32
allocationSize :: DeviceSize
$sel:memoryTypeBits:ScreenBufferPropertiesQNX :: Word32
$sel:allocationSize:ScreenBufferPropertiesQNX :: DeviceSize
..}
  getNext :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Chain es
getNext ScreenBufferPropertiesQNX{Word32
DeviceSize
Chain es
memoryTypeBits :: Word32
allocationSize :: DeviceSize
next :: Chain es
$sel:memoryTypeBits:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Word32
$sel:allocationSize:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> DeviceSize
$sel:next:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Chain es
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends ScreenBufferPropertiesQNX e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends ScreenBufferPropertiesQNX e => b) -> Maybe b
extends proxy e
_ Extends ScreenBufferPropertiesQNX e => b
f
    | Just e :~: ScreenBufferFormatPropertiesQNX
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ScreenBufferFormatPropertiesQNX = forall a. a -> Maybe a
Just Extends ScreenBufferPropertiesQNX e => b
f
    | Bool
otherwise = forall a. Maybe a
Nothing

instance ( Extendss ScreenBufferPropertiesQNX es
         , PokeChain es ) => ToCStruct (ScreenBufferPropertiesQNX es) where
  withCStruct :: forall b.
ScreenBufferPropertiesQNX es
-> (Ptr (ScreenBufferPropertiesQNX es) -> IO b) -> IO b
withCStruct ScreenBufferPropertiesQNX es
x Ptr (ScreenBufferPropertiesQNX es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr (ScreenBufferPropertiesQNX es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (ScreenBufferPropertiesQNX es)
p ScreenBufferPropertiesQNX es
x (Ptr (ScreenBufferPropertiesQNX es) -> IO b
f Ptr (ScreenBufferPropertiesQNX es)
p)
  pokeCStruct :: forall b.
Ptr (ScreenBufferPropertiesQNX es)
-> ScreenBufferPropertiesQNX es -> IO b -> IO b
pokeCStruct Ptr (ScreenBufferPropertiesQNX es)
p ScreenBufferPropertiesQNX{Word32
DeviceSize
Chain es
memoryTypeBits :: Word32
allocationSize :: DeviceSize
next :: Chain es
$sel:memoryTypeBits:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Word32
$sel:allocationSize:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> DeviceSize
$sel:next:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX)
    Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (DeviceSize
allocationSize)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
memoryTypeBits)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (ScreenBufferPropertiesQNX es) -> IO b -> IO b
pokeZeroCStruct Ptr (ScreenBufferPropertiesQNX es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX)
    Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f

instance ( Extendss ScreenBufferPropertiesQNX es
         , PeekChain es ) => FromCStruct (ScreenBufferPropertiesQNX es) where
  peekCStruct :: Ptr (ScreenBufferPropertiesQNX es)
-> IO (ScreenBufferPropertiesQNX es)
peekCStruct Ptr (ScreenBufferPropertiesQNX es)
p = do
    Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
    DeviceSize
allocationSize <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize))
    Word32
memoryTypeBits <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es -> DeviceSize -> Word32 -> ScreenBufferPropertiesQNX es
ScreenBufferPropertiesQNX
             Chain es
next DeviceSize
allocationSize Word32
memoryTypeBits

instance es ~ '[] => Zero (ScreenBufferPropertiesQNX es) where
  zero :: ScreenBufferPropertiesQNX es
zero = forall (es :: [*]).
Chain es -> DeviceSize -> Word32 -> ScreenBufferPropertiesQNX es
ScreenBufferPropertiesQNX
           ()
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkScreenBufferFormatPropertiesQNX - Structure describing the image
-- format properties of a QNX Screen buffer
--
-- = Description
--
-- If the QNX Screen buffer has one of the formats listed in the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-external-qnx-screen-buffer-formats QNX Screen Format Equivalence table>,
-- then @format@ /must/ have the equivalent Vulkan format listed in the
-- table. Otherwise, @format@ /may/ be
-- 'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED', indicating the QNX Screen
-- buffer /can/ only be used with an external format. The @formatFeatures@
-- member /must/ include
-- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_SAMPLED_IMAGE_BIT'
-- and /should/ include
-- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT'
-- and
-- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QNX_external_memory_screen_buffer VK_QNX_external_memory_screen_buffer>,
-- 'Vulkan.Core11.Enums.ChromaLocation.ChromaLocation',
-- 'Vulkan.Core10.ImageView.ComponentMapping',
-- 'Vulkan.Core10.Enums.Format.Format',
-- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlags',
-- 'Vulkan.Core11.Enums.SamplerYcbcrModelConversion.SamplerYcbcrModelConversion',
-- 'Vulkan.Core11.Enums.SamplerYcbcrRange.SamplerYcbcrRange',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ScreenBufferFormatPropertiesQNX = ScreenBufferFormatPropertiesQNX
  { -- | @format@ is the Vulkan format corresponding to the Screen buffer’s
    -- format or 'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED' if there is not
    -- an equivalent Vulkan format.
    ScreenBufferFormatPropertiesQNX -> Format
format :: Format
  , -- | @externalFormat@ is an implementation-defined external format identifier
    -- for use with 'ExternalFormatQNX'. It /must/ not be zero.
    ScreenBufferFormatPropertiesQNX -> DeviceSize
externalFormat :: Word64
  , -- | @screenUsage@ is an implementation-defined external usage identifier for
    -- the QNX Screen buffer.
    ScreenBufferFormatPropertiesQNX -> DeviceSize
screenUsage :: Word64
  , -- | @formatFeatures@ describes the capabilities of this external format when
    -- used with an image bound to memory imported from @buffer@.
    ScreenBufferFormatPropertiesQNX -> FormatFeatureFlags
formatFeatures :: FormatFeatureFlags
  , -- | @samplerYcbcrConversionComponents@ is the component swizzle that
    -- /should/ be used in
    -- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.SamplerYcbcrConversionCreateInfo'.
    ScreenBufferFormatPropertiesQNX -> ComponentMapping
samplerYcbcrConversionComponents :: ComponentMapping
  , -- | @suggestedYcbcrModel@ is a suggested color model to use in the
    -- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.SamplerYcbcrConversionCreateInfo'.
    ScreenBufferFormatPropertiesQNX -> SamplerYcbcrModelConversion
suggestedYcbcrModel :: SamplerYcbcrModelConversion
  , -- | @suggestedYcbcrRange@ is a suggested numerical value range to use in
    -- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.SamplerYcbcrConversionCreateInfo'.
    ScreenBufferFormatPropertiesQNX -> SamplerYcbcrRange
suggestedYcbcrRange :: SamplerYcbcrRange
  , -- | @suggestedXChromaOffset@ is a suggested X chroma offset to use in
    -- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.SamplerYcbcrConversionCreateInfo'.
    ScreenBufferFormatPropertiesQNX -> ChromaLocation
suggestedXChromaOffset :: ChromaLocation
  , -- | @suggestedYChromaOffset@ is a suggested Y chroma offset to use in
    -- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.SamplerYcbcrConversionCreateInfo'.
    ScreenBufferFormatPropertiesQNX -> ChromaLocation
suggestedYChromaOffset :: ChromaLocation
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ScreenBufferFormatPropertiesQNX)
#endif
deriving instance Show ScreenBufferFormatPropertiesQNX

instance ToCStruct ScreenBufferFormatPropertiesQNX where
  withCStruct :: forall b.
ScreenBufferFormatPropertiesQNX
-> (Ptr ScreenBufferFormatPropertiesQNX -> IO b) -> IO b
withCStruct ScreenBufferFormatPropertiesQNX
x Ptr ScreenBufferFormatPropertiesQNX -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
80 forall a b. (a -> b) -> a -> b
$ \Ptr ScreenBufferFormatPropertiesQNX
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ScreenBufferFormatPropertiesQNX
p ScreenBufferFormatPropertiesQNX
x (Ptr ScreenBufferFormatPropertiesQNX -> IO b
f Ptr ScreenBufferFormatPropertiesQNX
p)
  pokeCStruct :: forall b.
Ptr ScreenBufferFormatPropertiesQNX
-> ScreenBufferFormatPropertiesQNX -> IO b -> IO b
pokeCStruct Ptr ScreenBufferFormatPropertiesQNX
p ScreenBufferFormatPropertiesQNX{DeviceSize
Format
ComponentMapping
SamplerYcbcrRange
SamplerYcbcrModelConversion
ChromaLocation
FormatFeatureFlags
suggestedYChromaOffset :: ChromaLocation
suggestedXChromaOffset :: ChromaLocation
suggestedYcbcrRange :: SamplerYcbcrRange
suggestedYcbcrModel :: SamplerYcbcrModelConversion
samplerYcbcrConversionComponents :: ComponentMapping
formatFeatures :: FormatFeatureFlags
screenUsage :: DeviceSize
externalFormat :: DeviceSize
format :: Format
$sel:suggestedYChromaOffset:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> ChromaLocation
$sel:suggestedXChromaOffset:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> ChromaLocation
$sel:suggestedYcbcrRange:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> SamplerYcbcrRange
$sel:suggestedYcbcrModel:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> SamplerYcbcrModelConversion
$sel:samplerYcbcrConversionComponents:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> ComponentMapping
$sel:formatFeatures:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> FormatFeatureFlags
$sel:screenUsage:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> DeviceSize
$sel:externalFormat:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> DeviceSize
$sel:format:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> Format
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
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 ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Format)) (Format
format)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) (DeviceSize
externalFormat)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) (DeviceSize
screenUsage)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr FormatFeatureFlags)) (FormatFeatureFlags
formatFeatures)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ComponentMapping)) (ComponentMapping
samplerYcbcrConversionComponents)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr SamplerYcbcrModelConversion)) (SamplerYcbcrModelConversion
suggestedYcbcrModel)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr SamplerYcbcrRange)) (SamplerYcbcrRange
suggestedYcbcrRange)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr ChromaLocation)) (ChromaLocation
suggestedXChromaOffset)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr ChromaLocation)) (ChromaLocation
suggestedYChromaOffset)
    IO b
f
  cStructSize :: Int
cStructSize = Int
80
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ScreenBufferFormatPropertiesQNX -> IO b -> IO b
pokeZeroCStruct Ptr ScreenBufferFormatPropertiesQNX
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
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 ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Format)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr FormatFeatureFlags)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ComponentMapping)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr SamplerYcbcrModelConversion)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr SamplerYcbcrRange)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr ChromaLocation)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr ChromaLocation)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ScreenBufferFormatPropertiesQNX where
  peekCStruct :: Ptr ScreenBufferFormatPropertiesQNX
-> IO ScreenBufferFormatPropertiesQNX
peekCStruct Ptr ScreenBufferFormatPropertiesQNX
p = do
    Format
format <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Format))
    DeviceSize
externalFormat <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64))
    DeviceSize
screenUsage <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64))
    FormatFeatureFlags
formatFeatures <- forall a. Storable a => Ptr a -> IO a
peek @FormatFeatureFlags ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr FormatFeatureFlags))
    ComponentMapping
samplerYcbcrConversionComponents <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ComponentMapping ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ComponentMapping))
    SamplerYcbcrModelConversion
suggestedYcbcrModel <- forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrModelConversion ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr SamplerYcbcrModelConversion))
    SamplerYcbcrRange
suggestedYcbcrRange <- forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrRange ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr SamplerYcbcrRange))
    ChromaLocation
suggestedXChromaOffset <- forall a. Storable a => Ptr a -> IO a
peek @ChromaLocation ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr ChromaLocation))
    ChromaLocation
suggestedYChromaOffset <- forall a. Storable a => Ptr a -> IO a
peek @ChromaLocation ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr ChromaLocation))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Format
-> DeviceSize
-> DeviceSize
-> FormatFeatureFlags
-> ComponentMapping
-> SamplerYcbcrModelConversion
-> SamplerYcbcrRange
-> ChromaLocation
-> ChromaLocation
-> ScreenBufferFormatPropertiesQNX
ScreenBufferFormatPropertiesQNX
             Format
format
             DeviceSize
externalFormat
             DeviceSize
screenUsage
             FormatFeatureFlags
formatFeatures
             ComponentMapping
samplerYcbcrConversionComponents
             SamplerYcbcrModelConversion
suggestedYcbcrModel
             SamplerYcbcrRange
suggestedYcbcrRange
             ChromaLocation
suggestedXChromaOffset
             ChromaLocation
suggestedYChromaOffset

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

instance Zero ScreenBufferFormatPropertiesQNX where
  zero :: ScreenBufferFormatPropertiesQNX
zero = Format
-> DeviceSize
-> DeviceSize
-> FormatFeatureFlags
-> ComponentMapping
-> SamplerYcbcrModelConversion
-> SamplerYcbcrRange
-> ChromaLocation
-> ChromaLocation
-> ScreenBufferFormatPropertiesQNX
ScreenBufferFormatPropertiesQNX
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkExternalFormatQNX - Structure containing a QNX Screen buffer external
-- format
--
-- = Description
--
-- If @externalFormat@ is zero, the effect is as if the 'ExternalFormatQNX'
-- structure was not present. Otherwise, the @image@ will have the
-- specified external format.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QNX_external_memory_screen_buffer VK_QNX_external_memory_screen_buffer>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ExternalFormatQNX = ExternalFormatQNX
  { -- | @externalFormat@ is an implementation-defined identifier for the
    -- external format
    --
    -- #VUID-VkExternalFormatQNX-externalFormat-08956# @externalFormat@ /must/
    -- be @0@ or a value returned in the @externalFormat@ member of
    -- 'ScreenBufferFormatPropertiesQNX' by an earlier call to
    -- 'getScreenBufferPropertiesQNX'
    ExternalFormatQNX -> DeviceSize
externalFormat :: Word64 }
  deriving (Typeable, ExternalFormatQNX -> ExternalFormatQNX -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExternalFormatQNX -> ExternalFormatQNX -> Bool
$c/= :: ExternalFormatQNX -> ExternalFormatQNX -> Bool
== :: ExternalFormatQNX -> ExternalFormatQNX -> Bool
$c== :: ExternalFormatQNX -> ExternalFormatQNX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExternalFormatQNX)
#endif
deriving instance Show ExternalFormatQNX

instance ToCStruct ExternalFormatQNX where
  withCStruct :: forall b.
ExternalFormatQNX -> (Ptr ExternalFormatQNX -> IO b) -> IO b
withCStruct ExternalFormatQNX
x Ptr ExternalFormatQNX -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr ExternalFormatQNX
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExternalFormatQNX
p ExternalFormatQNX
x (Ptr ExternalFormatQNX -> IO b
f Ptr ExternalFormatQNX
p)
  pokeCStruct :: forall b.
Ptr ExternalFormatQNX -> ExternalFormatQNX -> IO b -> IO b
pokeCStruct Ptr ExternalFormatQNX
p ExternalFormatQNX{DeviceSize
externalFormat :: DeviceSize
$sel:externalFormat:ExternalFormatQNX :: ExternalFormatQNX -> DeviceSize
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalFormatQNX
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 ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) (DeviceSize
externalFormat)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ExternalFormatQNX -> IO b -> IO b
pokeZeroCStruct Ptr ExternalFormatQNX
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalFormatQNX
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 ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ExternalFormatQNX where
  peekCStruct :: Ptr ExternalFormatQNX -> IO ExternalFormatQNX
peekCStruct Ptr ExternalFormatQNX
p = do
    DeviceSize
externalFormat <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DeviceSize -> ExternalFormatQNX
ExternalFormatQNX
             DeviceSize
externalFormat

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

instance Zero ExternalFormatQNX where
  zero :: ExternalFormatQNX
zero = DeviceSize -> ExternalFormatQNX
ExternalFormatQNX
           forall a. Zero a => a
zero


-- | VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX - Structure
-- describing QNX Screen Buffer features that can be supported by an
-- implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX'
-- structure describe the following features:
--
-- = Description
--
-- \'
--
-- +-----------------------------------+------------------------------------+
-- | Features                          | Functionality                      |
-- +-----------------------------------+------------------------------------+
-- | @screenBufferImport@              | 'ImportScreenBufferInfoQNX'        |
-- +-----------------------------------+------------------------------------+
-- | Always supported1                 | 'getScreenBufferPropertiesQNX',    |
-- |                                   | 'ScreenBufferPropertiesQNX',       |
-- |                                   | 'ScreenBufferFormatPropertiesQNX', |
-- |                                   | 'ExternalFormatQNX'                |
-- +-----------------------------------+------------------------------------+
--
-- Functionality supported for QNX Screen Buffer features
--
-- [1]
--     Functionality in this row is always available.
--
-- The
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-externalscreenbuffer-table Functionality supported for QNX Screen buffer features>
-- table summarizes the functionality enabled by the
-- 'PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX' structure. Each
-- entry in the body of the table summarizes the functionality that /can/
-- be used when the given features are supported and enabled. This
-- summarizes Valid Usage statements that are added elsewhere in this
-- specification.
--
-- If the 'PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX' 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. 'PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX' /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_QNX_external_memory_screen_buffer VK_QNX_external_memory_screen_buffer>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX = PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
  { -- | #features-screenBufferImport# @screenBufferImport@ indicates whether QNX
    -- Screen buffer import functionality is supported. If @screenBufferImport@
    -- is set to 'Vulkan.Core10.FundamentalTypes.TRUE',
    -- 'Vulkan.Core10.Handles.DeviceMemory' supports importing 'Screen_buffer'
    -- from applications. In this case, the application is responsible for the
    -- resource management of the 'Screen_buffer'.
    PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
screenBufferImport :: Bool }
  deriving (Typeable, PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
$c/= :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
== :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
$c== :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX)
#endif
deriving instance Show PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX

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

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

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


type QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION"
pattern QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION :: forall a . Integral a => a
pattern $bQNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION :: forall a. Integral a => a
$mQNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION = 1


type QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME = "VK_QNX_external_memory_screen_buffer"

-- No documentation found for TopLevel "VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME"
pattern QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bQNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mQNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME = "VK_QNX_external_memory_screen_buffer"


data Screen_buffer