{-# language CPP #-}
module Vulkan.Extensions.VK_NV_shading_rate_image  ( cmdBindShadingRateImageNV
                                                   , cmdSetViewportShadingRatePaletteNV
                                                   , cmdSetCoarseSampleOrderNV
                                                   , ShadingRatePaletteNV(..)
                                                   , PipelineViewportShadingRateImageStateCreateInfoNV(..)
                                                   , PhysicalDeviceShadingRateImageFeaturesNV(..)
                                                   , PhysicalDeviceShadingRateImagePropertiesNV(..)
                                                   , CoarseSampleLocationNV(..)
                                                   , CoarseSampleOrderCustomNV(..)
                                                   , PipelineViewportCoarseSampleOrderStateCreateInfoNV(..)
                                                   , ShadingRatePaletteEntryNV( SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV
                                                                              , SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV
                                                                              , SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV
                                                                              , SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV
                                                                              , SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV
                                                                              , SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV
                                                                              , SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV
                                                                              , SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV
                                                                              , SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV
                                                                              , SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV
                                                                              , SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV
                                                                              , SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV
                                                                              , ..
                                                                              )
                                                   , CoarseSampleOrderTypeNV( COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV
                                                                            , COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV
                                                                            , COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV
                                                                            , COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV
                                                                            , ..
                                                                            )
                                                   , NV_SHADING_RATE_IMAGE_SPEC_VERSION
                                                   , pattern NV_SHADING_RATE_IMAGE_SPEC_VERSION
                                                   , NV_SHADING_RATE_IMAGE_EXTENSION_NAME
                                                   , pattern NV_SHADING_RATE_IMAGE_EXTENSION_NAME
                                                   ) where

import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import qualified Data.Vector (null)
import Control.Monad.IO.Class (MonadIO)
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.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Data.Int (Int32)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import Data.Word (Word32)
import Text.Read.Lex (Lexeme(Ident))
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.BaseType (bool32ToBool)
import Vulkan.Core10.BaseType (boolToBool32)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.BaseType (Bool32)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Dynamic (DeviceCmds(pVkCmdBindShadingRateImageNV))
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetCoarseSampleOrderNV))
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetViewportShadingRatePaletteNV))
import Vulkan.Core10.SharedTypes (Extent2D)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Enums.ImageLayout (ImageLayout)
import Vulkan.Core10.Enums.ImageLayout (ImageLayout(..))
import Vulkan.Core10.Handles (ImageView)
import Vulkan.Core10.Handles (ImageView(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdBindShadingRateImageNV
  :: FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ()) -> Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ()

-- | vkCmdBindShadingRateImageNV - Bind a shading rate image on a command
-- buffer
--
-- = Parameters
--
-- -   @commandBuffer@ is the command buffer into which the command will be
--     recorded.
--
-- -   @imageView@ is an image view handle specifying the shading rate
--     image. @imageView@ /may/ be set to
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', which is equivalent to
--     specifying a view of an image filled with zero values.
--
-- -   @imageLayout@ is the layout that the image subresources accessible
--     from @imageView@ will be in when the shading rate image is accessed.
--
-- == Valid Usage
--
-- -   The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-shadingRateImage shading rate image>
--     feature /must/ be enabled
--
-- -   If @imageView@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', it
--     /must/ be a valid 'Vulkan.Core10.Handles.ImageView' handle of type
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_2D' or
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_2D_ARRAY'
--
-- -   If @imageView@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', it
--     /must/ have a format of 'Vulkan.Core10.Enums.Format.FORMAT_R8_UINT'
--
-- -   If @imageView@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', it
--     /must/ have been created with a @usage@ value including
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV'
--
-- -   If @imageView@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @imageLayout@ /must/ match the actual
--     'Vulkan.Core10.Enums.ImageLayout.ImageLayout' of each subresource
--     accessible from @imageView@ at the time the subresource is accessed
--
-- -   If @imageView@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @imageLayout@ /must/ be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV'
--     or 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL'
--
-- == Valid Usage (Implicit)
--
-- -   @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   If @imageView@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @imageView@ /must/ be a valid 'Vulkan.Core10.Handles.ImageView'
--     handle
--
-- -   @imageLayout@ /must/ be a valid
--     'Vulkan.Core10.Enums.ImageLayout.ImageLayout' value
--
-- -   @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics operations
--
-- -   Both of @commandBuffer@, and @imageView@ that are valid handles of
--     non-ignored parameters /must/ have been created, allocated, or
--     retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Graphics                                                                                                              |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Core10.Enums.ImageLayout.ImageLayout',
-- 'Vulkan.Core10.Handles.ImageView'
cmdBindShadingRateImageNV :: forall io . MonadIO io => CommandBuffer -> ImageView -> ImageLayout -> io ()
cmdBindShadingRateImageNV :: CommandBuffer -> ImageView -> ImageLayout -> io ()
cmdBindShadingRateImageNV commandBuffer :: CommandBuffer
commandBuffer imageView :: ImageView
imageView imageLayout :: ImageLayout
imageLayout = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdBindShadingRateImageNVPtr :: FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
vkCmdBindShadingRateImageNVPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
pVkCmdBindShadingRateImageNV (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
vkCmdBindShadingRateImageNVPtr FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdBindShadingRateImageNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdBindShadingRateImageNV' :: Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ()
vkCmdBindShadingRateImageNV' = FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
-> Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ()
mkVkCmdBindShadingRateImageNV FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
vkCmdBindShadingRateImageNVPtr
  Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ()
vkCmdBindShadingRateImageNV' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) (ImageView
imageView) (ImageLayout
imageLayout)
  () -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdSetViewportShadingRatePaletteNV
  :: FunPtr (Ptr CommandBuffer_T -> Word32 -> Word32 -> Ptr ShadingRatePaletteNV -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Word32 -> Ptr ShadingRatePaletteNV -> IO ()

-- | vkCmdSetViewportShadingRatePaletteNV - Set shading rate image palettes
-- on a command buffer
--
-- = Parameters
--
-- -   @commandBuffer@ is the command buffer into which the command will be
--     recorded.
--
-- -   @firstViewport@ is the index of the first viewport whose shading
--     rate palette is updated by the command.
--
-- -   @viewportCount@ is the number of viewports whose shading rate
--     palettes are updated by the command.
--
-- -   @pShadingRatePalettes@ is a pointer to an array of
--     'ShadingRatePaletteNV' structures defining the palette for each
--     viewport.
--
-- == Valid Usage
--
-- -   The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-shadingRateImage shading rate image>
--     feature /must/ be enabled
--
-- -   @firstViewport@ /must/ be less than
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxViewports@
--
-- -   The sum of @firstViewport@ and @viewportCount@ /must/ be between @1@
--     and
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxViewports@,
--     inclusive
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-multiViewport multiple viewports>
--     feature is not enabled, @firstViewport@ /must/ be @0@
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-multiViewport multiple viewports>
--     feature is not enabled, @viewportCount@ /must/ be @1@
--
-- == Valid Usage (Implicit)
--
-- -   @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   @pShadingRatePalettes@ /must/ be a valid pointer to an array of
--     @viewportCount@ valid 'ShadingRatePaletteNV' structures
--
-- -   @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics operations
--
-- -   @viewportCount@ /must/ be greater than @0@
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Graphics                                                                                                              |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer', 'ShadingRatePaletteNV'
cmdSetViewportShadingRatePaletteNV :: forall io . MonadIO io => CommandBuffer -> ("firstViewport" ::: Word32) -> ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV) -> io ()
cmdSetViewportShadingRatePaletteNV :: CommandBuffer
-> ("firstViewport" ::: Word32)
-> ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV)
-> io ()
cmdSetViewportShadingRatePaletteNV commandBuffer :: CommandBuffer
commandBuffer firstViewport :: "firstViewport" ::: Word32
firstViewport shadingRatePalettes :: "shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdSetViewportShadingRatePaletteNVPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("firstViewport" ::: Word32)
   -> ("firstViewport" ::: Word32)
   -> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
   -> IO ())
vkCmdSetViewportShadingRatePaletteNVPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("firstViewport" ::: Word32)
      -> ("firstViewport" ::: Word32)
      -> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
      -> IO ())
pVkCmdSetViewportShadingRatePaletteNV (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("firstViewport" ::: Word32)
   -> ("firstViewport" ::: Word32)
   -> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
   -> IO ())
vkCmdSetViewportShadingRatePaletteNVPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("firstViewport" ::: Word32)
   -> ("firstViewport" ::: Word32)
   -> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("firstViewport" ::: Word32)
      -> ("firstViewport" ::: Word32)
      -> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("firstViewport" ::: Word32)
   -> ("firstViewport" ::: Word32)
   -> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdSetViewportShadingRatePaletteNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdSetViewportShadingRatePaletteNV' :: Ptr CommandBuffer_T
-> ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32)
-> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> IO ()
vkCmdSetViewportShadingRatePaletteNV' = FunPtr
  (Ptr CommandBuffer_T
   -> ("firstViewport" ::: Word32)
   -> ("firstViewport" ::: Word32)
   -> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32)
-> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> IO ()
mkVkCmdSetViewportShadingRatePaletteNV FunPtr
  (Ptr CommandBuffer_T
   -> ("firstViewport" ::: Word32)
   -> ("firstViewport" ::: Word32)
   -> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
   -> IO ())
vkCmdSetViewportShadingRatePaletteNVPtr
  "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pPShadingRatePalettes <- ((("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO ())
 -> IO ())
-> ContT
     () IO ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO ())
  -> IO ())
 -> ContT
      () IO ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV))
