{-# language CPP #-}
-- | = Name
--
-- VK_NV_shading_rate_image - device extension
--
-- == VK_NV_shading_rate_image
--
-- [__Name String__]
--     @VK_NV_shading_rate_image@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     165
--
-- [__Revision__]
--     3
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_physical_device_properties2 VK_KHR_get_physical_device_properties2>
--
-- [__Contact__]
--
--     -   Pat Brown
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_NV_shading_rate_image] @nvpbrown%0A*Here describe the issue or question you have about the VK_NV_shading_rate_image extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2019-07-18
--
-- [__Interactions and External Dependencies__]
--
--     -   This extension requires
--         <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/NV/SPV_NV_shading_rate.html SPV_NV_shading_rate>
--
--     -   This extension provides API support for
--         <https://github.com/KhronosGroup/GLSL/blob/master/extensions/nv/GLSL_NV_shading_rate_image.txt GL_NV_shading_rate_image>
--
-- [__Contributors__]
--
--     -   Pat Brown, NVIDIA
--
--     -   Carsten Rohde, NVIDIA
--
--     -   Jeff Bolz, NVIDIA
--
--     -   Daniel Koch, NVIDIA
--
--     -   Mathias Schott, NVIDIA
--
--     -   Matthew Netsch, Qualcomm Technologies, Inc.
--
-- == Description
--
-- This extension allows applications to use a variable shading rate when
-- processing fragments of rasterized primitives. By default, Vulkan will
-- spawn one fragment shader for each pixel covered by a primitive. In this
-- extension, applications can bind a /shading rate image/ that can be used
-- to vary the number of fragment shader invocations across the
-- framebuffer. Some portions of the screen may be configured to spawn up
-- to 16 fragment shaders for each pixel, while other portions may use a
-- single fragment shader invocation for a 4x4 block of pixels. This can be
-- useful for use cases like eye tracking, where the portion of the
-- framebuffer that the user is looking at directly can be processed at
-- high frequency, while distant corners of the image can be processed at
-- lower frequency. Each texel in the shading rate image represents a
-- fixed-size rectangle in the framebuffer, covering 16x16 pixels in the
-- initial implementation of this extension. When rasterizing a primitive
-- covering one of these rectangles, the Vulkan implementation reads a
-- texel in the bound shading rate image and looks up the fetched value in
-- a palette to determine a base shading rate.
--
-- In addition to the API support controlling rasterization, this extension
-- also adds Vulkan support for the
-- <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/NV/SPV_NV_shading_rate.html SPV_NV_shading_rate>
-- extension to SPIR-V. That extension provides two fragment shader
-- variable decorations that allow fragment shaders to determine the
-- shading rate used for processing the fragment:
--
-- -   @FragmentSizeNV@, which indicates the width and height of the set of
--     pixels processed by the fragment shader.
--
-- -   @InvocationsPerPixel@, which indicates the maximum number of
--     fragment shader invocations that could be spawned for the pixel(s)
--     covered by the fragment.
--
-- When using SPIR-V in conjunction with the OpenGL Shading Language
-- (GLSL), the fragment shader capabilities are provided by the
-- @GL_NV_shading_rate_image@ language extension and correspond to the
-- built-in variables @gl_FragmentSizeNV@ and @gl_InvocationsPerPixelNV@,
-- respectively.
--
-- == New Commands
--
-- -   'cmdBindShadingRateImageNV'
--
-- -   'cmdSetCoarseSampleOrderNV'
--
-- -   'cmdSetViewportShadingRatePaletteNV'
--
-- == New Structures
--
-- -   'CoarseSampleLocationNV'
--
-- -   'CoarseSampleOrderCustomNV'
--
-- -   'ShadingRatePaletteNV'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceShadingRateImageFeaturesNV'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceShadingRateImagePropertiesNV'
--
-- -   Extending 'Vulkan.Core10.Pipeline.PipelineViewportStateCreateInfo':
--
--     -   'PipelineViewportCoarseSampleOrderStateCreateInfoNV'
--
--     -   'PipelineViewportShadingRateImageStateCreateInfoNV'
--
-- == New Enums
--
-- -   'CoarseSampleOrderTypeNV'
--
-- -   'ShadingRatePaletteEntryNV'
--
-- == New Enum Constants
--
-- -   'NV_SHADING_RATE_IMAGE_EXTENSION_NAME'
--
-- -   'NV_SHADING_RATE_IMAGE_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.AccessFlagBits.AccessFlagBits':
--
--     -   'ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV'
--
-- -   Extending 'Vulkan.Core10.Enums.DynamicState.DynamicState':
--
--     -   'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV'
--
--     -   'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV'
--
-- -   Extending 'Vulkan.Core10.Enums.ImageLayout.ImageLayout':
--
--     -   'IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV'
--
-- -   Extending
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.ImageUsageFlagBits':
--
--     -   'IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV'
--
-- -   Extending
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PipelineStageFlagBits':
--
--     -   'PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV'
--
-- == Issues
--
-- (1) When using shading rates specifying “coarse” fragments covering
-- multiple pixels, we will generate a combined coverage mask that combines
-- the coverage masks of all pixels covered by the fragment. By default,
-- these masks are combined in an implementation-dependent order. Should we
-- provide a mechanism allowing applications to query or specify an exact
-- order?
--
-- __RESOLVED__: Yes, this feature is useful for cases where most of the
-- fragment shader can be evaluated once for an entire coarse fragment, but
-- where some per-pixel computations are also required. For example, a
-- per-pixel alpha test may want to kill all the samples for some pixels in
-- a coarse fragment. This sort of test can be implemented using an output
-- sample mask, but such a shader would need to know which bit in the mask
-- corresponds to each sample in the coarse fragment. We are including a
-- mechanism to allow applications to specify the orders of coverage
-- samples for each shading rate and sample count, either as static
-- pipeline state or dynamically via a command buffer. This portion of the
-- extension has its own feature bit.
--
-- We will not be providing a query to determine the
-- implementation-dependent default ordering. The thinking here is that if
-- an application cares enough about the coarse fragment sample ordering to
-- perform such a query, it could instead just set its own order, also
-- using custom per-pixel sample locations if required.
--
-- (2) For the pipeline stage 'PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV',
-- should we specify a precise location in the pipeline the shading rate
-- image is accessed (after geometry shading, but before the early fragment
-- tests) or leave it under-specified in case there are other
-- implementations that access the image in a different pipeline location?
--
-- __RESOLVED__ We are specifying the pipeline stage to be between the
-- final
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#pipelines-graphics-subsets-pre-rasterization pre-rasterization shader stage>
-- ('Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_GEOMETRY_SHADER_BIT')
-- and before the first stage used for fragment processing
-- ('Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT'),
-- which seems to be the natural place to access the shading rate image.
--
-- (3) How do centroid-sampled variables work with fragments larger than
-- one pixel?
--
-- __RESOLVED__ For single-pixel fragments, fragment shader inputs
-- decorated with @Centroid@ are sampled at an implementation-dependent
-- location in the intersection of the area of the primitive being
-- rasterized and the area of the pixel that corresponds to the fragment.
-- With multi-pixel fragments, we follow a similar pattern, using the
-- intersection of the primitive and the __set__ of pixels corresponding to
-- the fragment.
--
-- One important thing to keep in mind when using such “coarse” shading
-- rates is that fragment attributes are sampled at the center of the
-- fragment by default, regardless of the set of pixels\/samples covered by
-- the fragment. For fragments with a size of 4x4 pixels, this center
-- location will be more than two pixels (1.5 * sqrt(2)) away from the
-- center of the pixels at the corners of the fragment. When rendering a
-- primitive that covers only a small part of a coarse fragment, sampling a
-- color outside the primitive can produce overly bright or dark color
-- values if the color values have a large gradient. To deal with this, an
-- application can use centroid sampling on attributes where
-- “extrapolation” artifacts can lead to overly bright or dark pixels. Note
-- that this same problem also exists for multisampling with single-pixel
-- fragments, but is less severe because it only affects certain samples of
-- a pixel and such bright\/dark samples may be averaged with other samples
-- that do not have a similar problem.
--
-- == Version History
--
-- -   Revision 3, 2019-07-18 (Mathias Schott)
--
--     -   Fully list extension interfaces in this appendix.
--
-- -   Revision 2, 2018-09-13 (Pat Brown)
--
--     -   Miscellaneous edits preparing the specification for publication.
--
-- -   Revision 1, 2018-08-08 (Pat Brown)
--
--     -   Internal revisions
--
-- == See Also
--
-- 'CoarseSampleLocationNV', 'CoarseSampleOrderCustomNV',
-- 'CoarseSampleOrderTypeNV', 'PhysicalDeviceShadingRateImageFeaturesNV',
-- 'PhysicalDeviceShadingRateImagePropertiesNV',
-- 'PipelineViewportCoarseSampleOrderStateCreateInfoNV',
-- 'PipelineViewportShadingRateImageStateCreateInfoNV',
-- 'ShadingRatePaletteEntryNV', 'ShadingRatePaletteNV',
-- 'cmdBindShadingRateImageNV', 'cmdSetCoarseSampleOrderNV',
-- 'cmdSetViewportShadingRatePaletteNV'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_NV_shading_rate_image Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_NV_shading_rate_image  ( cmdBindShadingRateImageNV
                                                   , cmdSetViewportShadingRatePaletteNV
                                                   , cmdSetCoarseSampleOrderNV
                                                   , pattern IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV
                                                   , pattern ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV
                                                   , pattern IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV
                                                   , pattern PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV
                                                   , 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 Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showsPrec)
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 Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
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.Generics (Generic)
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 GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(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.FundamentalTypes (Extent2D)
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.Core10.Enums.AccessFlagBits (AccessFlags)
import Vulkan.Core10.Enums.AccessFlagBits (AccessFlagBits(ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR))
import Vulkan.Core10.Enums.ImageLayout (ImageLayout(IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR))
import Vulkan.Core10.Enums.ImageUsageFlagBits (ImageUsageFlags)
import Vulkan.Core10.Enums.ImageUsageFlagBits (ImageUsageFlagBits(IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR))
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlags)
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlagBits(PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR))
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
--
-- == Valid Usage
--
-- -   #VUID-vkCmdBindShadingRateImageNV-None-02058# The
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-shadingRateImage shadingRateImage>
--     feature /must/ be enabled
--
-- -   #VUID-vkCmdBindShadingRateImageNV-imageView-02059# 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'
--
-- -   #VUID-vkCmdBindShadingRateImageNV-imageView-02060# If @imageView@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE', it /must/ have a
--     format of 'Vulkan.Core10.Enums.Format.FORMAT_R8_UINT'
--
-- -   #VUID-vkCmdBindShadingRateImageNV-imageView-02061# If @imageView@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE', it /must/ have been
--     created with a @usage@ value including
--     'IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV'
--
-- -   #VUID-vkCmdBindShadingRateImageNV-imageView-02062# 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
--
-- -   #VUID-vkCmdBindShadingRateImageNV-imageLayout-02063# If @imageView@
--     is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @imageLayout@
--     /must/ be 'IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV' or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdBindShadingRateImageNV-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdBindShadingRateImageNV-imageView-parameter# If
--     @imageView@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @imageView@ /must/ be a valid 'Vulkan.Core10.Handles.ImageView'
--     handle
--
-- -   #VUID-vkCmdBindShadingRateImageNV-imageLayout-parameter#
--     @imageLayout@ /must/ be a valid
--     'Vulkan.Core10.Enums.ImageLayout.ImageLayout' value
--
-- -   #VUID-vkCmdBindShadingRateImageNV-commandBuffer-recording#
--     @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdBindShadingRateImageNV-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics operations
--
-- -   #VUID-vkCmdBindShadingRateImageNV-videocoding# This command /must/
--     only be called outside of a video coding scope
--
-- -   #VUID-vkCmdBindShadingRateImageNV-commonparent# 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#vkCmdBeginVideoCodingKHR Video Coding 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#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Outside                                                                                                                     | Graphics                                                                                                              | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             |                                                                                                                       |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Core10.Enums.ImageLayout.ImageLayout',
-- 'Vulkan.Core10.Handles.ImageView'
cmdBindShadingRateImageNV :: forall io
                           . (MonadIO io)
                          => -- | @commandBuffer@ is the command buffer into which the command will be
                             -- recorded.
                             CommandBuffer
                          -> -- | @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.
                             ImageView
                          -> -- | @imageLayout@ is the layout that the image subresources accessible from
                             -- @imageView@ will be in when the shading rate image is accessed.
                             ImageLayout
                          -> io ()
