{-# language CPP #-}
-- | = Name
--
-- VK_NVX_multiview_per_view_attributes - device extension
--
-- = VK_NVX_multiview_per_view_attributes
--
-- [__Name String__]
--     @VK_NVX_multiview_per_view_attributes@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     98
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_multiview VK_KHR_multiview>
--     or
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Vulkan Version 1.1>
--
-- [__API Interactions__]
--
--     -   Interacts with VK_VERSION_1_3
--
--     -   Interacts with VK_KHR_dynamic_rendering
--
-- [__SPIR-V Dependencies__]
--
--     -   <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/NVX/SPV_NVX_multiview_per_view_attributes.html SPV_NVX_multiview_per_view_attributes>
--
-- [__Contact__]
--
--     -   Jeff Bolz
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_NVX_multiview_per_view_attributes] @jeffbolznv%0A*Here describe the issue or question you have about the VK_NVX_multiview_per_view_attributes extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2017-01-13
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Interactions and External Dependencies__]
--
--     -   This extension provides API support for
--         <https://github.com/KhronosGroup/GLSL/blob/main/extensions/nvx/GL_NVX_multiview_per_view_attributes.txt GL_NVX_multiview_per_view_attributes>
--
--     -   This extension interacts with @VK_NV_viewport_array2@.
--
-- [__Contributors__]
--
--     -   Jeff Bolz, NVIDIA
--
--     -   Daniel Koch, NVIDIA
--
-- == Description
--
-- This extension adds a new way to write shaders to be used with multiview
-- subpasses, where the attributes for all views are written out by a
-- single invocation of the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#pipelines-graphics-subsets-pre-rasterization pre-rasterization shader stages>.
-- Related SPIR-V and GLSL extensions
-- @SPV_NVX_multiview_per_view_attributes@ and
-- @GL_NVX_multiview_per_view_attributes@ introduce per-view position and
-- viewport mask attributes arrays, and this extension defines how those
-- per-view attribute arrays are interpreted by Vulkan. Pipelines using
-- per-view attributes /may/ only execute the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#pipelines-graphics-subsets-pre-rasterization pre-rasterization shader stages>
-- once for all views rather than once per-view, which reduces redundant
-- shading work.
--
-- A subpass creation flag controls whether the subpass uses this
-- extension. A subpass /must/ either exclusively use this extension or not
-- use it at all.
--
-- Some Vulkan implementations only support the position attribute varying
-- between views in the X component. A subpass can declare via a second
-- creation flag whether all pipelines compiled for this subpass will obey
-- this restriction.
--
-- Shaders that use the new per-view outputs (e.g. @gl_PositionPerViewNV@)
-- /must/ also write the non-per-view output (@gl_Position@), and the
-- values written /must/ be such that
-- @gl_Position = gl_PositionPerViewNV[gl_ViewIndex]@ for all views in the
-- subpass. Implementations are free to either use the per-view outputs or
-- the non-per-view outputs, whichever would be more efficient.
--
-- If the @VK_NV_viewport_array2@ extension is not also supported and
-- enabled, the per-view viewport mask /must/ not be used.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.3 Vulkan Version 1.3>
-- or
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_dynamic_rendering VK_KHR_dynamic_rendering>
-- is supported:
--
-- -   Extending
--     'Vulkan.Core10.CommandBuffer.CommandBufferInheritanceInfo',
--     'Vulkan.Core10.GraphicsPipeline.GraphicsPipelineCreateInfo',
--     'Vulkan.Core13.Promoted_From_VK_KHR_dynamic_rendering.RenderingInfo':
--
--     -   'MultiviewPerViewAttributesInfoNVX'
--
-- == New Enum Constants
--
-- -   'NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME'
--
-- -   'NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX'
--
-- -   Extending
--     'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SubpassDescriptionFlagBits':
--
--     -   'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX'
--
--     -   'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.3 Vulkan Version 1.3>
-- or
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_dynamic_rendering VK_KHR_dynamic_rendering>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX'
--
-- == New Built-In Variables
--
-- -   <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#interfaces-builtin-variables-positionperview PositionPerViewNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#interfaces-builtin-variables-viewportmaskperview ViewportMaskPerViewNV>
--
-- == New SPIR-V Capabilities
--
-- -   <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#spirvenv-capabilities-table-PerViewAttributesNV PerViewAttributesNV>
--
-- == Examples
--
-- > #version 450 core
-- >
-- > #extension GL_KHX_multiview : enable
-- > #extension GL_NVX_multiview_per_view_attributes : enable
-- >
-- > layout(location = 0) in vec4 position;
-- > layout(set = 0, binding = 0) uniform Block { mat4 mvpPerView[2]; } buf;
-- >
-- > void main()
-- > {
-- >     // Output both per-view positions and gl_Position as a function
-- >     // of gl_ViewIndex
-- >     gl_PositionPerViewNV[0] = buf.mvpPerView[0] * position;
-- >     gl_PositionPerViewNV[1] = buf.mvpPerView[1] * position;
-- >     gl_Position = buf.mvpPerView[gl_ViewIndex] * position;
-- > }
--
-- == Version History
--
-- -   Revision 1, 2017-01-13 (Jeff Bolz)
--
--     -   Internal revisions
--
-- == See Also
--
-- No cross-references are available
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#VK_NVX_multiview_per_view_attributes Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_NVX_multiview_per_view_attributes  ( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(..)
                                                               , MultiviewPerViewAttributesInfoNVX(..)
                                                               , NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION
                                                               , pattern NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION
                                                               , NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME
                                                               , pattern NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME
                                                               ) where