-> ((("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @ShadingRatePaletteNV ((("shadingRatePalettes" ::: Vector ShadingRatePaletteNV) -> Int
forall a. Vector a -> Int
Data.Vector.length ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 16) 8
  (Int -> ShadingRatePaletteNV -> ContT () IO ())
-> ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV)
-> ContT () IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ShadingRatePaletteNV
e -> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO ()) -> IO ()) -> ContT () IO ())
-> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> ShadingRatePaletteNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pPShadingRatePalettes ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> Int -> "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ShadingRatePaletteNV) (ShadingRatePaletteNV
e) (IO () -> IO ())
-> ((() -> IO ()) -> IO ()) -> (() -> IO ()) -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ())) ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32)
-> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> IO ()
vkCmdSetViewportShadingRatePaletteNV' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) ("firstViewport" ::: Word32
firstViewport) ((Int -> "firstViewport" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("shadingRatePalettes" ::: Vector ShadingRatePaletteNV) -> Int
forall a. Vector a -> Int
Data.Vector.length (("shadingRatePalettes" ::: Vector ShadingRatePaletteNV) -> Int)
-> ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV) -> Int
forall a b. (a -> b) -> a -> b
$ ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes)) :: Word32)) ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pPShadingRatePalettes)
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdSetCoarseSampleOrderNV
  :: FunPtr (Ptr CommandBuffer_T -> CoarseSampleOrderTypeNV -> Word32 -> Ptr CoarseSampleOrderCustomNV -> IO ()) -> Ptr CommandBuffer_T -> CoarseSampleOrderTypeNV -> Word32 -> Ptr CoarseSampleOrderCustomNV -> IO ()

-- | vkCmdSetCoarseSampleOrderNV - Set sample order for coarse fragments on a
-- command buffer
--
-- = Parameters
--
-- -   @commandBuffer@ is the command buffer into which the command will be
--     recorded.
--
-- -   @sampleOrderType@ specifies the mechanism used to order coverage
--     samples in fragments larger than one pixel.
--
-- -   @customSampleOrderCount@ specifies the number of custom sample
--     orderings to use when ordering coverage samples.
--
-- -   @pCustomSampleOrders@ is a pointer to an array of
--     'CoarseSampleOrderCustomNV' structures, each of which specifies the
--     coverage sample order for a single combination of fragment area and
--     coverage sample count.
--
-- = Description
--
-- If @sampleOrderType@ is 'COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV', the
-- coverage sample order used for any combination of fragment area and
-- coverage sample count not enumerated in @pCustomSampleOrders@ will be
-- identical to that used for 'COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV'.
--
-- == Valid Usage
--
-- -   If @sampleOrderType@ is not 'COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV',
--     @customSamplerOrderCount@ /must/ be @0@
--
-- -   The array @pCustomSampleOrders@ /must/ not contain two structures
--     with matching values for both the @shadingRate@ and @sampleCount@
--     members
--
-- == Valid Usage (Implicit)
--
-- -   @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   @sampleOrderType@ /must/ be a valid 'CoarseSampleOrderTypeNV' value
--
-- -   If @customSampleOrderCount@ is not @0@, @pCustomSampleOrders@ /must/
--     be a valid pointer to an array of @customSampleOrderCount@ valid
--     'CoarseSampleOrderCustomNV' structures
--
-- -   @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics operations
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Graphics                                                                                                              |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'CoarseSampleOrderCustomNV', 'CoarseSampleOrderTypeNV',
-- 'Vulkan.Core10.Handles.CommandBuffer'
cmdSetCoarseSampleOrderNV :: forall io . MonadIO io => CommandBuffer -> CoarseSampleOrderTypeNV -> ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV) -> io ()
cmdSetCoarseSampleOrderNV :: CommandBuffer
-> CoarseSampleOrderTypeNV
-> ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
-> io ()
cmdSetCoarseSampleOrderNV commandBuffer :: CommandBuffer
commandBuffer sampleOrderType :: CoarseSampleOrderTypeNV
sampleOrderType customSampleOrders :: "customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdSetCoarseSampleOrderNVPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> CoarseSampleOrderTypeNV
   -> ("firstViewport" ::: Word32)
   -> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
   -> IO ())
vkCmdSetCoarseSampleOrderNVPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> CoarseSampleOrderTypeNV
      -> ("firstViewport" ::: Word32)
      -> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
      -> IO ())
pVkCmdSetCoarseSampleOrderNV (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> CoarseSampleOrderTypeNV
   -> ("firstViewport" ::: Word32)
   -> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
   -> IO ())
vkCmdSetCoarseSampleOrderNVPtr FunPtr
  (Ptr CommandBuffer_T
   -> CoarseSampleOrderTypeNV
   -> ("firstViewport" ::: Word32)
   -> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> CoarseSampleOrderTypeNV
      -> ("firstViewport" ::: Word32)
      -> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> CoarseSampleOrderTypeNV
   -> ("firstViewport" ::: Word32)
   -> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdSetCoarseSampleOrderNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdSetCoarseSampleOrderNV' :: Ptr CommandBuffer_T
-> CoarseSampleOrderTypeNV
-> ("firstViewport" ::: Word32)
-> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> IO ()
vkCmdSetCoarseSampleOrderNV' = FunPtr
  (Ptr CommandBuffer_T
   -> CoarseSampleOrderTypeNV
   -> ("firstViewport" ::: Word32)
   -> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
   -> IO ())
-> Ptr CommandBuffer_T
-> CoarseSampleOrderTypeNV
-> ("firstViewport" ::: Word32)
-> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> IO ()
mkVkCmdSetCoarseSampleOrderNV FunPtr
  (Ptr CommandBuffer_T
   -> CoarseSampleOrderTypeNV
   -> ("firstViewport" ::: Word32)
   -> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
   -> IO ())
vkCmdSetCoarseSampleOrderNVPtr
  "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pPCustomSampleOrders <- ((("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV))
-> ((("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
    -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @CoarseSampleOrderCustomNV ((("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV) -> Int
forall a. Vector a -> Int
Data.Vector.length ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 24) 8
  (Int -> CoarseSampleOrderCustomNV -> ContT () IO ())
-> ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
-> ContT () IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: CoarseSampleOrderCustomNV
e -> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO ()) -> IO ()) -> ContT () IO ())
-> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> CoarseSampleOrderCustomNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pPCustomSampleOrders ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (24 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr CoarseSampleOrderCustomNV) (CoarseSampleOrderCustomNV
e) (IO () -> IO ())
-> ((() -> IO ()) -> IO ()) -> (() -> IO ()) -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ())) ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> CoarseSampleOrderTypeNV
-> ("firstViewport" ::: Word32)
-> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> IO ()
vkCmdSetCoarseSampleOrderNV' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) (CoarseSampleOrderTypeNV
sampleOrderType) ((Int -> "firstViewport" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV) -> Int
forall a. Vector a -> Int
Data.Vector.length (("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
 -> Int)
-> ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
-> Int
forall a b. (a -> b) -> a -> b
$ ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders)) :: Word32)) ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pPCustomSampleOrders)
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


-- | VkShadingRatePaletteNV - Structure specifying a single shading rate
-- palette
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'PipelineViewportShadingRateImageStateCreateInfoNV',
-- 'ShadingRatePaletteEntryNV', 'cmdSetViewportShadingRatePaletteNV'
data ShadingRatePaletteNV = ShadingRatePaletteNV
  { -- | @pShadingRatePaletteEntries@ /must/ be a valid pointer to an array of
    -- @shadingRatePaletteEntryCount@ valid 'ShadingRatePaletteEntryNV' values
    ShadingRatePaletteNV -> Vector ShadingRatePaletteEntryNV
shadingRatePaletteEntries :: Vector ShadingRatePaletteEntryNV }
  deriving (Typeable)
deriving instance Show ShadingRatePaletteNV

instance ToCStruct ShadingRatePaletteNV where
  withCStruct :: ShadingRatePaletteNV
-> (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO b)
-> IO b
withCStruct x :: ShadingRatePaletteNV
x f :: ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO b
f = Int
-> Int
-> (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 16 8 ((("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO b)
 -> IO b)
-> (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p -> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> ShadingRatePaletteNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p ShadingRatePaletteNV
x (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO b
f "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p)
  pokeCStruct :: ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> ShadingRatePaletteNV -> IO b -> IO b
pokeCStruct p :: "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p ShadingRatePaletteNV{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) ((Int -> "firstViewport" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector ShadingRatePaletteEntryNV -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ShadingRatePaletteEntryNV -> Int)
-> Vector ShadingRatePaletteEntryNV -> Int
forall a b. (a -> b) -> a -> b
$ (Vector ShadingRatePaletteEntryNV
shadingRatePaletteEntries)) :: Word32))
    Ptr ShadingRatePaletteEntryNV
pPShadingRatePaletteEntries' <- ((Ptr ShadingRatePaletteEntryNV -> IO b) -> IO b)
-> ContT b IO (Ptr ShadingRatePaletteEntryNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ShadingRatePaletteEntryNV -> IO b) -> IO b)
 -> ContT b IO (Ptr ShadingRatePaletteEntryNV))
-> ((Ptr ShadingRatePaletteEntryNV -> IO b) -> IO b)
-> ContT b IO (Ptr ShadingRatePaletteEntryNV)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ShadingRatePaletteEntryNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @ShadingRatePaletteEntryNV ((Vector ShadingRatePaletteEntryNV -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ShadingRatePaletteEntryNV
shadingRatePaletteEntries)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ShadingRatePaletteEntryNV -> IO ())
-> Vector ShadingRatePaletteEntryNV -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ShadingRatePaletteEntryNV
e -> Ptr ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ShadingRatePaletteEntryNV
pPShadingRatePaletteEntries' Ptr ShadingRatePaletteEntryNV
-> Int -> Ptr ShadingRatePaletteEntryNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ShadingRatePaletteEntryNV) (ShadingRatePaletteEntryNV
e)) (Vector ShadingRatePaletteEntryNV
shadingRatePaletteEntries)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ShadingRatePaletteEntryNV)
-> Ptr ShadingRatePaletteEntryNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> Int -> Ptr (Ptr ShadingRatePaletteEntryNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ShadingRatePaletteEntryNV))) (Ptr ShadingRatePaletteEntryNV
pPShadingRatePaletteEntries')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 16
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> IO b -> IO b
pokeZeroCStruct p :: "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    Ptr ShadingRatePaletteEntryNV
pPShadingRatePaletteEntries' <- ((Ptr ShadingRatePaletteEntryNV -> IO b) -> IO b)
-> ContT b IO (Ptr ShadingRatePaletteEntryNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ShadingRatePaletteEntryNV -> IO b) -> IO b)
 -> ContT b IO (Ptr ShadingRatePaletteEntryNV))