cmdBindShadingRateImageNV :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> ImageView -> ImageLayout -> io ()
cmdBindShadingRateImageNV CommandBuffer
commandBuffer ImageView
imageView ImageLayout
imageLayout = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO 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 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
vkCmdBindShadingRateImageNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdBindShadingRateImageNV is null" forall a. Maybe a
Nothing 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
  forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdBindShadingRateImageNV" (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ()
vkCmdBindShadingRateImageNV'
                                                    (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                    (ImageView
imageView)
                                                    (ImageLayout
imageLayout))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure 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
-- dynamically for a command buffer
--
-- = Description
--
-- This command sets the per-viewport shading rate image palettes for
-- subsequent drawing commands when drawing using
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#shaders-objects shader objects>,
-- or when the graphics pipeline is created with
-- 'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV'
-- set in
-- 'Vulkan.Core10.Pipeline.PipelineDynamicStateCreateInfo'::@pDynamicStates@.
-- Otherwise, this state is specified by the
-- 'PipelineViewportShadingRateImageStateCreateInfoNV'::@pShadingRatePalettes@
-- values used to create the currently active pipeline.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdSetViewportShadingRatePaletteNV-None-02064# The
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-shadingRateImage shadingRateImage>
--     feature /must/ be enabled
--
-- -   #VUID-vkCmdSetViewportShadingRatePaletteNV-firstViewport-02067# The
--     sum of @firstViewport@ and @viewportCount@ /must/ be between @1@ and
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxViewports@,
--     inclusive
--
-- -   #VUID-vkCmdSetViewportShadingRatePaletteNV-firstViewport-02068# If
--     the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-multiViewport multiViewport>
--     feature is not enabled, @firstViewport@ /must/ be @0@
--
-- -   #VUID-vkCmdSetViewportShadingRatePaletteNV-viewportCount-02069# If
--     the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-multiViewport multiViewport>
--     feature is not enabled, @viewportCount@ /must/ be @1@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdSetViewportShadingRatePaletteNV-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdSetViewportShadingRatePaletteNV-pShadingRatePalettes-parameter#
--     @pShadingRatePalettes@ /must/ be a valid pointer to an array of
--     @viewportCount@ valid 'ShadingRatePaletteNV' structures
--
-- -   #VUID-vkCmdSetViewportShadingRatePaletteNV-commandBuffer-recording#
--     @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdSetViewportShadingRatePaletteNV-commandBuffer-cmdpool#
--     The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics operations
--
-- -   #VUID-vkCmdSetViewportShadingRatePaletteNV-videocoding# This command
--     /must/ only be called outside of a video coding scope
--
-- -   #VUID-vkCmdSetViewportShadingRatePaletteNV-viewportCount-arraylength#
--     @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#vkCmdBeginVideoCodingKHR Video Coding 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#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Outside                                                                                                                     | Graphics                                                                                                              | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             |                                                                                                                       |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- 'Vulkan.Core10.Handles.CommandBuffer', 'ShadingRatePaletteNV'
cmdSetViewportShadingRatePaletteNV :: forall io
                                    . (MonadIO io)
                                   => -- | @commandBuffer@ is the command buffer into which the command will be
                                      -- recorded.
                                      CommandBuffer
                                   -> -- | @firstViewport@ is the index of the first viewport whose shading rate
                                      -- palette is updated by the command.
                                      ("firstViewport" ::: Word32)
                                   -> -- | @pShadingRatePalettes@ is a pointer to an array of
                                      -- 'ShadingRatePaletteNV' structures defining the palette for each
                                      -- viewport.
                                      ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV)
                                   -> io ()