import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX))
-- | VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX - Structure
-- describing multiview limits that can be supported by an implementation
--
-- = Description
--
-- If the 'PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX' 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.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NVX_multiview_per_view_attributes VK_NVX_multiview_per_view_attributes>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX = PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
  { -- | #limits-perViewPositionAllComponents# @perViewPositionAllComponents@ is
    -- 'Vulkan.Core10.FundamentalTypes.TRUE' if the implementation supports
    -- per-view position values that differ in components other than the X
    -- component.
    PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX -> Bool
perViewPositionAllComponents :: Bool }
  deriving (Typeable, PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
-> PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX -> Bool
(PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
 -> PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX -> Bool)
-> (PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
    -> PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX -> Bool)
-> Eq PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
-> PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX -> Bool
== :: PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
-> PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX -> Bool
$c/= :: PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
-> PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX -> Bool
/= :: PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
-> PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX)
#endif
deriving instance Show PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX

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

instance FromCStruct PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX where
  peekCStruct :: Ptr PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
-> IO PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
peekCStruct Ptr PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
p = do
    perViewPositionAllComponents <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
p Ptr PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    pure $ PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
             (bool32ToBool perViewPositionAllComponents)

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

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


-- | VkMultiviewPerViewAttributesInfoNVX - Structure specifying the multiview
-- per-attribute properties
--
-- = Description
--
-- When dynamic render pass instances are being used, instead of specifying
-- 'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX'
-- or
-- 'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX'
-- in the subpass description flags, the per-attribute properties of the
-- render pass instance /must/ be specified by the
-- 'MultiviewPerViewAttributesInfoNVX' structure Include the
-- 'MultiviewPerViewAttributesInfoNVX' structure in the @pNext@ chain of
-- 'Vulkan.Core10.GraphicsPipeline.GraphicsPipelineCreateInfo' when
-- creating a graphics pipeline for dynamic rendering,
-- 'Vulkan.Core13.Promoted_From_VK_KHR_dynamic_rendering.RenderingInfo'
-- when starting a dynamic render pass instance, and
-- 'Vulkan.Core10.CommandBuffer.CommandBufferInheritanceInfo' when
-- specifying the dynamic render pass instance parameters for secondary
-- command buffers.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_dynamic_rendering VK_KHR_dynamic_rendering>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NVX_multiview_per_view_attributes VK_NVX_multiview_per_view_attributes>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_3 VK_VERSION_1_3>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data MultiviewPerViewAttributesInfoNVX = MultiviewPerViewAttributesInfoNVX
  { -- | @perViewAttributes@ specifies that shaders compiled for this pipeline
    -- write the attributes for all views in a single invocation of each vertex
    -- processing stage. All pipelines executed within a render pass instance
    -- that includes this bit /must/ write per-view attributes to the
    -- @*PerViewNV[]@ shader outputs, in addition to the non-per-view (e.g.
    -- @Position@) outputs.
    MultiviewPerViewAttributesInfoNVX -> Bool
perViewAttributes :: Bool
  , -- | @perViewAttributesPositionXOnly@ specifies that shaders compiled for
    -- this pipeline use per-view positions which only differ in value in the x
    -- component. Per-view viewport mask /can/ also be used.
    MultiviewPerViewAttributesInfoNVX -> Bool
perViewAttributesPositionXOnly :: Bool
  }
  deriving (Typeable, MultiviewPerViewAttributesInfoNVX
-> MultiviewPerViewAttributesInfoNVX -> Bool
(MultiviewPerViewAttributesInfoNVX
 -> MultiviewPerViewAttributesInfoNVX -> Bool)
-> (MultiviewPerViewAttributesInfoNVX
    -> MultiviewPerViewAttributesInfoNVX -> Bool)
-> Eq MultiviewPerViewAttributesInfoNVX
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MultiviewPerViewAttributesInfoNVX
-> MultiviewPerViewAttributesInfoNVX -> Bool
== :: MultiviewPerViewAttributesInfoNVX
-> MultiviewPerViewAttributesInfoNVX -> Bool
$c/= :: MultiviewPerViewAttributesInfoNVX
-> MultiviewPerViewAttributesInfoNVX -> Bool
/= :: MultiviewPerViewAttributesInfoNVX
-> MultiviewPerViewAttributesInfoNVX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (MultiviewPerViewAttributesInfoNVX)
#endif
deriving instance Show MultiviewPerViewAttributesInfoNVX

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

instance FromCStruct MultiviewPerViewAttributesInfoNVX where
  peekCStruct :: Ptr MultiviewPerViewAttributesInfoNVX
-> IO MultiviewPerViewAttributesInfoNVX
peekCStruct Ptr MultiviewPerViewAttributesInfoNVX
p = do
    perViewAttributes <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr MultiviewPerViewAttributesInfoNVX
p Ptr MultiviewPerViewAttributesInfoNVX -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    perViewAttributesPositionXOnly <- peek @Bool32 ((p `plusPtr` 20 :: Ptr Bool32))
    pure $ MultiviewPerViewAttributesInfoNVX
             (bool32ToBool perViewAttributes)
             (bool32ToBool perViewAttributesPositionXOnly)

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

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


type NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION"
pattern NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION :: forall a . Integral a => a
pattern $mNVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bNVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION :: forall a. Integral a => a
NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION = 1


type NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME = "VK_NVX_multiview_per_view_attributes"

-- No documentation found for TopLevel "VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME"
pattern NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mNVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bNVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME = "VK_NVX_multiview_per_view_attributes"