-> ((Ptr ShadingRatePaletteEntryNV -> IO b) -> IO b)
-> ContT b IO (Ptr ShadingRatePaletteEntryNV)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ShadingRatePaletteEntryNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @ShadingRatePaletteEntryNV ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ShadingRatePaletteEntryNV -> IO ())
-> Vector ShadingRatePaletteEntryNV -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ShadingRatePaletteEntryNV
e -> Ptr ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ShadingRatePaletteEntryNV
pPShadingRatePaletteEntries' Ptr ShadingRatePaletteEntryNV
-> Int -> Ptr ShadingRatePaletteEntryNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ShadingRatePaletteEntryNV) (ShadingRatePaletteEntryNV
e)) (Vector ShadingRatePaletteEntryNV
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ShadingRatePaletteEntryNV)
-> Ptr ShadingRatePaletteEntryNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> Int -> Ptr (Ptr ShadingRatePaletteEntryNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ShadingRatePaletteEntryNV))) (Ptr ShadingRatePaletteEntryNV
pPShadingRatePaletteEntries')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct ShadingRatePaletteNV where
  peekCStruct :: ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> IO ShadingRatePaletteNV
peekCStruct p :: "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p = do
    "firstViewport" ::: Word32
shadingRatePaletteEntryCount <- Ptr ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32))
    Ptr ShadingRatePaletteEntryNV
pShadingRatePaletteEntries <- Ptr (Ptr ShadingRatePaletteEntryNV)
-> IO (Ptr ShadingRatePaletteEntryNV)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ShadingRatePaletteEntryNV) (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> Int -> Ptr (Ptr ShadingRatePaletteEntryNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ShadingRatePaletteEntryNV)))
    Vector ShadingRatePaletteEntryNV
pShadingRatePaletteEntries' <- Int
-> (Int -> IO ShadingRatePaletteEntryNV)
-> IO (Vector ShadingRatePaletteEntryNV)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("firstViewport" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "firstViewport" ::: Word32
shadingRatePaletteEntryCount) (\i :: Int
i -> Ptr ShadingRatePaletteEntryNV -> IO ShadingRatePaletteEntryNV
forall a. Storable a => Ptr a -> IO a
peek @ShadingRatePaletteEntryNV ((Ptr ShadingRatePaletteEntryNV
pShadingRatePaletteEntries Ptr ShadingRatePaletteEntryNV
-> Int -> Ptr ShadingRatePaletteEntryNV
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ShadingRatePaletteEntryNV)))
    ShadingRatePaletteNV -> IO ShadingRatePaletteNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ShadingRatePaletteNV -> IO ShadingRatePaletteNV)
-> ShadingRatePaletteNV -> IO ShadingRatePaletteNV
forall a b. (a -> b) -> a -> b
$ Vector ShadingRatePaletteEntryNV -> ShadingRatePaletteNV
ShadingRatePaletteNV
             Vector ShadingRatePaletteEntryNV
pShadingRatePaletteEntries'

instance Zero ShadingRatePaletteNV where
  zero :: ShadingRatePaletteNV
zero = Vector ShadingRatePaletteEntryNV -> ShadingRatePaletteNV
ShadingRatePaletteNV
           Vector ShadingRatePaletteEntryNV
forall a. Monoid a => a
mempty


-- | VkPipelineViewportShadingRateImageStateCreateInfoNV - Structure
-- specifying parameters controlling shading rate image usage
--
-- = Description
--
-- If this structure is not present, @shadingRateImageEnable@ is considered
-- to be 'Vulkan.Core10.BaseType.FALSE', and the shading rate image and
-- palettes are not used.
--
-- == Valid Usage
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-multiViewport multiple viewports>
--     feature is not enabled, @viewportCount@ /must/ be @0@ or @1@
--
-- -   @viewportCount@ /must/ be less than or equal to
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxViewports@
--
-- -   If @shadingRateImageEnable@ is 'Vulkan.Core10.BaseType.TRUE',
--     @viewportCount@ /must/ be equal to the @viewportCount@ member of
--     'Vulkan.Core10.Pipeline.PipelineViewportStateCreateInfo'
--
-- -   If no element of the @pDynamicStates@ member of @pDynamicState@ is
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV',
--     @pShadingRatePalettes@ /must/ be a valid pointer to an array of
--     @viewportCount@ 'ShadingRatePaletteNV' structures
--
-- == Valid Usage (Implicit)
--
-- -   @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV'
--
-- -   If @viewportCount@ is not @0@, and @pShadingRatePalettes@ is not
--     @NULL@, @pShadingRatePalettes@ /must/ be a valid pointer to an array
--     of @viewportCount@ valid 'ShadingRatePaletteNV' structures
--
-- = See Also
--
-- 'Vulkan.Core10.BaseType.Bool32', 'ShadingRatePaletteNV',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PipelineViewportShadingRateImageStateCreateInfoNV = PipelineViewportShadingRateImageStateCreateInfoNV
  { -- | @shadingRateImageEnable@ specifies whether shading rate image and
    -- palettes are used during rasterization.
    PipelineViewportShadingRateImageStateCreateInfoNV -> Bool
shadingRateImageEnable :: Bool
  , -- | @viewportCount@ specifies the number of per-viewport palettes used to
    -- translate values stored in shading rate images.
    PipelineViewportShadingRateImageStateCreateInfoNV
-> "firstViewport" ::: Word32
viewportCount :: Word32
  , -- | @pShadingRatePalettes@ is a pointer to an array of
    -- 'ShadingRatePaletteNV' structures defining the palette for each
    -- viewport. If the shading rate palette state is dynamic, this member is
    -- ignored.
    PipelineViewportShadingRateImageStateCreateInfoNV
-> "shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes :: Vector ShadingRatePaletteNV
  }
  deriving (Typeable)
deriving instance Show PipelineViewportShadingRateImageStateCreateInfoNV

instance ToCStruct PipelineViewportShadingRateImageStateCreateInfoNV where
  withCStruct :: PipelineViewportShadingRateImageStateCreateInfoNV
-> (Ptr PipelineViewportShadingRateImageStateCreateInfoNV -> IO b)
-> IO b
withCStruct x :: PipelineViewportShadingRateImageStateCreateInfoNV
x f :: Ptr PipelineViewportShadingRateImageStateCreateInfoNV -> IO b
f = Int
-> Int
-> (Ptr PipelineViewportShadingRateImageStateCreateInfoNV -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV -> IO b)
 -> IO b)
-> (Ptr PipelineViewportShadingRateImageStateCreateInfoNV -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p -> Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> PipelineViewportShadingRateImageStateCreateInfoNV
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p PipelineViewportShadingRateImageStateCreateInfoNV
x (Ptr PipelineViewportShadingRateImageStateCreateInfoNV -> IO b
f Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p)
  pokeCStruct :: Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> PipelineViewportShadingRateImageStateCreateInfoNV
-> IO b
-> IO b
pokeCStruct p :: Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p PipelineViewportShadingRateImageStateCreateInfoNV{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
shadingRateImageEnable))
    let pShadingRatePalettesLength :: Int
pShadingRatePalettesLength = ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV) -> Int
forall a. Vector a -> Int
Data.Vector.length (("shadingRatePalettes" ::: Vector ShadingRatePaletteNV) -> Int)
-> ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV) -> Int
forall a b. (a -> b) -> a -> b
$ ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes)
    "firstViewport" ::: Word32
viewportCount'' <- IO ("firstViewport" ::: Word32)
-> ContT b IO ("firstViewport" ::: Word32)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("firstViewport" ::: Word32)
 -> ContT b IO ("firstViewport" ::: Word32))
-> IO ("firstViewport" ::: Word32)
-> ContT b IO ("firstViewport" ::: Word32)
forall a b. (a -> b) -> a -> b
$ if ("firstViewport" ::: Word32
viewportCount) ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> Bool
forall a. Eq a => a -> a -> Bool
== 0
      then ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32))
-> ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall a b. (a -> b) -> a -> b
$ Int -> "firstViewport" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pShadingRatePalettesLength
      else do
        Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Int -> "firstViewport" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pShadingRatePalettesLength ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> Bool
forall a. Eq a => a -> a -> Bool
== ("firstViewport" ::: Word32
viewportCount) Bool -> Bool -> Bool
|| Int
pShadingRatePalettesLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== 0) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
          IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "pShadingRatePalettes must be empty or have 'viewportCount' elements" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
        ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ("firstViewport" ::: Word32
viewportCount)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("firstViewport" ::: Word32
viewportCount'')
    "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pShadingRatePalettes'' <- if ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV) -> Bool
forall a. Vector a -> Bool
Data.Vector.null ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes)
      then ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> ContT b IO ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
forall a. Ptr a
nullPtr
      else do
        "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pPShadingRatePalettes <- ((("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO b)
 -> IO b)
-> ContT b IO ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO b)
  -> IO b)
 -> ContT
      b IO ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV))
-> ((("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO b)
    -> IO b)
-> ContT b IO ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @ShadingRatePaletteNV (((("shadingRatePalettes" ::: Vector ShadingRatePaletteNV) -> Int
forall a. Vector a -> Int
Data.Vector.length ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes))) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 16) 8
        (Int -> ShadingRatePaletteNV -> ContT b IO ())
-> ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV)
-> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ShadingRatePaletteNV
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> ShadingRatePaletteNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pPShadingRatePalettes ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> Int -> "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ShadingRatePaletteNV) (ShadingRatePaletteNV
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes))
        ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> ContT b IO ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
 -> ContT
      b IO ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV))
-> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> ContT b IO ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
forall a b. (a -> b) -> a -> b
$ "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pPShadingRatePalettes
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> Int -> Ptr ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ShadingRatePaletteNV))) "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pShadingRatePalettes''
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> IO b -> IO b
pokeZeroCStruct p :: Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PipelineViewportShadingRateImageStateCreateInfoNV where
  peekCStruct :: Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> IO PipelineViewportShadingRateImageStateCreateInfoNV