cmdSetViewportShadingRatePaletteNV :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> ("firstViewport" ::: Word32)
-> ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV)
-> io ()
cmdSetViewportShadingRatePaletteNV CommandBuffer
commandBuffer
                                     "firstViewport" ::: Word32
firstViewport
                                     "shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let 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 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("firstViewport" ::: Word32)
   -> ("firstViewport" ::: Word32)
   -> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
   -> IO ())
vkCmdSetViewportShadingRatePaletteNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdSetViewportShadingRatePaletteNV is null" forall a. Maybe a
Nothing 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 <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @ShadingRatePaletteNV ((forall a. Vector a -> Int
Data.Vector.length ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes)) forall a. Num a => a -> a -> a
* Int
16)
  forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i ShadingRatePaletteNV
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pPShadingRatePalettes forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ShadingRatePaletteNV) (ShadingRatePaletteNV
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdSetViewportShadingRatePaletteNV" (Ptr CommandBuffer_T
-> ("firstViewport" ::: Word32)
-> ("firstViewport" ::: Word32)
-> ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> IO ()
vkCmdSetViewportShadingRatePaletteNV'
                                                                    (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                                    ("firstViewport" ::: Word32
firstViewport)
                                                                    ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes)) :: Word32))
                                                                    ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pPShadingRatePalettes))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 order of coverage samples for coarse