peekCStruct p :: Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p = do
    Bool32
shadingRateImageEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
    "firstViewport" ::: Word32
viewportCount <- Ptr ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
    "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pShadingRatePalettes <- Ptr ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> IO ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ShadingRatePaletteNV) ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> Int -> Ptr ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ShadingRatePaletteNV)))
    let pShadingRatePalettesLength :: Int
pShadingRatePalettesLength = if "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pShadingRatePalettes ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV) -> Bool
forall a. Eq a => a -> a -> Bool
== "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
forall a. Ptr a
nullPtr then 0 else (("firstViewport" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "firstViewport" ::: Word32
viewportCount)
    "shadingRatePalettes" ::: Vector ShadingRatePaletteNV
pShadingRatePalettes' <- Int
-> (Int -> IO ShadingRatePaletteNV)
-> IO ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
pShadingRatePalettesLength (\i :: Int
i -> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> IO ShadingRatePaletteNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ShadingRatePaletteNV (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pShadingRatePalettes ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> Int -> "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ShadingRatePaletteNV)))
    PipelineViewportShadingRateImageStateCreateInfoNV
-> IO PipelineViewportShadingRateImageStateCreateInfoNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineViewportShadingRateImageStateCreateInfoNV
 -> IO PipelineViewportShadingRateImageStateCreateInfoNV)
-> PipelineViewportShadingRateImageStateCreateInfoNV
-> IO PipelineViewportShadingRateImageStateCreateInfoNV
forall a b. (a -> b) -> a -> b
$ Bool
-> ("firstViewport" ::: Word32)
-> ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV)
-> PipelineViewportShadingRateImageStateCreateInfoNV
PipelineViewportShadingRateImageStateCreateInfoNV
             (Bool32 -> Bool
bool32ToBool Bool32
shadingRateImageEnable) "firstViewport" ::: Word32
viewportCount "shadingRatePalettes" ::: Vector ShadingRatePaletteNV
pShadingRatePalettes'

instance Zero PipelineViewportShadingRateImageStateCreateInfoNV where
  zero :: PipelineViewportShadingRateImageStateCreateInfoNV
zero = Bool
-> ("firstViewport" ::: Word32)
-> ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV)
-> PipelineViewportShadingRateImageStateCreateInfoNV
PipelineViewportShadingRateImageStateCreateInfoNV
           Bool
forall a. Zero a => a
zero
           "firstViewport" ::: Word32
forall a. Zero a => a
zero
           "shadingRatePalettes" ::: Vector ShadingRatePaletteNV
forall a. Monoid a => a
mempty


-- | VkPhysicalDeviceShadingRateImageFeaturesNV - Structure describing
-- shading rate image features that can be supported by an implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceShadingRateImageFeaturesNV' structure
-- describe the following features:
--
-- = Description
--
-- See
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-shading-rate-image Shading Rate Image>
-- for more information.
--
-- If the 'PhysicalDeviceShadingRateImageFeaturesNV' structure is included
-- in the @pNext@ chain of
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
-- it is filled with values indicating whether the feature is supported.
-- 'PhysicalDeviceShadingRateImageFeaturesNV' /can/ also be included in the
-- @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to enable
-- features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.BaseType.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceShadingRateImageFeaturesNV = PhysicalDeviceShadingRateImageFeaturesNV
  { -- | @shadingRateImage@ indicates that the implementation supports the use of
    -- a shading rate image to derive an effective shading rate for fragment
    -- processing. It also indicates that the implementation supports the
    -- @ShadingRateNV@ SPIR-V execution mode.
    PhysicalDeviceShadingRateImageFeaturesNV -> Bool
shadingRateImage :: Bool
  , -- | @shadingRateCoarseSampleOrder@ indicates that the implementation
    -- supports a user-configurable ordering of coverage samples in fragments
    -- larger than one pixel.
    PhysicalDeviceShadingRateImageFeaturesNV -> Bool
shadingRateCoarseSampleOrder :: Bool
  }
  deriving (Typeable)
deriving instance Show PhysicalDeviceShadingRateImageFeaturesNV

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

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

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

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


-- | VkPhysicalDeviceShadingRateImagePropertiesNV - Structure describing
-- shading rate image limits that can be supported by an implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceShadingRateImagePropertiesNV'
-- structure describe the following implementation-dependent properties
-- related to the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-shading-rate-image shading rate image>
-- feature:
--
-- = Description
--
-- If the 'PhysicalDeviceShadingRateImagePropertiesNV' structure is
-- included in the @pNext@ chain of
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2',
-- it is filled with the implementation-dependent limits.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.SharedTypes.Extent2D',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceShadingRateImagePropertiesNV = PhysicalDeviceShadingRateImagePropertiesNV
  { -- | @shadingRateTexelSize@ indicates the width and height of the portion of
    -- the framebuffer corresponding to each texel in the shading rate image.
    PhysicalDeviceShadingRateImagePropertiesNV -> Extent2D
shadingRateTexelSize :: Extent2D
  , -- | @shadingRatePaletteSize@ indicates the maximum number of palette entries
    -- supported for the shading rate image.
    PhysicalDeviceShadingRateImagePropertiesNV
-> "firstViewport" ::: Word32
shadingRatePaletteSize :: Word32
  , -- | @shadingRateMaxCoarseSamples@ specifies the maximum number of coverage
    -- samples supported in a single fragment. If the product of the fragment
    -- size derived from the base shading rate and the number of coverage
    -- samples per pixel exceeds this limit, the final shading rate will be
    -- adjusted so that its product does not exceed the limit.
    PhysicalDeviceShadingRateImagePropertiesNV
-> "firstViewport" ::: Word32
shadingRateMaxCoarseSamples :: Word32
  }
  deriving (Typeable)
deriving instance Show PhysicalDeviceShadingRateImagePropertiesNV

instance ToCStruct PhysicalDeviceShadingRateImagePropertiesNV where
  withCStruct :: PhysicalDeviceShadingRateImagePropertiesNV
-> (Ptr PhysicalDeviceShadingRateImagePropertiesNV -> IO b) -> IO b
withCStruct x :: PhysicalDeviceShadingRateImagePropertiesNV
x f :: Ptr PhysicalDeviceShadingRateImagePropertiesNV -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceShadingRateImagePropertiesNV -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr PhysicalDeviceShadingRateImagePropertiesNV -> IO b) -> IO b)
-> (Ptr PhysicalDeviceShadingRateImagePropertiesNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceShadingRateImagePropertiesNV
p -> Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> PhysicalDeviceShadingRateImagePropertiesNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShadingRateImagePropertiesNV
p PhysicalDeviceShadingRateImagePropertiesNV
x (Ptr PhysicalDeviceShadingRateImagePropertiesNV -> IO b
f Ptr PhysicalDeviceShadingRateImagePropertiesNV
p)
  pokeCStruct :: Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> PhysicalDeviceShadingRateImagePropertiesNV -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceShadingRateImagePropertiesNV
p PhysicalDeviceShadingRateImagePropertiesNV{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Extent2D -> Extent2D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) (Extent2D
shadingRateTexelSize) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) ("firstViewport" ::: Word32
shadingRatePaletteSize)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) ("firstViewport" ::: Word32
shadingRateMaxCoarseSamples)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDeviceShadingRateImagePropertiesNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceShadingRateImagePropertiesNV
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Extent2D -> Extent2D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) (Extent2D
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) ("firstViewport" ::: Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) ("firstViewport" ::: Word32
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct PhysicalDeviceShadingRateImagePropertiesNV where
  peekCStruct :: Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> IO PhysicalDeviceShadingRateImagePropertiesNV
peekCStruct p :: Ptr PhysicalDeviceShadingRateImagePropertiesNV
p = do
    Extent2D
shadingRateTexelSize <- Ptr Extent2D -> IO Extent2D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D))
    "firstViewport" ::: Word32
shadingRatePaletteSize <- Ptr ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32))
    "firstViewport" ::: Word32
shadingRateMaxCoarseSamples <- Ptr ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32))
    PhysicalDeviceShadingRateImagePropertiesNV
-> IO PhysicalDeviceShadingRateImagePropertiesNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceShadingRateImagePropertiesNV
 -> IO PhysicalDeviceShadingRateImagePropertiesNV)
-> PhysicalDeviceShadingRateImagePropertiesNV
-> IO PhysicalDeviceShadingRateImagePropertiesNV
forall a b. (a -> b) -> a -> b
$ Extent2D
-> ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32)
-> PhysicalDeviceShadingRateImagePropertiesNV
PhysicalDeviceShadingRateImagePropertiesNV
             Extent2D
shadingRateTexelSize "firstViewport" ::: Word32
shadingRatePaletteSize "firstViewport" ::: Word32
shadingRateMaxCoarseSamples

instance Zero PhysicalDeviceShadingRateImagePropertiesNV where
  zero :: PhysicalDeviceShadingRateImagePropertiesNV
zero = Extent2D
-> ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32)
-> PhysicalDeviceShadingRateImagePropertiesNV
PhysicalDeviceShadingRateImagePropertiesNV
           Extent2D
forall a. Zero a => a
zero
           "firstViewport" ::: Word32
forall a. Zero a => a
zero
           "firstViewport" ::: Word32
forall a. Zero a => a
zero


-- | VkCoarseSampleLocationNV - Structure specifying parameters controlling
-- shading rate image usage
--
-- == Valid Usage
--
-- = See Also
--
-- 'CoarseSampleOrderCustomNV'
data CoarseSampleLocationNV = CoarseSampleLocationNV
  { -- | @pixelX@ /must/ be less than the width (in pixels) of the fragment
    CoarseSampleLocationNV -> "firstViewport" ::: Word32
pixelX :: Word32
  , -- | @pixelY@ /must/ be less than the height (in pixels) of the fragment
    CoarseSampleLocationNV -> "firstViewport" ::: Word32
pixelY :: Word32
  , -- | @sample@ /must/ be less than the number of coverage samples in each
    -- pixel belonging to the fragment
    CoarseSampleLocationNV -> "firstViewport" ::: Word32
sample :: Word32
  }
  deriving (Typeable)