-- fragments dynamically for a command buffer
--
-- = 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'.
--
-- This command sets the order of coverage samples for subsequent drawing
-- commands when drawing using
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#shaders-objects shader objects>,
-- or when the graphics pipeline is created with
-- 'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV'
-- set in
-- 'Vulkan.Core10.Pipeline.PipelineDynamicStateCreateInfo'::@pDynamicStates@.
-- Otherwise, this state is specified by the
-- 'PipelineViewportCoarseSampleOrderStateCreateInfoNV' values used to
-- create the currently active pipeline.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdSetCoarseSampleOrderNV-sampleOrderType-02081# If
--     @sampleOrderType@ is not 'COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV',
--     @customSamplerOrderCount@ /must/ be @0@
--
-- -   #VUID-vkCmdSetCoarseSampleOrderNV-pCustomSampleOrders-02235# The
--     array @pCustomSampleOrders@ /must/ not contain two structures with
--     matching values for both the @shadingRate@ and @sampleCount@ members
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdSetCoarseSampleOrderNV-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdSetCoarseSampleOrderNV-sampleOrderType-parameter#
--     @sampleOrderType@ /must/ be a valid 'CoarseSampleOrderTypeNV' value
--
-- -   #VUID-vkCmdSetCoarseSampleOrderNV-pCustomSampleOrders-parameter# If
--     @customSampleOrderCount@ is not @0@, @pCustomSampleOrders@ /must/ be
--     a valid pointer to an array of @customSampleOrderCount@ valid
--     'CoarseSampleOrderCustomNV' structures
--
-- -   #VUID-vkCmdSetCoarseSampleOrderNV-commandBuffer-recording#
--     @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdSetCoarseSampleOrderNV-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics operations
--
-- -   #VUID-vkCmdSetCoarseSampleOrderNV-videocoding# This command /must/
--     only be called outside of a video coding scope
--
-- == 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#vkCmdBeginVideoCodingKHR Video Coding 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#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Outside                                                                                                                     | Graphics                                                                                                              | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             |                                                                                                                       |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- 'CoarseSampleOrderCustomNV', 'CoarseSampleOrderTypeNV',
-- 'Vulkan.Core10.Handles.CommandBuffer'
cmdSetCoarseSampleOrderNV :: forall io
                           . (MonadIO io)
                          => -- | @commandBuffer@ is the command buffer into which the command will be
                             -- recorded.
                             CommandBuffer
                          -> -- | @sampleOrderType@ specifies the mechanism used to order coverage samples
                             -- in fragments larger than one pixel.
                             CoarseSampleOrderTypeNV
                          -> -- | @pCustomSampleOrders@ is a pointer to an array of
                             -- 'CoarseSampleOrderCustomNV' structures, each structure specifying the
                             -- coverage sample order for a single combination of fragment area and
                             -- coverage sample count.
                             ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
                          -> io ()
cmdSetCoarseSampleOrderNV :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> CoarseSampleOrderTypeNV
-> ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV)
-> io ()
cmdSetCoarseSampleOrderNV CommandBuffer
commandBuffer
                            CoarseSampleOrderTypeNV
sampleOrderType
                            "customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let 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 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> CoarseSampleOrderTypeNV
   -> ("firstViewport" ::: Word32)
   -> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
   -> IO ())
vkCmdSetCoarseSampleOrderNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdSetCoarseSampleOrderNV is null" forall a. Maybe a
Nothing 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 <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @CoarseSampleOrderCustomNV ((forall a. Vector a -> Int
Data.Vector.length ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders)) forall a. Num a => a -> a -> a
* Int
24)
  forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i CoarseSampleOrderCustomNV
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pPCustomSampleOrders forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
24 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr CoarseSampleOrderCustomNV) (CoarseSampleOrderCustomNV
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdSetCoarseSampleOrderNV" (Ptr CommandBuffer_T
-> CoarseSampleOrderTypeNV
-> ("firstViewport" ::: Word32)
-> ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> IO ()
vkCmdSetCoarseSampleOrderNV'
                                                           (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                           (CoarseSampleOrderTypeNV
sampleOrderType)
                                                           ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders)) :: Word32))
                                                           ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pPCustomSampleOrders))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()


-- No documentation found for TopLevel "VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV"
pattern $bIMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV :: ImageLayout
$mIMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV :: forall {r}. ImageLayout -> ((# #) -> r) -> ((# #) -> r) -> r
IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV = IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR


-- No documentation found for TopLevel "VK_ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV"
pattern $bACCESS_SHADING_RATE_IMAGE_READ_BIT_NV :: AccessFlagBits
$mACCESS_SHADING_RATE_IMAGE_READ_BIT_NV :: forall {r}. AccessFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV = ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR


-- No documentation found for TopLevel "VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV"
pattern $bIMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV :: ImageUsageFlagBits
$mIMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV :: forall {r}. ImageUsageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV = IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR


-- No documentation found for TopLevel "VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV"
pattern $bPIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV :: PipelineStageFlagBits
$mPIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV :: forall {r}.
PipelineStageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV = PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR


-- | VkShadingRatePaletteNV - Structure specifying a single shading rate
-- palette
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- 'PipelineViewportShadingRateImageStateCreateInfoNV',
-- 'ShadingRatePaletteEntryNV', 'cmdSetViewportShadingRatePaletteNV'
data ShadingRatePaletteNV = ShadingRatePaletteNV
  { -- | @pShadingRatePaletteEntries@ is a pointer to an array of
    -- 'ShadingRatePaletteEntryNV' enums defining the shading rate for each
    -- palette entry.
    --
    -- #VUID-VkShadingRatePaletteNV-pShadingRatePaletteEntries-parameter#
    -- @pShadingRatePaletteEntries@ /must/ be a valid pointer to an array of
    -- @shadingRatePaletteEntryCount@ valid 'ShadingRatePaletteEntryNV' values
    ShadingRatePaletteNV -> Vector ShadingRatePaletteEntryNV
shadingRatePaletteEntries :: Vector ShadingRatePaletteEntryNV }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ShadingRatePaletteNV)
#endif
deriving instance Show ShadingRatePaletteNV

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

instance FromCStruct ShadingRatePaletteNV where
  peekCStruct :: ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV)
-> IO ShadingRatePaletteNV
peekCStruct "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p = do
    "firstViewport" ::: Word32
shadingRatePaletteEntryCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
    Ptr ShadingRatePaletteEntryNV
pShadingRatePaletteEntries <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ShadingRatePaletteEntryNV) (("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ShadingRatePaletteEntryNV)))
    Vector ShadingRatePaletteEntryNV
pShadingRatePaletteEntries' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "firstViewport" ::: Word32
shadingRatePaletteEntryCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @ShadingRatePaletteEntryNV ((Ptr ShadingRatePaletteEntryNV
pShadingRatePaletteEntries forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ShadingRatePaletteEntryNV)))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure 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
           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.FundamentalTypes.FALSE', and the shading rate image
-- and palettes are not used.
--
-- == Valid Usage
--
-- -   #VUID-VkPipelineViewportShadingRateImageStateCreateInfoNV-viewportCount-02054#
--     If the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-multiViewport multiViewport>
--     feature is not enabled, @viewportCount@ /must/ be @0@ or @1@
--
-- -   #VUID-VkPipelineViewportShadingRateImageStateCreateInfoNV-viewportCount-02055#
--     @viewportCount@ /must/ be less than or equal to
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxViewports@
--
-- -   #VUID-VkPipelineViewportShadingRateImageStateCreateInfoNV-shadingRateImageEnable-02056#
--     If @shadingRateImageEnable@ is
--     'Vulkan.Core10.FundamentalTypes.TRUE', @viewportCount@ /must/ be
--     greater or equal to the @viewportCount@ member of
--     'Vulkan.Core10.Pipeline.PipelineViewportStateCreateInfo'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPipelineViewportShadingRateImageStateCreateInfoNV-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- 'Vulkan.Core10.FundamentalTypes.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
  , -- | @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)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineViewportShadingRateImageStateCreateInfoNV)
#endif
deriving instance Show PipelineViewportShadingRateImageStateCreateInfoNV

instance ToCStruct PipelineViewportShadingRateImageStateCreateInfoNV where
  withCStruct :: forall b.
PipelineViewportShadingRateImageStateCreateInfoNV
-> (Ptr PipelineViewportShadingRateImageStateCreateInfoNV -> IO b)
-> IO b
withCStruct PipelineViewportShadingRateImageStateCreateInfoNV
x Ptr PipelineViewportShadingRateImageStateCreateInfoNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p -> 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 :: forall b.
Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> PipelineViewportShadingRateImageStateCreateInfoNV
-> IO b
-> IO b
pokeCStruct Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p PipelineViewportShadingRateImageStateCreateInfoNV{Bool
"shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes :: "shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRateImageEnable :: Bool
$sel:shadingRatePalettes:PipelineViewportShadingRateImageStateCreateInfoNV :: PipelineViewportShadingRateImageStateCreateInfoNV
-> "shadingRatePalettes" ::: Vector ShadingRatePaletteNV
$sel:shadingRateImageEnable:PipelineViewportShadingRateImageStateCreateInfoNV :: PipelineViewportShadingRateImageStateCreateInfoNV -> Bool
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
shadingRateImageEnable))
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes)) :: Word32))
    "pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pPShadingRatePalettes' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @ShadingRatePaletteNV ((forall a. Vector a -> Int
Data.Vector.length ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes)) forall a. Num a => a -> a -> a
* Int
16)
    forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i ShadingRatePaletteNV
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pPShadingRatePalettes' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ShadingRatePaletteNV) (ShadingRatePaletteNV
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) ("shadingRatePalettes" ::: Vector ShadingRatePaletteNV
shadingRatePalettes)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ShadingRatePaletteNV))) ("pShadingRatePalettes" ::: Ptr ShadingRatePaletteNV
pPShadingRatePalettes')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PipelineViewportShadingRateImageStateCreateInfoNV
-> IO b -> IO b
pokeZeroCStruct Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportShadingRateImageStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
    IO b
f

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

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


-- | VkPhysicalDeviceShadingRateImageFeaturesNV - Structure describing
-- shading rate image features that can be supported by an implementation
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- See
-- <https://registry.khronos.org/vulkan/specs/1.3-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 the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. 'PhysicalDeviceShadingRateImageFeaturesNV' /can/ also be used
-- in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to
-- selectively enable these features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceShadingRateImageFeaturesNV = PhysicalDeviceShadingRateImageFeaturesNV
  { -- | #features-shadingRateImage# @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
  , -- | #features-shadingRateCoarseSampleOrder# @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, PhysicalDeviceShadingRateImageFeaturesNV
-> PhysicalDeviceShadingRateImageFeaturesNV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceShadingRateImageFeaturesNV
-> PhysicalDeviceShadingRateImageFeaturesNV -> Bool
$c/= :: PhysicalDeviceShadingRateImageFeaturesNV
-> PhysicalDeviceShadingRateImageFeaturesNV -> Bool
== :: PhysicalDeviceShadingRateImageFeaturesNV
-> PhysicalDeviceShadingRateImageFeaturesNV -> Bool
$c== :: PhysicalDeviceShadingRateImageFeaturesNV
-> PhysicalDeviceShadingRateImageFeaturesNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceShadingRateImageFeaturesNV)
#endif
deriving instance Show PhysicalDeviceShadingRateImageFeaturesNV

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

instance FromCStruct PhysicalDeviceShadingRateImageFeaturesNV where
  peekCStruct :: Ptr PhysicalDeviceShadingRateImageFeaturesNV
-> IO PhysicalDeviceShadingRateImageFeaturesNV
peekCStruct Ptr PhysicalDeviceShadingRateImageFeaturesNV
p = do
    Bool32
shadingRateImage <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceShadingRateImageFeaturesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    Bool32
shadingRateCoarseSampleOrder <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceShadingRateImageFeaturesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure 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
_ = Int
24
  alignment :: PhysicalDeviceShadingRateImageFeaturesNV -> Int
alignment ~PhysicalDeviceShadingRateImageFeaturesNV
_ = Int
8
  peek :: Ptr PhysicalDeviceShadingRateImageFeaturesNV
-> IO PhysicalDeviceShadingRateImageFeaturesNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDeviceShadingRateImageFeaturesNV
-> PhysicalDeviceShadingRateImageFeaturesNV -> IO ()
poke Ptr PhysicalDeviceShadingRateImageFeaturesNV
ptr PhysicalDeviceShadingRateImageFeaturesNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShadingRateImageFeaturesNV
ptr PhysicalDeviceShadingRateImageFeaturesNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

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


-- | VkPhysicalDeviceShadingRateImagePropertiesNV - Structure describing
-- shading rate image limits that can be supported by an implementation
--
-- = Description
--
-- If the 'PhysicalDeviceShadingRateImagePropertiesNV' structure is
-- included in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceProperties2',
-- it is filled in with each corresponding implementation-dependent
-- property.
--
-- These properties are related to the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-shading-rate-image shading rate image>
-- feature.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- 'Vulkan.Core10.FundamentalTypes.Extent2D',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceShadingRateImagePropertiesNV = PhysicalDeviceShadingRateImagePropertiesNV
  { -- | #limits-shadingRateTexelSize# @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
  , -- | #limits-shadingRatePaletteSize# @shadingRatePaletteSize@ indicates the
    -- maximum number of palette entries supported for the shading rate image.
    PhysicalDeviceShadingRateImagePropertiesNV
-> "firstViewport" ::: Word32
shadingRatePaletteSize :: Word32
  , -- | #limits-shadingRateMaxCoarseSamples# @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)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceShadingRateImagePropertiesNV)
#endif
deriving instance Show PhysicalDeviceShadingRateImagePropertiesNV

instance ToCStruct PhysicalDeviceShadingRateImagePropertiesNV where
  withCStruct :: forall b.
PhysicalDeviceShadingRateImagePropertiesNV
-> (Ptr PhysicalDeviceShadingRateImagePropertiesNV -> IO b) -> IO b
withCStruct PhysicalDeviceShadingRateImagePropertiesNV
x Ptr PhysicalDeviceShadingRateImagePropertiesNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceShadingRateImagePropertiesNV
p -> 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 :: forall b.
Ptr PhysicalDeviceShadingRateImagePropertiesNV
-> PhysicalDeviceShadingRateImagePropertiesNV -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShadingRateImagePropertiesNV
p PhysicalDeviceShadingRateImagePropertiesNV{"firstViewport" ::: Word32
Extent2D
shadingRateMaxCoarseSamples :: "firstViewport" ::: Word32
shadingRatePaletteSize :: "firstViewport" ::: Word32
shadingRateTexelSize :: Extent2D
$sel:shadingRateMaxCoarseSamples:PhysicalDeviceShadingRateImagePropertiesNV :: PhysicalDeviceShadingRateImagePropertiesNV
-> "firstViewport" ::: Word32
$sel:shadingRatePaletteSize:PhysicalDeviceShadingRateImagePropertiesNV :: PhysicalDeviceShadingRateImagePropertiesNV
-> "firstViewport" ::: Word32
$sel:shadingRateTexelSize:PhysicalDeviceShadingRateImagePropertiesNV :: PhysicalDeviceShadingRateImagePropertiesNV -> Extent2D
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Extent2D)) (Extent2D
shadingRateTexelSize)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) ("firstViewport" ::: Word32
shadingRatePaletteSize)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) ("firstViewport" ::: Word32
shadingRateMaxCoarseSamples)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceShadingRateImagePropertiesNV -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceShadingRateImagePropertiesNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Extent2D)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShadingRateImagePropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (forall a. Zero a => a
zero)
    IO b