deriving instance Show CoarseSampleLocationNV

instance ToCStruct CoarseSampleLocationNV where
  withCStruct :: CoarseSampleLocationNV
-> (Ptr CoarseSampleLocationNV -> IO b) -> IO b
withCStruct x :: CoarseSampleLocationNV
x f :: Ptr CoarseSampleLocationNV -> IO b
f = Int -> Int -> (Ptr CoarseSampleLocationNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 12 4 ((Ptr CoarseSampleLocationNV -> IO b) -> IO b)
-> (Ptr CoarseSampleLocationNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr CoarseSampleLocationNV
p -> Ptr CoarseSampleLocationNV
-> CoarseSampleLocationNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CoarseSampleLocationNV
p CoarseSampleLocationNV
x (Ptr CoarseSampleLocationNV -> IO b
f Ptr CoarseSampleLocationNV
p)
  pokeCStruct :: Ptr CoarseSampleLocationNV
-> CoarseSampleLocationNV -> IO b -> IO b
pokeCStruct p :: Ptr CoarseSampleLocationNV
p CoarseSampleLocationNV{..} f :: IO b
f = do
    Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CoarseSampleLocationNV
p Ptr CoarseSampleLocationNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) ("firstViewport" ::: Word32
pixelX)
    Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CoarseSampleLocationNV
p Ptr CoarseSampleLocationNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) ("firstViewport" ::: Word32
pixelY)
    Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CoarseSampleLocationNV
p Ptr CoarseSampleLocationNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) ("firstViewport" ::: Word32
sample)
    IO b
f
  cStructSize :: Int
cStructSize = 12
  cStructAlignment :: Int
cStructAlignment = 4
  pokeZeroCStruct :: Ptr CoarseSampleLocationNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr CoarseSampleLocationNV
p f :: IO b
f = do
    Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CoarseSampleLocationNV
p Ptr CoarseSampleLocationNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) ("firstViewport" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CoarseSampleLocationNV
p Ptr CoarseSampleLocationNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) ("firstViewport" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CoarseSampleLocationNV
p Ptr CoarseSampleLocationNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) ("firstViewport" ::: Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct CoarseSampleLocationNV where
  peekCStruct :: Ptr CoarseSampleLocationNV -> IO CoarseSampleLocationNV
peekCStruct p :: Ptr CoarseSampleLocationNV
p = do
    "firstViewport" ::: Word32
pixelX <- Ptr ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr CoarseSampleLocationNV
p Ptr CoarseSampleLocationNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32))
    "firstViewport" ::: Word32
pixelY <- Ptr ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr CoarseSampleLocationNV
p Ptr CoarseSampleLocationNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32))
    "firstViewport" ::: Word32
sample <- Ptr ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr CoarseSampleLocationNV
p Ptr CoarseSampleLocationNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32))
    CoarseSampleLocationNV -> IO CoarseSampleLocationNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CoarseSampleLocationNV -> IO CoarseSampleLocationNV)
-> CoarseSampleLocationNV -> IO CoarseSampleLocationNV
forall a b. (a -> b) -> a -> b
$ ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32)
-> CoarseSampleLocationNV
CoarseSampleLocationNV
             "firstViewport" ::: Word32
pixelX "firstViewport" ::: Word32
pixelY "firstViewport" ::: Word32
sample

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

instance Zero CoarseSampleLocationNV where
  zero :: CoarseSampleLocationNV
zero = ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32)
-> CoarseSampleLocationNV
CoarseSampleLocationNV
           "firstViewport" ::: Word32
forall a. Zero a => a
zero
           "firstViewport" ::: Word32
forall a. Zero a => a
zero
           "firstViewport" ::: Word32
forall a. Zero a => a
zero


-- | VkCoarseSampleOrderCustomNV - Structure specifying parameters
-- controlling shading rate image usage
--
-- = Description
--
-- When using a custom sample ordering, element /j/ in @pSampleLocations@
-- specifies a specific pixel location and
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-multisampling-coverage-mask sample index>
-- that corresponds to
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-multisampling-coverage-mask coverage index>
-- /j/ in the multi-pixel fragment.
--
-- == Valid Usage
--
-- -   @shadingRate@ /must/ be a shading rate that generates fragments with
--     more than one pixel
--
-- -   @sampleCount@ /must/ correspond to a sample count enumerated in
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SampleCountFlags' whose
--     corresponding bit is set in
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@framebufferNoAttachmentsSampleCounts@
--
-- -   @sampleLocationCount@ /must/ be equal to the product of
--     @sampleCount@, the fragment width for @shadingRate@, and the
--     fragment height for @shadingRate@
--
-- -   @sampleLocationCount@ /must/ be less than or equal to the value of
--     'PhysicalDeviceShadingRateImagePropertiesNV'::@shadingRateMaxCoarseSamples@
--
-- -   The array @pSampleLocations@ /must/ contain exactly one entry for
--     every combination of valid values for @pixelX@, @pixelY@, and
--     @sample@ in the structure 'CoarseSampleOrderCustomNV'
--
-- == Valid Usage (Implicit)
--
-- -   @shadingRate@ /must/ be a valid 'ShadingRatePaletteEntryNV' value
--
-- -   @pSampleLocations@ /must/ be a valid pointer to an array of
--     @sampleLocationCount@ 'CoarseSampleLocationNV' structures
--
-- -   @sampleLocationCount@ /must/ be greater than @0@
--
-- = See Also
--
-- 'CoarseSampleLocationNV',
-- 'PipelineViewportCoarseSampleOrderStateCreateInfoNV',
-- 'ShadingRatePaletteEntryNV', 'cmdSetCoarseSampleOrderNV'
data CoarseSampleOrderCustomNV = CoarseSampleOrderCustomNV
  { -- | @shadingRate@ is a shading rate palette entry that identifies the
    -- fragment width and height for the combination of fragment area and
    -- per-pixel coverage sample count to control.
    CoarseSampleOrderCustomNV -> ShadingRatePaletteEntryNV
shadingRate :: ShadingRatePaletteEntryNV
  , -- | @sampleCount@ identifies the per-pixel coverage sample count for the
    -- combination of fragment area and coverage sample count to control.
    CoarseSampleOrderCustomNV -> "firstViewport" ::: Word32
sampleCount :: Word32
  , -- | @pSampleLocations@ is a pointer to an array of
    -- 'CoarseSampleOrderCustomNV' structures specifying the location of each
    -- sample in the custom ordering.
    CoarseSampleOrderCustomNV -> Vector CoarseSampleLocationNV
sampleLocations :: Vector CoarseSampleLocationNV
  }
  deriving (Typeable)
deriving instance Show CoarseSampleOrderCustomNV

instance ToCStruct CoarseSampleOrderCustomNV where
  withCStruct :: CoarseSampleOrderCustomNV
-> (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
    -> IO b)
-> IO b
withCStruct x :: CoarseSampleOrderCustomNV
x f :: ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV) -> IO b
f = Int
-> Int
-> (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
  -> IO b)
 -> IO b)
-> (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p -> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> CoarseSampleOrderCustomNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p CoarseSampleOrderCustomNV
x (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV) -> IO b
f "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p)
  pokeCStruct :: ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> CoarseSampleOrderCustomNV -> IO b -> IO b
pokeCStruct p :: "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p CoarseSampleOrderCustomNV{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> Ptr ShadingRatePaletteEntryNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr ShadingRatePaletteEntryNV)) (ShadingRatePaletteEntryNV
shadingRate)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) ("firstViewport" ::: Word32
sampleCount)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) ((Int -> "firstViewport" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector CoarseSampleLocationNV -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector CoarseSampleLocationNV -> Int)
-> Vector CoarseSampleLocationNV -> Int
forall a b. (a -> b) -> a -> b
$ (Vector CoarseSampleLocationNV
sampleLocations)) :: Word32))
    Ptr CoarseSampleLocationNV
pPSampleLocations' <- ((Ptr CoarseSampleLocationNV -> IO b) -> IO b)
-> ContT b IO (Ptr CoarseSampleLocationNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CoarseSampleLocationNV -> IO b) -> IO b)
 -> ContT b IO (Ptr CoarseSampleLocationNV))
-> ((Ptr CoarseSampleLocationNV -> IO b) -> IO b)
-> ContT b IO (Ptr CoarseSampleLocationNV)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr CoarseSampleLocationNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @CoarseSampleLocationNV ((Vector CoarseSampleLocationNV -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector CoarseSampleLocationNV
sampleLocations)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 12) 4
    (Int -> CoarseSampleLocationNV -> ContT b IO ())
-> Vector CoarseSampleLocationNV -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: CoarseSampleLocationNV
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CoarseSampleLocationNV
-> CoarseSampleLocationNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr CoarseSampleLocationNV
pPSampleLocations' Ptr CoarseSampleLocationNV -> Int -> Ptr CoarseSampleLocationNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (12 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr CoarseSampleLocationNV) (CoarseSampleLocationNV
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector CoarseSampleLocationNV
sampleLocations)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr CoarseSampleLocationNV)
-> Ptr CoarseSampleLocationNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> Ptr (Ptr CoarseSampleLocationNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr CoarseSampleLocationNV))) (Ptr CoarseSampleLocationNV
pPSampleLocations')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> IO b -> IO b
pokeZeroCStruct p :: "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> Ptr ShadingRatePaletteEntryNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr ShadingRatePaletteEntryNV)) (ShadingRatePaletteEntryNV
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) ("firstViewport" ::: Word32
forall a. Zero a => a
zero)
    Ptr CoarseSampleLocationNV
pPSampleLocations' <- ((Ptr CoarseSampleLocationNV -> IO b) -> IO b)
-> ContT b IO (Ptr CoarseSampleLocationNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CoarseSampleLocationNV -> IO b) -> IO b)
 -> ContT b IO (Ptr CoarseSampleLocationNV))
-> ((Ptr CoarseSampleLocationNV -> IO b) -> IO b)
-> ContT b IO (Ptr CoarseSampleLocationNV)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr CoarseSampleLocationNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @CoarseSampleLocationNV ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 12) 4
    (Int -> CoarseSampleLocationNV -> ContT b IO ())