f

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

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

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


-- | VkCoarseSampleLocationNV - Structure specifying parameters controlling
-- shading rate image usage
--
-- == Valid Usage
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- 'CoarseSampleOrderCustomNV'
data CoarseSampleLocationNV = CoarseSampleLocationNV
  { -- | @pixelX@ is added to the x coordinate of the upper-leftmost pixel of
    -- each fragment to identify the pixel containing the coverage sample.
    --
    -- #VUID-VkCoarseSampleLocationNV-pixelX-02078# @pixelX@ /must/ be less
    -- than the width (in pixels) of the fragment
    CoarseSampleLocationNV -> "firstViewport" ::: Word32
pixelX :: Word32
  , -- | @pixelY@ is added to the y coordinate of the upper-leftmost pixel of
    -- each fragment to identify the pixel containing the coverage sample.
    --
    -- #VUID-VkCoarseSampleLocationNV-pixelY-02079# @pixelY@ /must/ be less
    -- than the height (in pixels) of the fragment
    CoarseSampleLocationNV -> "firstViewport" ::: Word32
pixelY :: Word32
  , -- | @sample@ is the number of the coverage sample in the pixel identified by
    -- @pixelX@ and @pixelY@.
    --
    -- #VUID-VkCoarseSampleLocationNV-sample-02080# @sample@ /must/ be less
    -- than the number of coverage samples in each pixel belonging to the
    -- fragment
    CoarseSampleLocationNV -> "firstViewport" ::: Word32
sample :: Word32
  }
  deriving (Typeable, CoarseSampleLocationNV -> CoarseSampleLocationNV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CoarseSampleLocationNV -> CoarseSampleLocationNV -> Bool
$c/= :: CoarseSampleLocationNV -> CoarseSampleLocationNV -> Bool
== :: CoarseSampleLocationNV -> CoarseSampleLocationNV -> Bool
$c== :: CoarseSampleLocationNV -> CoarseSampleLocationNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CoarseSampleLocationNV)
#endif
deriving instance Show CoarseSampleLocationNV

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

instance FromCStruct CoarseSampleLocationNV where
  peekCStruct :: Ptr CoarseSampleLocationNV -> IO CoarseSampleLocationNV
peekCStruct Ptr CoarseSampleLocationNV
p = do
    "firstViewport" ::: Word32
pixelX <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr CoarseSampleLocationNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
    "firstViewport" ::: Word32
pixelY <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr CoarseSampleLocationNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32))
    "firstViewport" ::: Word32
sample <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr CoarseSampleLocationNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure 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
_ = Int
12
  alignment :: CoarseSampleLocationNV -> Int
alignment ~CoarseSampleLocationNV
_ = Int
4
  peek :: Ptr CoarseSampleLocationNV -> IO CoarseSampleLocationNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr CoarseSampleLocationNV -> CoarseSampleLocationNV -> IO ()
poke Ptr CoarseSampleLocationNV
ptr CoarseSampleLocationNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CoarseSampleLocationNV
ptr CoarseSampleLocationNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

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