-> Vector CoarseSampleLocationNV -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: CoarseSampleLocationNV
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CoarseSampleLocationNV
-> CoarseSampleLocationNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr CoarseSampleLocationNV
pPSampleLocations' Ptr CoarseSampleLocationNV -> Int -> Ptr CoarseSampleLocationNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (12 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr CoarseSampleLocationNV) (CoarseSampleLocationNV
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector CoarseSampleLocationNV
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr CoarseSampleLocationNV)
-> Ptr CoarseSampleLocationNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> Ptr (Ptr CoarseSampleLocationNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr CoarseSampleLocationNV))) (Ptr CoarseSampleLocationNV
pPSampleLocations')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct CoarseSampleOrderCustomNV where
  peekCStruct :: ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> IO CoarseSampleOrderCustomNV
peekCStruct p :: "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p = do
    ShadingRatePaletteEntryNV
shadingRate <- Ptr ShadingRatePaletteEntryNV -> IO ShadingRatePaletteEntryNV
forall a. Storable a => Ptr a -> IO a
peek @ShadingRatePaletteEntryNV (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> Ptr ShadingRatePaletteEntryNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr ShadingRatePaletteEntryNV))
    "firstViewport" ::: Word32
sampleCount <- Ptr ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32))
    "firstViewport" ::: Word32
sampleLocationCount <- Ptr ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32))
    Ptr CoarseSampleLocationNV
pSampleLocations <- Ptr (Ptr CoarseSampleLocationNV) -> IO (Ptr CoarseSampleLocationNV)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr CoarseSampleLocationNV) (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> Ptr (Ptr CoarseSampleLocationNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr CoarseSampleLocationNV)))
    Vector CoarseSampleLocationNV
pSampleLocations' <- Int
-> (Int -> IO CoarseSampleLocationNV)
-> IO (Vector CoarseSampleLocationNV)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("firstViewport" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "firstViewport" ::: Word32
sampleLocationCount) (\i :: Int
i -> Ptr CoarseSampleLocationNV -> IO CoarseSampleLocationNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @CoarseSampleLocationNV ((Ptr CoarseSampleLocationNV
pSampleLocations Ptr CoarseSampleLocationNV -> Int -> Ptr CoarseSampleLocationNV
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (12 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr CoarseSampleLocationNV)))
    CoarseSampleOrderCustomNV -> IO CoarseSampleOrderCustomNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CoarseSampleOrderCustomNV -> IO CoarseSampleOrderCustomNV)
-> CoarseSampleOrderCustomNV -> IO CoarseSampleOrderCustomNV
forall a b. (a -> b) -> a -> b
$ ShadingRatePaletteEntryNV
-> ("firstViewport" ::: Word32)
-> Vector CoarseSampleLocationNV
-> CoarseSampleOrderCustomNV
CoarseSampleOrderCustomNV
             ShadingRatePaletteEntryNV
shadingRate "firstViewport" ::: Word32
sampleCount Vector CoarseSampleLocationNV
pSampleLocations'

instance Zero CoarseSampleOrderCustomNV where
  zero :: CoarseSampleOrderCustomNV
zero = ShadingRatePaletteEntryNV
-> ("firstViewport" ::: Word32)
-> Vector CoarseSampleLocationNV
-> CoarseSampleOrderCustomNV
CoarseSampleOrderCustomNV
           ShadingRatePaletteEntryNV
forall a. Zero a => a
zero
           "firstViewport" ::: Word32
forall a. Zero a => a
zero
           Vector CoarseSampleLocationNV
forall a. Monoid a => a
mempty


-- | VkPipelineViewportCoarseSampleOrderStateCreateInfoNV - Structure
-- specifying parameters controlling sample order in coarse fragments
--
-- = Description
--
-- If this structure is not present, @sampleOrderType@ is considered to be
-- 'COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV'.
--
-- If @sampleOrderType@ is 'COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV', the
-- coverage sample order used for any combination of fragment area and
-- coverage sample count not enumerated in @pCustomSampleOrders@ will be
-- identical to that used for 'COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV'.
--
-- If the pipeline was created with
-- 'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV',
-- the contents of this structure (if present) are ignored, and the
-- coverage sample order is instead specified by
-- 'cmdSetCoarseSampleOrderNV'.
--
-- == Valid Usage
--
-- -   If @sampleOrderType@ is not 'COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV',
--     @customSamplerOrderCount@ /must/ be @0@
--
-- -   The array @pCustomSampleOrders@ /must/ not contain two structures
--     with matching values for both the @shadingRate@ and @sampleCount@
--     members
--
-- == Valid Usage (Implicit)
--
-- -   @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV'
--
-- -   @sampleOrderType@ /must/ be a valid 'CoarseSampleOrderTypeNV' value
--
-- -   If @customSampleOrderCount@ is not @0@, @pCustomSampleOrders@ /must/
--     be a valid pointer to an array of @customSampleOrderCount@ valid
--     'CoarseSampleOrderCustomNV' structures
--
-- = See Also
--
-- 'CoarseSampleOrderCustomNV', 'CoarseSampleOrderTypeNV',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PipelineViewportCoarseSampleOrderStateCreateInfoNV = PipelineViewportCoarseSampleOrderStateCreateInfoNV
  { -- | @sampleOrderType@ specifies the mechanism used to order coverage samples
    -- in fragments larger than one pixel.
    PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> CoarseSampleOrderTypeNV
sampleOrderType :: CoarseSampleOrderTypeNV
  , -- | @pCustomSampleOrders@ is a pointer to an array of
    -- @customSampleOrderCount@ 'CoarseSampleOrderCustomNV' structures, each of
    -- which specifies the coverage sample order for a single combination of
    -- fragment area and coverage sample count.
    PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> "customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders :: Vector CoarseSampleOrderCustomNV
  }
  deriving (Typeable)
deriving instance Show PipelineViewportCoarseSampleOrderStateCreateInfoNV

instance ToCStruct PipelineViewportCoarseSampleOrderStateCreateInfoNV where
  withCStruct :: PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> (Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV -> IO b)
-> IO b
withCStruct x :: PipelineViewportCoarseSampleOrderStateCreateInfoNV
x f :: Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV -> IO b
f = Int
-> Int
-> (Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV -> IO b)
 -> IO b)
-> (Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p -> Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p PipelineViewportCoarseSampleOrderStateCreateInfoNV
x (Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV -> IO b
f Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p)
  pokeCStruct :: Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> IO b
-> IO b
pokeCStruct p :: Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p PipelineViewportCoarseSampleOrderStateCreateInfoNV{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int -> Ptr CoarseSampleOrderTypeNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CoarseSampleOrderTypeNV)) (CoarseSampleOrderTypeNV
sampleOrderType)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ((Int -> "firstViewport" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV) -> Int
forall a. Vector a -> Int
Data.Vector.length (("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
 -> Int)
-> ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
-> Int
forall a b. (a -> b) -> a -> b
$ ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders)) :: Word32))
    "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pPCustomSampleOrders' <- ((("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
  -> IO b)
 -> IO b)
-> ContT
     b IO ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
   -> IO b)
  -> IO b)
 -> ContT
      b IO ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV))
-> ((("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
     -> IO b)
    -> IO b)
-> ContT
     b IO ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @CoarseSampleOrderCustomNV ((("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV) -> Int
forall a. Vector a -> Int
Data.Vector.length ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 24) 8
    (Int -> CoarseSampleOrderCustomNV -> ContT b IO ())
-> ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
-> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: CoarseSampleOrderCustomNV
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> CoarseSampleOrderCustomNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pPCustomSampleOrders' ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (24 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr CoarseSampleOrderCustomNV) (CoarseSampleOrderCustomNV
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int
-> Ptr ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr CoarseSampleOrderCustomNV))) ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pPCustomSampleOrders')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> IO b -> IO b
pokeZeroCStruct p :: Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int -> Ptr CoarseSampleOrderTypeNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CoarseSampleOrderTypeNV)) (CoarseSampleOrderTypeNV
forall a. Zero a => a
zero)
    "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pPCustomSampleOrders' <- ((("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
  -> IO b)
 -> IO b)
-> ContT
     b IO ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
   -> IO b)
  -> IO b)
 -> ContT
      b IO ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV))
-> ((("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
     -> IO b)
    -> IO b)
-> ContT
     b IO ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @CoarseSampleOrderCustomNV ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 24) 8
    (Int -> CoarseSampleOrderCustomNV -> ContT b IO ())
-> ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
-> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: CoarseSampleOrderCustomNV
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> CoarseSampleOrderCustomNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pPCustomSampleOrders' ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (24 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr CoarseSampleOrderCustomNV) (CoarseSampleOrderCustomNV
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int
-> Ptr ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr CoarseSampleOrderCustomNV))) ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pPCustomSampleOrders')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct PipelineViewportCoarseSampleOrderStateCreateInfoNV where
  peekCStruct :: Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> IO PipelineViewportCoarseSampleOrderStateCreateInfoNV
peekCStruct p :: Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p = do
    CoarseSampleOrderTypeNV
sampleOrderType <- Ptr CoarseSampleOrderTypeNV -> IO CoarseSampleOrderTypeNV
forall a. Storable a => Ptr a -> IO a
peek @CoarseSampleOrderTypeNV ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int -> Ptr CoarseSampleOrderTypeNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CoarseSampleOrderTypeNV))
    "firstViewport" ::: Word32
customSampleOrderCount <- Ptr ("firstViewport" ::: Word32) -> IO ("firstViewport" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int -> Ptr ("firstViewport" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
    "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pCustomSampleOrders <- Ptr ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> IO ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr CoarseSampleOrderCustomNV) ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> Int
-> Ptr ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr CoarseSampleOrderCustomNV)))
    "customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