-- | VkCoarseSampleOrderCustomNV - Structure specifying parameters
-- controlling shading rate image usage
--
-- = Description
--
-- The 'CoarseSampleOrderCustomNV' structure is used with a coverage sample
-- ordering type of 'COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV' to specify the
-- order of coverage samples for one combination of fragment width,
-- fragment height, and coverage sample count.
--
-- When using a custom sample ordering, element /j/ in @pSampleLocations@
-- specifies a specific pixel location and
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-multisampling-coverage-mask sample index>
-- that corresponds to
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-multisampling-coverage-mask coverage index>
-- /j/ in the multi-pixel fragment.
--
-- == Valid Usage
--
-- -   #VUID-VkCoarseSampleOrderCustomNV-shadingRate-02073# @shadingRate@
--     /must/ be a shading rate that generates fragments with more than one
--     pixel
--
-- -   #VUID-VkCoarseSampleOrderCustomNV-sampleCount-02074# @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@
--
-- -   #VUID-VkCoarseSampleOrderCustomNV-sampleLocationCount-02075#
--     @sampleLocationCount@ /must/ be equal to the product of
--     @sampleCount@, the fragment width for @shadingRate@, and the
--     fragment height for @shadingRate@
--
-- -   #VUID-VkCoarseSampleOrderCustomNV-sampleLocationCount-02076#
--     @sampleLocationCount@ /must/ be less than or equal to the value of
--     'PhysicalDeviceShadingRateImagePropertiesNV'::@shadingRateMaxCoarseSamples@
--
-- -   #VUID-VkCoarseSampleOrderCustomNV-pSampleLocations-02077# 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)
--
-- -   #VUID-VkCoarseSampleOrderCustomNV-shadingRate-parameter#
--     @shadingRate@ /must/ be a valid 'ShadingRatePaletteEntryNV' value
--
-- -   #VUID-VkCoarseSampleOrderCustomNV-pSampleLocations-parameter#
--     @pSampleLocations@ /must/ be a valid pointer to an array of
--     @sampleLocationCount@ 'CoarseSampleLocationNV' structures
--
-- -   #VUID-VkCoarseSampleOrderCustomNV-sampleLocationCount-arraylength#
--     @sampleLocationCount@ /must/ be greater than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- '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 'CoarseSampleLocationNV'
    -- structures specifying the location of each sample in the custom
    -- ordering.
    CoarseSampleOrderCustomNV -> Vector CoarseSampleLocationNV
sampleLocations :: Vector CoarseSampleLocationNV
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CoarseSampleOrderCustomNV)
#endif
deriving instance Show CoarseSampleOrderCustomNV

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

instance FromCStruct CoarseSampleOrderCustomNV where
  peekCStruct :: ("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV)
-> IO CoarseSampleOrderCustomNV
peekCStruct "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p = do
    ShadingRatePaletteEntryNV
shadingRate <- forall a. Storable a => Ptr a -> IO a
peek @ShadingRatePaletteEntryNV (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr ShadingRatePaletteEntryNV))
    "firstViewport" ::: Word32
sampleCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32))
    "firstViewport" ::: Word32
sampleLocationCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word32))
    Ptr CoarseSampleLocationNV
pSampleLocations <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr CoarseSampleLocationNV) (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr CoarseSampleLocationNV)))
    Vector CoarseSampleLocationNV
pSampleLocations' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "firstViewport" ::: Word32
sampleLocationCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @CoarseSampleLocationNV ((Ptr CoarseSampleLocationNV
pSampleLocations forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
12 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr CoarseSampleLocationNV)))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure 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
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           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
--
-- -   #VUID-VkPipelineViewportCoarseSampleOrderStateCreateInfoNV-sampleOrderType-02072#
--     If @sampleOrderType@ is not 'COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV',
--     @customSamplerOrderCount@ /must/ be @0@
--
-- -   #VUID-VkPipelineViewportCoarseSampleOrderStateCreateInfoNV-pCustomSampleOrders-02234#
--     The array @pCustomSampleOrders@ /must/ not contain two structures
--     with matching values for both the @shadingRate@ and @sampleCount@
--     members
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPipelineViewportCoarseSampleOrderStateCreateInfoNV-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV'
--
-- -   #VUID-VkPipelineViewportCoarseSampleOrderStateCreateInfoNV-sampleOrderType-parameter#
--     @sampleOrderType@ /must/ be a valid 'CoarseSampleOrderTypeNV' value
--
-- -   #VUID-VkPipelineViewportCoarseSampleOrderStateCreateInfoNV-pCustomSampleOrders-parameter#
--     If @customSampleOrderCount@ is not @0@, @pCustomSampleOrders@ /must/
--     be a valid pointer to an array of @customSampleOrderCount@ valid
--     'CoarseSampleOrderCustomNV' structures
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- '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
    -- structure specifying the coverage sample order for a single combination
    -- of fragment area and coverage sample count.
    PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> "customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
customSampleOrders :: Vector CoarseSampleOrderCustomNV
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineViewportCoarseSampleOrderStateCreateInfoNV)
#endif
deriving instance Show PipelineViewportCoarseSampleOrderStateCreateInfoNV

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

instance FromCStruct PipelineViewportCoarseSampleOrderStateCreateInfoNV where
  peekCStruct :: Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
-> IO PipelineViewportCoarseSampleOrderStateCreateInfoNV
peekCStruct Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p = do
    CoarseSampleOrderTypeNV
sampleOrderType <- forall a. Storable a => Ptr a -> IO a
peek @CoarseSampleOrderTypeNV ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CoarseSampleOrderTypeNV))
    "firstViewport" ::: Word32
customSampleOrderCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
    "pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pCustomSampleOrders <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr CoarseSampleOrderCustomNV) ((Ptr PipelineViewportCoarseSampleOrderStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr CoarseSampleOrderCustomNV)))
    "customSampleOrders" ::: Vector CoarseSampleOrderCustomNV
pCustomSampleOrders' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "firstViewport" ::: Word32
customSampleOrderCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @CoarseSampleOrderCustomNV (("pCustomSampleOrders" ::: Ptr CoarseSampleOrderCustomNV
pCustomSampleOrders forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
24 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr CoarseSampleOrderCustomNV)))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure 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
           forall a. Zero a => a
zero
           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
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- 'CoarseSampleOrderCustomNV', 'ShadingRatePaletteNV'
newtype ShadingRatePaletteEntryNV = ShadingRatePaletteEntryNV Int32
  deriving newtype (ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> Bool
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
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
Ord, Ptr ShadingRatePaletteEntryNV -> IO ShadingRatePaletteEntryNV
Ptr ShadingRatePaletteEntryNV
-> Int -> IO ShadingRatePaletteEntryNV
Ptr ShadingRatePaletteEntryNV
-> Int -> ShadingRatePaletteEntryNV -> IO ()
Ptr ShadingRatePaletteEntryNV -> ShadingRatePaletteEntryNV -> IO ()
ShadingRatePaletteEntryNV -> Int
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 :: forall b. Ptr b -> Int -> ShadingRatePaletteEntryNV -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> ShadingRatePaletteEntryNV -> IO ()
peekByteOff :: forall b. 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
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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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
  #-}

conNameShadingRatePaletteEntryNV :: String
conNameShadingRatePaletteEntryNV :: String
conNameShadingRatePaletteEntryNV = String
"ShadingRatePaletteEntryNV"

enumPrefixShadingRatePaletteEntryNV :: String
enumPrefixShadingRatePaletteEntryNV :: String
enumPrefixShadingRatePaletteEntryNV = String
"SHADING_RATE_PALETTE_ENTRY_"

showTableShadingRatePaletteEntryNV :: [(ShadingRatePaletteEntryNV, String)]
showTableShadingRatePaletteEntryNV :: [(ShadingRatePaletteEntryNV, String)]
showTableShadingRatePaletteEntryNV =
  [
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV
    , String
"NO_INVOCATIONS_NV"
    )
  ,
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV
    , String
"16_INVOCATIONS_PER_PIXEL_NV"
    )
  ,
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV
    , String
"8_INVOCATIONS_PER_PIXEL_NV"
    )
  ,
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV
    , String
"4_INVOCATIONS_PER_PIXEL_NV"
    )
  ,
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV
    , String
"2_INVOCATIONS_PER_PIXEL_NV"
    )
  ,
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV
    , String
"1_INVOCATION_PER_PIXEL_NV"
    )
  ,
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV
    , String
"1_INVOCATION_PER_2X1_PIXELS_NV"
    )
  ,
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV
    , String
"1_INVOCATION_PER_1X2_PIXELS_NV"
    )
  ,
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV
    , String
"1_INVOCATION_PER_2X2_PIXELS_NV"
    )
  ,
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV
    , String
"1_INVOCATION_PER_4X2_PIXELS_NV"
    )
  ,
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV
    , String
"1_INVOCATION_PER_2X4_PIXELS_NV"
    )
  ,
    ( ShadingRatePaletteEntryNV
SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV
    , String
"1_INVOCATION_PER_4X4_PIXELS_NV"
    )
  ]

instance Show ShadingRatePaletteEntryNV where
  showsPrec :: Int -> ShadingRatePaletteEntryNV -> ShowS
showsPrec =
    forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixShadingRatePaletteEntryNV
      [(ShadingRatePaletteEntryNV, String)]
showTableShadingRatePaletteEntryNV
      String
conNameShadingRatePaletteEntryNV
      (\(ShadingRatePaletteEntryNV Int32
x) -> Int32
x)
      (forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)

instance Read ShadingRatePaletteEntryNV where
  readPrec :: ReadPrec ShadingRatePaletteEntryNV
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixShadingRatePaletteEntryNV
      [(ShadingRatePaletteEntryNV, String)]
showTableShadingRatePaletteEntryNV
      String
conNameShadingRatePaletteEntryNV
      Int32 -> ShadingRatePaletteEntryNV
ShadingRatePaletteEntryNV

-- | VkCoarseSampleOrderTypeNV - Shading rate image sample ordering types
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_shading_rate_image VK_NV_shading_rate_image>,
-- 'PipelineViewportCoarseSampleOrderStateCreateInfoNV',
-- 'cmdSetCoarseSampleOrderNV'
newtype CoarseSampleOrderTypeNV = CoarseSampleOrderTypeNV Int32
  deriving newtype (CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> Bool
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
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
Ord, Ptr CoarseSampleOrderTypeNV -> IO CoarseSampleOrderTypeNV
Ptr CoarseSampleOrderTypeNV -> Int -> IO CoarseSampleOrderTypeNV
Ptr CoarseSampleOrderTypeNV
-> Int -> CoarseSampleOrderTypeNV -> IO ()
Ptr CoarseSampleOrderTypeNV -> CoarseSampleOrderTypeNV -> IO ()
CoarseSampleOrderTypeNV -> Int
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 :: forall b. Ptr b -> Int -> CoarseSampleOrderTypeNV -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> CoarseSampleOrderTypeNV -> IO ()
peekByteOff :: forall b. 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
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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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://registry.khronos.org/vulkan/specs/1.3-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 -> ((# #) -> r) -> ((# #) -> 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://registry.khronos.org/vulkan/specs/1.3-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 -> ((# #) -> r) -> ((# #) -> 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
  #-}

conNameCoarseSampleOrderTypeNV :: String
conNameCoarseSampleOrderTypeNV :: String
conNameCoarseSampleOrderTypeNV = String
"CoarseSampleOrderTypeNV"

enumPrefixCoarseSampleOrderTypeNV :: String
enumPrefixCoarseSampleOrderTypeNV :: String
enumPrefixCoarseSampleOrderTypeNV = String
"COARSE_SAMPLE_ORDER_TYPE_"

showTableCoarseSampleOrderTypeNV :: [(CoarseSampleOrderTypeNV, String)]
showTableCoarseSampleOrderTypeNV :: [(CoarseSampleOrderTypeNV, String)]
showTableCoarseSampleOrderTypeNV =
  [
    ( CoarseSampleOrderTypeNV
COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV
    , String
"DEFAULT_NV"
    )
  ,
    ( CoarseSampleOrderTypeNV
COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV
    , String
"CUSTOM_NV"
    )
  ,
    ( CoarseSampleOrderTypeNV
COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV
    , String
"PIXEL_MAJOR_NV"
    )
  ,
    ( CoarseSampleOrderTypeNV
COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV
    , String
"SAMPLE_MAJOR_NV"
    )
  ]

instance Show CoarseSampleOrderTypeNV where
  showsPrec :: Int -> CoarseSampleOrderTypeNV -> ShowS
showsPrec =
    forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixCoarseSampleOrderTypeNV
      [(CoarseSampleOrderTypeNV, String)]
showTableCoarseSampleOrderTypeNV
      String
conNameCoarseSampleOrderTypeNV
      (\(CoarseSampleOrderTypeNV Int32
x) -> Int32
x)
      (forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)

instance Read CoarseSampleOrderTypeNV where
  readPrec :: ReadPrec CoarseSampleOrderTypeNV
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixCoarseSampleOrderTypeNV
      [(CoarseSampleOrderTypeNV, String)]
showTableCoarseSampleOrderTypeNV
      String
conNameCoarseSampleOrderTypeNV
      Int32 -> CoarseSampleOrderTypeNV
CoarseSampleOrderTypeNV

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 :: forall a. Integral a => a
$mNV_SHADING_RATE_IMAGE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> 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 :: forall a. (Eq a, IsString a) => a
$mNV_SHADING_RATE_IMAGE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
NV_SHADING_RATE_IMAGE_EXTENSION_NAME = "VK_NV_shading_rate_image"