pCustomSampleOrders' <- Int
-> (Int -> IO CoarseSampleOrderCustomNV)
-> IO ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("firstViewport" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "firstViewport" ::: Word32
customSampleOrderCount) (\i :: Int
i -> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> IO CoarseSampleOrderCustomNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @CoarseSampleOrderCustomNV (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pCustomSampleOrders ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> Int -> "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (24 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr CoarseSampleOrderCustomNV)))
    PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> IO PipelineViewportCoarseSampleOrderStateCreateInfoNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineViewportCoarseSampleOrderStateCreateInfoNV
 -> IO PipelineViewportCoarseSampleOrderStateCreateInfoNV)
-> PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> IO PipelineViewportCoarseSampleOrderStateCreateInfoNV
forall a b. (a -> b) -> a -> b
$ CoarseSampleOrderTypeNV
-> ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
-> PipelineViewportCoarseSampleOrderStateCreateInfoNV
PipelineViewportCoarseSampleOrderStateCreateInfoNV
             CoarseSampleOrderTypeNV
sampleOrderType "customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
pCustomSampleOrders'

instance Zero PipelineViewportCoarseSampleOrderStateCreateInfoNV where
  zero :: PipelineViewportCoarseSampleOrderStateCreateInfoNV
zero = CoarseSampleOrderTypeNV
-> ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
-> PipelineViewportCoarseSampleOrderStateCreateInfoNV
PipelineViewportCoarseSampleOrderStateCreateInfoNV
           CoarseSampleOrderTypeNV
forall a. Zero a => a
zero
           "customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
forall a. Monoid a => a
mempty


-- | VkShadingRatePaletteEntryNV - Shading rate image palette entry types
--
-- = Description
--
-- The following table indicates the width and height (in pixels) of each
-- fragment generated using the indicated shading rate, as well as the
-- maximum number of fragment shader invocations launched for each
-- fragment. When processing regions of a primitive that have a shading
-- rate of 'SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV', no fragments
-- will be generated in that region.
--
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | Shading Rate                                                | Width           | Height          | Invocations     |
-- +=============================================================+=================+=================+=================+
-- | 'SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV'              | 0               | 0               | 0               |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | 'SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV'    | 1               | 1               | 16              |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | 'SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV'     | 1               | 1               | 8               |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | 'SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV'     | 1               | 1               | 4               |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | 'SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV'     | 1               | 1               | 2               |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | 'SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV'      | 1               | 1               | 1               |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | 'SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV' | 2               | 1               | 1               |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | 'SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV' | 1               | 2               | 1               |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | 'SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV' | 2               | 2               | 1               |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | 'SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV' | 4               | 2               | 1               |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | 'SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV' | 2               | 4               | 1               |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
-- | 'SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV' | 4               | 4               | 1               |
-- +-------------------------------------------------------------+-----------------+-----------------+-----------------+
--
-- = See Also
--
-- 'CoarseSampleOrderCustomNV', 'ShadingRatePaletteNV'
newtype ShadingRatePaletteEntryNV = ShadingRatePaletteEntryNV Int32
  deriving newtype (ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
(ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool)
-> (ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool)
-> Eq ShadingRatePaletteEntryNV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
$c/= :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
== :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
$c== :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
Eq, Eq ShadingRatePaletteEntryNV
Eq ShadingRatePaletteEntryNV =>
(ShadingRatePaletteEntryNV
 -> ShadingRatePaletteEntryNV -> Ordering)
-> (ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool)
-> (ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool)
-> (ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool)
-> (ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool)
-> (ShadingRatePaletteEntryNV
    -> ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV)
-> (ShadingRatePaletteEntryNV
    -> ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV)
-> Ord ShadingRatePaletteEntryNV
ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Ordering
ShadingRatePaletteEntryNV
-> ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ShadingRatePaletteEntryNV
-> ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV
$cmin :: ShadingRatePaletteEntryNV
-> ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV
max :: ShadingRatePaletteEntryNV
-> ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV
$cmax :: ShadingRatePaletteEntryNV
-> ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV
>= :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
$c>= :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
> :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
$c> :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
<= :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
$c<= :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
< :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
$c< :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
compare :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Ordering
$ccompare :: ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Ordering
$cp1Ord :: Eq ShadingRatePaletteEntryNV
Ord, Ptr b -> Int -> IO ShadingRatePaletteEntryNV
Ptr b -> Int -> ShadingRatePaletteEntryNV -> IO ()
Ptr ShadingRatePaletteEntryNV -> IO ShadingRatePaletteEntryNV
Ptr ShadingRatePaletteEntryNV
-> Int -> IO ShadingRatePaletteEntryNV
Ptr ShadingRatePaletteEntryNV
-> Int -> ShadingRatePaletteEntryNV -> IO ()
Ptr ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> IO ()
ShadingRatePaletteEntryNV -> Int
(ShadingRatePaletteEntryNV -> Int)
-> (ShadingRatePaletteEntryNV -> Int)
-> (Ptr ShadingRatePaletteEntryNV
    -> Int -> IO ShadingRatePaletteEntryNV)
-> (Ptr ShadingRatePaletteEntryNV
    -> Int -> ShadingRatePaletteEntryNV -> IO ())
-> (forall b. Ptr b -> Int -> IO ShadingRatePaletteEntryNV)
-> (forall b. Ptr b -> Int -> ShadingRatePaletteEntryNV -> IO ())
-> (Ptr ShadingRatePaletteEntryNV -> IO ShadingRatePaletteEntryNV)
-> (Ptr ShadingRatePaletteEntryNV
    -> ShadingRatePaletteEntryNV -> IO ())
-> Storable ShadingRatePaletteEntryNV
forall b. Ptr b -> Int -> IO ShadingRatePaletteEntryNV
forall b. Ptr b -> Int -> ShadingRatePaletteEntryNV -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> IO ()
$cpoke :: Ptr ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> IO ()
peek :: Ptr ShadingRatePaletteEntryNV -> IO ShadingRatePaletteEntryNV
$cpeek :: Ptr ShadingRatePaletteEntryNV -> IO ShadingRatePaletteEntryNV
pokeByteOff :: Ptr b -> Int -> ShadingRatePaletteEntryNV -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> ShadingRatePaletteEntryNV -> IO ()
peekByteOff :: Ptr b -> Int -> IO ShadingRatePaletteEntryNV
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ShadingRatePaletteEntryNV
pokeElemOff :: Ptr ShadingRatePaletteEntryNV
-> Int -> ShadingRatePaletteEntryNV -> IO ()
$cpokeElemOff :: Ptr ShadingRatePaletteEntryNV
-> Int -> ShadingRatePaletteEntryNV -> IO ()
peekElemOff :: Ptr ShadingRatePaletteEntryNV
-> Int -> IO ShadingRatePaletteEntryNV
$cpeekElemOff :: Ptr ShadingRatePaletteEntryNV
-> Int -> IO ShadingRatePaletteEntryNV
alignment :: ShadingRatePaletteEntryNV -> Int
$calignment :: ShadingRatePaletteEntryNV -> Int
sizeOf :: ShadingRatePaletteEntryNV -> Int
$csizeOf :: ShadingRatePaletteEntryNV -> Int
Storable, ShadingRatePaletteEntryNV
ShadingRatePaletteEntryNV -> Zero ShadingRatePaletteEntryNV
forall a. a -> Zero a
zero :: ShadingRatePaletteEntryNV
$czero :: ShadingRatePaletteEntryNV
Zero)

-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV = ShadingRatePaletteEntryNV 0
-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV = ShadingRatePaletteEntryNV 1
-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV = ShadingRatePaletteEntryNV 2
-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV = ShadingRatePaletteEntryNV 3
-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV = ShadingRatePaletteEntryNV 4
-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV = ShadingRatePaletteEntryNV 5
-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV = ShadingRatePaletteEntryNV 6
-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV = ShadingRatePaletteEntryNV 7
-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV = ShadingRatePaletteEntryNV 8
-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV = ShadingRatePaletteEntryNV 9
-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV = ShadingRatePaletteEntryNV 10
-- No documentation found for Nested "VkShadingRatePaletteEntryNV" "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV"
pattern $bSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV :: ShadingRatePaletteEntryNV
$mSHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV :: forall r.
ShadingRatePaletteEntryNV -> (Void# -> r) -> (Void# -> r) -> r
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV = ShadingRatePaletteEntryNV 11
{-# complete SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV,
             SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV,
             SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV,
             SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV,
             SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV,
             SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV,
             SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV,
             SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV,
             SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV,
             SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV,
             SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV,
             SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV :: ShadingRatePaletteEntryNV #-}

instance Show ShadingRatePaletteEntryNV where
  showsPrec :: Int -> ShadingRatePaletteEntryNV -> ShowS
showsPrec p :: Int
p = \case
    SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV"
    SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV"
    SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV"
    SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV"
    SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV"
    SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV"
    SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV"
    SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV"
    SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV"
    SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV"
    SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV"
    SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV -> String -> ShowS
showString "SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV"
    ShadingRatePaletteEntryNV x :: Int32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "ShadingRatePaletteEntryNV " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11 Int32
x)

instance Read ShadingRatePaletteEntryNV where
  readPrec :: ReadPrec ShadingRatePaletteEntryNV
readPrec = ReadPrec ShadingRatePaletteEntryNV
-> ReadPrec ShadingRatePaletteEntryNV
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec ShadingRatePaletteEntryNV)]
-> ReadPrec ShadingRatePaletteEntryNV
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV)
                            , ("SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV)
                            , ("SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV)
                            , ("SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV)
                            , ("SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV)
                            , ("SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV)
                            , ("SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV)
                            , ("SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV)
                            , ("SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV)
                            , ("SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV)
                            , ("SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV)
                            , ("SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV", ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV)]
                     ReadPrec ShadingRatePaletteEntryNV
-> ReadPrec ShadingRatePaletteEntryNV
-> ReadPrec ShadingRatePaletteEntryNV
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int
-> ReadPrec ShadingRatePaletteEntryNV
-> ReadPrec ShadingRatePaletteEntryNV
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "ShadingRatePaletteEntryNV")
                       Int32
v <- ReadPrec Int32 -> ReadPrec Int32
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Int32
forall a. Read a => ReadPrec a
readPrec
                       ShadingRatePaletteEntryNV -> ReadPrec ShadingRatePaletteEntryNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int32 -> ShadingRatePaletteEntryNV
ShadingRatePaletteEntryNV Int32
v)))


-- | VkCoarseSampleOrderTypeNV - Shading rate image sample ordering types
--
-- = See Also
--
-- 'PipelineViewportCoarseSampleOrderStateCreateInfoNV',
-- 'cmdSetCoarseSampleOrderNV'
newtype CoarseSampleOrderTypeNV = CoarseSampleOrderTypeNV Int32
  deriving newtype (CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
(CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool)
-> (CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool)
-> Eq CoarseSampleOrderTypeNV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
$c/= :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
== :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
$c== :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
Eq, Eq CoarseSampleOrderTypeNV
Eq CoarseSampleOrderTypeNV =>
(CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Ordering)
-> (CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool)
-> (CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool)
-> (CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool)
-> (CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool)
-> (CoarseSampleOrderTypeNV
    -> CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV)
-> (CoarseSampleOrderTypeNV
    -> CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV)
-> Ord CoarseSampleOrderTypeNV
CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Ordering
CoarseSampleOrderTypeNV
-> CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: CoarseSampleOrderTypeNV
-> CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV
$cmin :: CoarseSampleOrderTypeNV
-> CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV
max :: CoarseSampleOrderTypeNV
-> CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV
$cmax :: CoarseSampleOrderTypeNV
-> CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV
>= :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
$c>= :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
> :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
$c> :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
<= :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
$c<= :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
< :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
$c< :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
compare :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Ordering
$ccompare :: CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Ordering
$cp1Ord :: Eq CoarseSampleOrderTypeNV
Ord, Ptr b -> Int -> IO CoarseSampleOrderTypeNV
Ptr b -> Int -> CoarseSampleOrderTypeNV -> IO ()
Ptr CoarseSampleOrderTypeNV -> IO CoarseSampleOrderTypeNV
Ptr CoarseSampleOrderTypeNV -> Int -> IO CoarseSampleOrderTypeNV
Ptr CoarseSampleOrderTypeNV
-> Int -> CoarseSampleOrderTypeNV -> IO ()
Ptr CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> IO ()
CoarseSampleOrderTypeNV -> Int
(CoarseSampleOrderTypeNV -> Int)
-> (CoarseSampleOrderTypeNV -> Int)
-> (Ptr CoarseSampleOrderTypeNV
    -> Int -> IO CoarseSampleOrderTypeNV)
-> (Ptr CoarseSampleOrderTypeNV
    -> Int -> CoarseSampleOrderTypeNV -> IO ())
-> (forall b. Ptr b -> Int -> IO CoarseSampleOrderTypeNV)
-> (forall b. Ptr b -> Int -> CoarseSampleOrderTypeNV -> IO ())
-> (Ptr CoarseSampleOrderTypeNV -> IO CoarseSampleOrderTypeNV)
-> (Ptr CoarseSampleOrderTypeNV
    -> CoarseSampleOrderTypeNV -> IO ())
-> Storable CoarseSampleOrderTypeNV
forall b. Ptr b -> Int -> IO CoarseSampleOrderTypeNV
forall b. Ptr b -> Int -> CoarseSampleOrderTypeNV -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> IO ()
$cpoke :: Ptr CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> IO ()
peek :: Ptr CoarseSampleOrderTypeNV -> IO CoarseSampleOrderTypeNV
$cpeek :: Ptr CoarseSampleOrderTypeNV -> IO CoarseSampleOrderTypeNV
pokeByteOff :: Ptr b -> Int -> CoarseSampleOrderTypeNV -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> CoarseSampleOrderTypeNV -> IO ()
peekByteOff :: Ptr b -> Int -> IO CoarseSampleOrderTypeNV
$cpeekByteOff :: forall b. Ptr b -> Int -> IO CoarseSampleOrderTypeNV
pokeElemOff :: Ptr CoarseSampleOrderTypeNV
-> Int -> CoarseSampleOrderTypeNV -> IO ()
$cpokeElemOff :: Ptr CoarseSampleOrderTypeNV
-> Int -> CoarseSampleOrderTypeNV -> IO ()
peekElemOff :: Ptr CoarseSampleOrderTypeNV -> Int -> IO CoarseSampleOrderTypeNV
$cpeekElemOff :: Ptr CoarseSampleOrderTypeNV -> Int -> IO CoarseSampleOrderTypeNV
alignment :: CoarseSampleOrderTypeNV -> Int
$calignment :: CoarseSampleOrderTypeNV -> Int
sizeOf :: CoarseSampleOrderTypeNV -> Int
$csizeOf :: CoarseSampleOrderTypeNV -> Int
Storable, CoarseSampleOrderTypeNV
CoarseSampleOrderTypeNV -> Zero CoarseSampleOrderTypeNV
forall a. a -> Zero a
zero :: CoarseSampleOrderTypeNV
$czero :: CoarseSampleOrderTypeNV
Zero)

-- | 'COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV' specifies that coverage samples
-- will be ordered in an implementation-dependent manner.
pattern $bCOARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV :: CoarseSampleOrderTypeNV
$mCOARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV :: forall r.
CoarseSampleOrderTypeNV -> (Void# -> r) -> (Void# -> r) -> r
COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV = CoarseSampleOrderTypeNV 0
-- | 'COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV' specifies that coverage samples
-- will be ordered according to the array of custom orderings provided in
-- either the @pCustomSampleOrders@ member of
-- 'PipelineViewportCoarseSampleOrderStateCreateInfoNV' or the
-- @pCustomSampleOrders@ member of 'cmdSetCoarseSampleOrderNV'.
pattern $bCOARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV :: CoarseSampleOrderTypeNV
$mCOARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV :: forall r.
CoarseSampleOrderTypeNV -> (Void# -> r) -> (Void# -> r) -> r
COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV = CoarseSampleOrderTypeNV 1
-- | 'COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV' specifies that coverage
-- samples will be ordered sequentially, sorted first by pixel coordinate
-- (in row-major order) and then by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-multisampling-coverage-mask sample index>.
pattern $bCOARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV :: CoarseSampleOrderTypeNV
$mCOARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV :: forall r.
CoarseSampleOrderTypeNV -> (Void# -> r) -> (Void# -> r) -> r
COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV = CoarseSampleOrderTypeNV 2
-- | 'COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV' specifies that coverage
-- samples will be ordered sequentially, sorted first by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-multisampling-coverage-mask sample index>
-- and then by pixel coordinate (in row-major order).
pattern $bCOARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV :: CoarseSampleOrderTypeNV
$mCOARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV :: forall r.
CoarseSampleOrderTypeNV -> (Void# -> r) -> (Void# -> r) -> r
COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV = CoarseSampleOrderTypeNV 3
{-# complete COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV,
             COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV,
             COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV,
             COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV :: CoarseSampleOrderTypeNV #-}

instance Show CoarseSampleOrderTypeNV where
  showsPrec :: Int -> CoarseSampleOrderTypeNV -> ShowS
showsPrec p :: Int
p = \case
    COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV -> String -> ShowS
showString "COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV"
    COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV -> String -> ShowS
showString "COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV"
    COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV -> String -> ShowS
showString "COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV"
    COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV -> String -> ShowS
showString "COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV"
    CoarseSampleOrderTypeNV x :: Int32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "CoarseSampleOrderTypeNV " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11 Int32
x)

instance Read CoarseSampleOrderTypeNV where
  readPrec :: ReadPrec CoarseSampleOrderTypeNV
readPrec = ReadPrec CoarseSampleOrderTypeNV
-> ReadPrec CoarseSampleOrderTypeNV
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec CoarseSampleOrderTypeNV)]
-> ReadPrec CoarseSampleOrderTypeNV
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV", CoarseSampleOrderTypeNV -> ReadPrec CoarseSampleOrderTypeNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure CoarseSampleOrderTypeNV
COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV)
                            , ("COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV", CoarseSampleOrderTypeNV -> ReadPrec CoarseSampleOrderTypeNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure CoarseSampleOrderTypeNV
COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV)
                            , ("COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV", CoarseSampleOrderTypeNV -> ReadPrec CoarseSampleOrderTypeNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure CoarseSampleOrderTypeNV
COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV)
                            , ("COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV", CoarseSampleOrderTypeNV -> ReadPrec CoarseSampleOrderTypeNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure CoarseSampleOrderTypeNV
COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV)]
                     ReadPrec CoarseSampleOrderTypeNV
-> ReadPrec CoarseSampleOrderTypeNV
-> ReadPrec CoarseSampleOrderTypeNV
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int
-> ReadPrec CoarseSampleOrderTypeNV
-> ReadPrec CoarseSampleOrderTypeNV
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "CoarseSampleOrderTypeNV")
                       Int32
v <- ReadPrec Int32 -> ReadPrec Int32
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Int32
forall a. Read a => ReadPrec a
readPrec
                       CoarseSampleOrderTypeNV -> ReadPrec CoarseSampleOrderTypeNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int32 -> CoarseSampleOrderTypeNV
CoarseSampleOrderTypeNV Int32
v)))


type NV_SHADING_RATE_IMAGE_SPEC_VERSION = 3

-- No documentation found for TopLevel "VK_NV_SHADING_RATE_IMAGE_SPEC_VERSION"
pattern NV_SHADING_RATE_IMAGE_SPEC_VERSION :: forall a . Integral a => a
pattern $bNV_SHADING_RATE_IMAGE_SPEC_VERSION :: a
$mNV_SHADING_RATE_IMAGE_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
NV_SHADING_RATE_IMAGE_SPEC_VERSION = 3


type NV_SHADING_RATE_IMAGE_EXTENSION_NAME = "VK_NV_shading_rate_image"

-- No documentation found for TopLevel "VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME"
pattern NV_SHADING_RATE_IMAGE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bNV_SHADING_RATE_IMAGE_EXTENSION_NAME :: a
$mNV_SHADING_RATE_IMAGE_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
NV_SHADING_RATE_IMAGE_EXTENSION_NAME = "VK_NV_shading_rate_image"