{-# language CPP #-}
-- | = Name
--
-- VK_QCOM_tile_memory_heap - device extension
--
-- = VK_QCOM_tile_memory_heap
--
-- [__Name String__]
--     @VK_QCOM_tile_memory_heap@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     548
--
-- [__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_get_memory_requirements2 VK_KHR_get_memory_requirements2>
--          and
--         
--     <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>
--     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_QCOM_tile_properties
--
-- [__Contact__]
--
--     -   Patrick Boyle
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_QCOM_tile_memory_heap] @pboyleQCOM%0A*Here describe the issue or question you have about the VK_QCOM_tile_memory_heap extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_QCOM_tile_memory_heap.adoc VK_QCOM_tile_memory_heap>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2025-05-05
--
-- [__Interactions and External Dependencies__]
--
--     -   Interacts with @VK_QCOM_tile_properties@
--
--     -   Interacts with @VK_QCOM_tile_shading@
--
-- [__Contributors__]
--
--     -   Patrick Boyle, Qualcomm Technologies, Inc.
--
--     -   Matthew Netsch, Qualcomm Technologies, Inc.
--
--     -   Srihari Babu Alla, Qualcomm Technologies, Inc.
--
--     -   Kevin Matlage, Qualcomm Technologies, Inc.
--
-- == Description
--
-- This extension adds a new memory heap which allows applications to
-- allocate and manage tile memory. A tile memory heap is denoted by the
-- new
-- 'Vulkan.Core10.Enums.MemoryHeapFlagBits.MEMORY_HEAP_TILE_MEMORY_BIT_QCOM'
-- property. Memory contents within this heap behave differently than other
-- heaps and only persist its memory contents within a command buffer
-- submission batch boundary. This boundary may be extended to a queue
-- submit boundary by querying @queueSubmitBoundary@ in the new
-- 'PhysicalDeviceTileMemoryHeapPropertiesQCOM' structure.
--
-- Tile memory from this heap can be bound to VkImages or VkBuffers. The
-- following new usage flags
-- 'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TILE_MEMORY_BIT_QCOM',
-- 'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_TILE_MEMORY_BIT_QCOM',
-- 'Vulkan.Core14.Enums.BufferUsageFlags2.BUFFER_USAGE_2_TILE_MEMORY_BIT_QCOM'
-- were added for this. A new extended structure is added to get memory
-- requirements for tile memory 'TileMemoryRequirementsQCOM'.
--
-- A new command is added to bind tile memory to a command buffer in order
-- to access and persist tile memory contents while executing commands
-- 'cmdBindTileMemoryQCOM'.
--
-- This extension can be used in combination with
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_tile_properties VK_QCOM_tile_properties>
-- with the new structure 'TileMemorySizeInfoQCOM'.
--
-- == Issues
--
-- None.
--
-- == New Commands
--
-- -   'cmdBindTileMemoryQCOM'
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core10.CommandBuffer.CommandBufferInheritanceInfo':
--
--     -   'TileMemoryBindInfoQCOM'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.MemoryRequirements2':
--
--     -   'TileMemoryRequirementsQCOM'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceTileMemoryHeapFeaturesQCOM'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceTileMemoryHeapPropertiesQCOM'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_tile_properties VK_QCOM_tile_properties>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Pass.RenderPassCreateInfo',
--     'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.RenderPassCreateInfo2',
--     'Vulkan.Core13.Promoted_From_VK_KHR_dynamic_rendering.RenderingInfo':
--
--     -   'TileMemorySizeInfoQCOM'
--
-- == New Enum Constants
--
-- -   'QCOM_TILE_MEMORY_HEAP_EXTENSION_NAME'
--
-- -   'QCOM_TILE_MEMORY_HEAP_SPEC_VERSION'
--
-- -   Extending
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BufferUsageFlagBits':
--
--     -   'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_TILE_MEMORY_BIT_QCOM'
--
-- -   Extending
--     'Vulkan.Core14.Enums.BufferUsageFlags2.BufferUsageFlagBits2':
--
--     -   'Vulkan.Core14.Enums.BufferUsageFlags2.BUFFER_USAGE_2_TILE_MEMORY_BIT_QCOM'
--
-- -   Extending
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.ImageUsageFlagBits':
--
--     -   'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TILE_MEMORY_BIT_QCOM'
--
-- -   Extending
--     'Vulkan.Core10.Enums.MemoryHeapFlagBits.MemoryHeapFlagBits':
--
--     -   'Vulkan.Core10.Enums.MemoryHeapFlagBits.MEMORY_HEAP_TILE_MEMORY_BIT_QCOM'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_MEMORY_HEAP_FEATURES_QCOM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_MEMORY_HEAP_PROPERTIES_QCOM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TILE_MEMORY_BIND_INFO_QCOM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TILE_MEMORY_REQUIREMENTS_QCOM'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_tile_properties VK_QCOM_tile_properties>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TILE_MEMORY_SIZE_INFO_QCOM'
--
-- == Version History
--
-- -   Revision 1, 2025-03-26 (Patrick Boyle)
--
--     -   Initial version
--
-- == 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_QCOM_tile_memory_heap Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_QCOM_tile_memory_heap  ( cmdBindTileMemoryQCOM
                                                   , TileMemoryBindInfoQCOM(..)
                                                   , PhysicalDeviceTileMemoryHeapFeaturesQCOM(..)
                                                   , PhysicalDeviceTileMemoryHeapPropertiesQCOM(..)
                                                   , TileMemorySizeInfoQCOM(..)
                                                   , TileMemoryRequirementsQCOM(..)
                                                   , QCOM_TILE_MEMORY_HEAP_SPEC_VERSION
                                                   , pattern QCOM_TILE_MEMORY_HEAP_SPEC_VERSION
                                                   , QCOM_TILE_MEMORY_HEAP_EXTENSION_NAME
                                                   , pattern QCOM_TILE_MEMORY_HEAP_EXTENSION_NAME
                                                   ) where

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 Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
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(pVkCmdBindTileMemoryQCOM))
import Vulkan.Core10.Handles (DeviceMemory)
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_MEMORY_HEAP_FEATURES_QCOM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_MEMORY_HEAP_PROPERTIES_QCOM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TILE_MEMORY_BIND_INFO_QCOM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TILE_MEMORY_REQUIREMENTS_QCOM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TILE_MEMORY_SIZE_INFO_QCOM))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdBindTileMemoryQCOM
  :: FunPtr (Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ()) -> Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ()

-- | vkCmdBindTileMemoryQCOM - Bind tile memory to a command buffer
--
-- = Description
--
-- Calling 'cmdBindTileMemoryQCOM' when @pTileMemoryBindInfo@ is @NULL@ is
-- equivalent to binding no tile memory to the command buffer.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdBindTileMemoryQCOM-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdBindTileMemoryQCOM-pTileMemoryBindInfo-parameter# If
--     @pTileMemoryBindInfo@ is not @NULL@, @pTileMemoryBindInfo@ /must/ be
--     a valid pointer to a valid 'TileMemoryBindInfoQCOM' structure
--
-- -   #VUID-vkCmdBindTileMemoryQCOM-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-vkCmdBindTileMemoryQCOM-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT', or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdBindTileMemoryQCOM-renderpass# This command /must/ only
--     be called outside of a render pass instance
--
-- -   #VUID-vkCmdBindTileMemoryQCOM-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                                                                                                                    | Outside                                                                                                                | Outside                                                                                                                     | VK_QUEUE_COMPUTE_BIT                                                                                                  | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | VK_QUEUE_GRAPHICS_BIT                                                                                                 |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdBindTileMemoryQCOM is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_tile_memory_heap VK_QCOM_tile_memory_heap>,
-- 'Vulkan.Core10.Handles.CommandBuffer', 'TileMemoryBindInfoQCOM'
cmdBindTileMemoryQCOM :: forall io
                       . (MonadIO io)
                      => -- | @commandBuffer@ is the command buffer that the tile memory will be bound
                         -- to.
                         CommandBuffer
                      -> -- | @pTileMemoryBindInfo@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a
                         -- pointer to a 'TileMemoryBindInfoQCOM' structure defining how tile memory
                         -- is bound.
                         ("tileMemoryBindInfo" ::: Maybe TileMemoryBindInfoQCOM)
                      -> io ()
cmdBindTileMemoryQCOM :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> ("tileMemoryBindInfo" ::: Maybe TileMemoryBindInfoQCOM) -> io ()
cmdBindTileMemoryQCOM CommandBuffer
commandBuffer "tileMemoryBindInfo" ::: Maybe TileMemoryBindInfoQCOM
tileMemoryBindInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdBindTileMemoryQCOMPtr :: FunPtr (Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ())
vkCmdBindTileMemoryQCOMPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ())
pVkCmdBindTileMemoryQCOM (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ())
vkCmdBindTileMemoryQCOMPtr FunPtr (Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdBindTileMemoryQCOM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdBindTileMemoryQCOM' :: Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ()
vkCmdBindTileMemoryQCOM' = FunPtr (Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ())
-> Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ()
mkVkCmdBindTileMemoryQCOM FunPtr (Ptr CommandBuffer_T -> Ptr TileMemoryBindInfoQCOM -> IO ())
vkCmdBindTileMemoryQCOMPtr
  pTileMemoryBindInfo <- case ("tileMemoryBindInfo" ::: Maybe TileMemoryBindInfoQCOM
tileMemoryBindInfo) of
    "tileMemoryBindInfo" ::: Maybe TileMemoryBindInfoQCOM
Nothing -> Ptr TileMemoryBindInfoQCOM
-> ContT () IO (Ptr TileMemoryBindInfoQCOM)
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr TileMemoryBindInfoQCOM
forall a. Ptr a
nullPtr
    Just TileMemoryBindInfoQCOM
j -> ((Ptr TileMemoryBindInfoQCOM -> IO ()) -> IO ())
-> ContT () IO (Ptr TileMemoryBindInfoQCOM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr TileMemoryBindInfoQCOM -> IO ()) -> IO ())
 -> ContT () IO (Ptr TileMemoryBindInfoQCOM))
-> ((Ptr TileMemoryBindInfoQCOM -> IO ()) -> IO ())
-> ContT () IO (Ptr TileMemoryBindInfoQCOM)
forall a b. (a -> b) -> a -> b
$ TileMemoryBindInfoQCOM
-> (Ptr TileMemoryBindInfoQCOM -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
TileMemoryBindInfoQCOM
-> (Ptr TileMemoryBindInfoQCOM -> IO b) -> IO b
withCStruct (TileMemoryBindInfoQCOM
j)
  lift $ traceAroundEvent "vkCmdBindTileMemoryQCOM" (vkCmdBindTileMemoryQCOM'
                                                       (commandBufferHandle (commandBuffer))
                                                       pTileMemoryBindInfo)
  pure $ ()


-- | VkTileMemoryBindInfoQCOM - Structure specifying tile memory to bind
--
-- = Description
--
-- @memory@ is used to bind this memory object to tile memory for all
-- subsequent commands in the @commandBuffer@. Tile memory contents for
-- ranges in the heap outside the bound @memory@ are discarded and become
-- undefined for the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#memory-tile-heaps active tile memory scope>
-- if an action command is executed.
--
-- For secondary command buffers executing within a render pass instance,
-- the active bound tile memory object is provided with this structure
-- included in the @pNext@ chain of
-- 'Vulkan.Core10.CommandBuffer.CommandBufferInheritanceInfo'.
--
-- If this structure was not specified since recording started for
-- @commandBuffer@, no tile memory is bound to the command buffer and all
-- contents become undefined for the /tile memory scope/ if an action
-- command is executed.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_tile_memory_heap VK_QCOM_tile_memory_heap>,
-- 'Vulkan.Core10.Handles.DeviceMemory',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdBindTileMemoryQCOM'
data TileMemoryBindInfoQCOM = TileMemoryBindInfoQCOM
  { -- | @memory@ is the tile memory object to be bound.
    --
    -- #VUID-VkTileMemoryBindInfoQCOM-memory-10726# @memory@ /must/ have been
    -- allocated from a 'Vulkan.Core10.DeviceInitialization.MemoryHeap' with
    -- the
    -- 'Vulkan.Core10.Enums.MemoryHeapFlagBits.MEMORY_HEAP_TILE_MEMORY_BIT_QCOM'
    -- property
    --
    -- #VUID-VkTileMemoryBindInfoQCOM-memory-parameter# @memory@ /must/ be a
    -- valid 'Vulkan.Core10.Handles.DeviceMemory' handle
    TileMemoryBindInfoQCOM -> DeviceMemory
memory :: DeviceMemory }
  deriving (Typeable, TileMemoryBindInfoQCOM -> TileMemoryBindInfoQCOM -> Bool
(TileMemoryBindInfoQCOM -> TileMemoryBindInfoQCOM -> Bool)
-> (TileMemoryBindInfoQCOM -> TileMemoryBindInfoQCOM -> Bool)
-> Eq TileMemoryBindInfoQCOM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TileMemoryBindInfoQCOM -> TileMemoryBindInfoQCOM -> Bool
== :: TileMemoryBindInfoQCOM -> TileMemoryBindInfoQCOM -> Bool
$c/= :: TileMemoryBindInfoQCOM -> TileMemoryBindInfoQCOM -> Bool
/= :: TileMemoryBindInfoQCOM -> TileMemoryBindInfoQCOM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TileMemoryBindInfoQCOM)
#endif
deriving instance Show TileMemoryBindInfoQCOM

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

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

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

instance Zero TileMemoryBindInfoQCOM where
  zero :: TileMemoryBindInfoQCOM
zero = DeviceMemory -> TileMemoryBindInfoQCOM
TileMemoryBindInfoQCOM
           DeviceMemory
forall a. Zero a => a
zero


-- | VkPhysicalDeviceTileMemoryHeapFeaturesQCOM - Structure describing
-- whether the tile memory heap features can be supported by an
-- implementation
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceTileMemoryHeapFeaturesQCOM' 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. If the application wishes to use a
-- 'Vulkan.Core10.Handles.Device' with any features described by
-- 'PhysicalDeviceTileMemoryHeapFeaturesQCOM', it /must/ add an instance of
-- the structure, with the desired feature members set to
-- 'Vulkan.Core10.FundamentalTypes.TRUE', to the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' when creating the
-- 'Vulkan.Core10.Handles.Device'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_tile_memory_heap VK_QCOM_tile_memory_heap>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceTileMemoryHeapFeaturesQCOM = PhysicalDeviceTileMemoryHeapFeaturesQCOM
  { -- | #features-tileMemoryHeap# @tileMemoryHeap@ indicates whether the
    -- implementation supports tile memory heap functionality.
    PhysicalDeviceTileMemoryHeapFeaturesQCOM -> Bool
tileMemoryHeap :: Bool }
  deriving (Typeable, PhysicalDeviceTileMemoryHeapFeaturesQCOM
-> PhysicalDeviceTileMemoryHeapFeaturesQCOM -> Bool
(PhysicalDeviceTileMemoryHeapFeaturesQCOM
 -> PhysicalDeviceTileMemoryHeapFeaturesQCOM -> Bool)
-> (PhysicalDeviceTileMemoryHeapFeaturesQCOM
    -> PhysicalDeviceTileMemoryHeapFeaturesQCOM -> Bool)
-> Eq PhysicalDeviceTileMemoryHeapFeaturesQCOM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceTileMemoryHeapFeaturesQCOM
-> PhysicalDeviceTileMemoryHeapFeaturesQCOM -> Bool
== :: PhysicalDeviceTileMemoryHeapFeaturesQCOM
-> PhysicalDeviceTileMemoryHeapFeaturesQCOM -> Bool
$c/= :: PhysicalDeviceTileMemoryHeapFeaturesQCOM
-> PhysicalDeviceTileMemoryHeapFeaturesQCOM -> Bool
/= :: PhysicalDeviceTileMemoryHeapFeaturesQCOM
-> PhysicalDeviceTileMemoryHeapFeaturesQCOM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceTileMemoryHeapFeaturesQCOM)
#endif
deriving instance Show PhysicalDeviceTileMemoryHeapFeaturesQCOM

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

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

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


-- | VkPhysicalDeviceTileMemoryHeapPropertiesQCOM - Structure describing tile
-- memory heap properties that can be supported by an implementation
--
-- = Description
--
-- If the 'PhysicalDeviceTileMemoryHeapPropertiesQCOM' 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_QCOM_tile_memory_heap VK_QCOM_tile_memory_heap>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceTileMemoryHeapPropertiesQCOM = PhysicalDeviceTileMemoryHeapPropertiesQCOM
  { -- | #limits-queueSubmitBoundary# @queueSubmitBoundary@ is a boolean
    -- describing if tile memory becomes undefined at a queue submit boundary
    -- instead of the default command buffer submission batch boundary.
    PhysicalDeviceTileMemoryHeapPropertiesQCOM -> Bool
queueSubmitBoundary :: Bool
  , -- | #limits-tileBufferTransfers# @tileBufferTransfers@ is a boolean
    -- describing if buffers bound to tile memory support transfer operations.
    PhysicalDeviceTileMemoryHeapPropertiesQCOM -> Bool
tileBufferTransfers :: Bool
  }
  deriving (Typeable, PhysicalDeviceTileMemoryHeapPropertiesQCOM
-> PhysicalDeviceTileMemoryHeapPropertiesQCOM -> Bool
(PhysicalDeviceTileMemoryHeapPropertiesQCOM
 -> PhysicalDeviceTileMemoryHeapPropertiesQCOM -> Bool)
-> (PhysicalDeviceTileMemoryHeapPropertiesQCOM
    -> PhysicalDeviceTileMemoryHeapPropertiesQCOM -> Bool)
-> Eq PhysicalDeviceTileMemoryHeapPropertiesQCOM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceTileMemoryHeapPropertiesQCOM
-> PhysicalDeviceTileMemoryHeapPropertiesQCOM -> Bool
== :: PhysicalDeviceTileMemoryHeapPropertiesQCOM
-> PhysicalDeviceTileMemoryHeapPropertiesQCOM -> Bool
$c/= :: PhysicalDeviceTileMemoryHeapPropertiesQCOM
-> PhysicalDeviceTileMemoryHeapPropertiesQCOM -> Bool
/= :: PhysicalDeviceTileMemoryHeapPropertiesQCOM
-> PhysicalDeviceTileMemoryHeapPropertiesQCOM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceTileMemoryHeapPropertiesQCOM)
#endif
deriving instance Show PhysicalDeviceTileMemoryHeapPropertiesQCOM

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

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

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


-- | VkTileMemorySizeInfoQCOM - Structure describing tile memory size in use
-- in a render pass instance
--
-- = Description
--
-- The returned tile properties are invalid if the @size@ is not equal to
-- the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#memory-bind-tile-memory bound tile memory’s>
-- allocation size when the render pass is executed.
--
-- If this structure is not provided, the @size@ of the reserved region
-- defaults to @0@.
--
-- Tile memory is reserved for application use by binding tile memory
-- objects to the command buffer.
--
-- The size provided by this command is informational only for use when
-- evaluating tile properties. If the application does not need to query
-- the tile properties, then this size /can/ be safely omitted.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_tile_memory_heap VK_QCOM_tile_memory_heap>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_tile_properties VK_QCOM_tile_properties>,
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data TileMemorySizeInfoQCOM = TileMemorySizeInfoQCOM
  { -- | @size@ is the size in bytes of tile memory used by the render pass or
    -- preserved for later use.
    --
    -- #VUID-VkTileMemorySizeInfoQCOM-size-10729# @size@ must be less than or
    -- equal to the largest size memory heap with the
    -- 'Vulkan.Core10.Enums.MemoryHeapFlagBits.MEMORY_HEAP_TILE_MEMORY_BIT_QCOM'
    -- property
    TileMemorySizeInfoQCOM -> DeviceSize
size :: DeviceSize }
  deriving (Typeable, TileMemorySizeInfoQCOM -> TileMemorySizeInfoQCOM -> Bool
(TileMemorySizeInfoQCOM -> TileMemorySizeInfoQCOM -> Bool)
-> (TileMemorySizeInfoQCOM -> TileMemorySizeInfoQCOM -> Bool)
-> Eq TileMemorySizeInfoQCOM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TileMemorySizeInfoQCOM -> TileMemorySizeInfoQCOM -> Bool
== :: TileMemorySizeInfoQCOM -> TileMemorySizeInfoQCOM -> Bool
$c/= :: TileMemorySizeInfoQCOM -> TileMemorySizeInfoQCOM -> Bool
/= :: TileMemorySizeInfoQCOM -> TileMemorySizeInfoQCOM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TileMemorySizeInfoQCOM)
#endif
deriving instance Show TileMemorySizeInfoQCOM

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

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

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

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


-- | VkTileMemoryRequirementsQCOM - Structure specifying tile memory
-- requirements
--
-- = Description
--
-- The @size@ and @alignment@ /must/ be used when the resource is bound to
-- a 'Vulkan.Core10.Handles.DeviceMemory' object that was allocated from a
-- 'Vulkan.Core10.DeviceInitialization.MemoryType' that has a @heapIndex@
-- that corresponds to a 'Vulkan.Core10.DeviceInitialization.MemoryHeap'
-- with the
-- 'Vulkan.Core10.Enums.MemoryHeapFlagBits.MEMORY_HEAP_TILE_MEMORY_BIT_QCOM'
-- property.
--
-- If the resource cannot be bound to tile memory, then @size@ and
-- @alignment@ is filled with zero by the implementation.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_tile_memory_heap VK_QCOM_tile_memory_heap>,
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data TileMemoryRequirementsQCOM = TileMemoryRequirementsQCOM
  { -- | @size@ is the size, in bytes, of the tile memory allocation required for
    -- the resource.
    TileMemoryRequirementsQCOM -> DeviceSize
size :: DeviceSize
  , -- | @alignment@ is the alignment, in bytes, of the offset within the tile
    -- memory allocation required for the resource.
    TileMemoryRequirementsQCOM -> DeviceSize
alignment :: DeviceSize
  }
  deriving (Typeable, TileMemoryRequirementsQCOM -> TileMemoryRequirementsQCOM -> Bool
(TileMemoryRequirementsQCOM -> TileMemoryRequirementsQCOM -> Bool)
-> (TileMemoryRequirementsQCOM
    -> TileMemoryRequirementsQCOM -> Bool)
-> Eq TileMemoryRequirementsQCOM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TileMemoryRequirementsQCOM -> TileMemoryRequirementsQCOM -> Bool
== :: TileMemoryRequirementsQCOM -> TileMemoryRequirementsQCOM -> Bool
$c/= :: TileMemoryRequirementsQCOM -> TileMemoryRequirementsQCOM -> Bool
/= :: TileMemoryRequirementsQCOM -> TileMemoryRequirementsQCOM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TileMemoryRequirementsQCOM)
#endif
deriving instance Show TileMemoryRequirementsQCOM

instance ToCStruct TileMemoryRequirementsQCOM where
  withCStruct :: forall b.
TileMemoryRequirementsQCOM
-> (Ptr TileMemoryRequirementsQCOM -> IO b) -> IO b
withCStruct TileMemoryRequirementsQCOM
x Ptr TileMemoryRequirementsQCOM -> IO b
f = Int -> (Ptr TileMemoryRequirementsQCOM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr TileMemoryRequirementsQCOM -> IO b) -> IO b)
-> (Ptr TileMemoryRequirementsQCOM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr TileMemoryRequirementsQCOM
p -> Ptr TileMemoryRequirementsQCOM
-> TileMemoryRequirementsQCOM -> IO b -> IO b
forall b.
Ptr TileMemoryRequirementsQCOM
-> TileMemoryRequirementsQCOM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TileMemoryRequirementsQCOM
p TileMemoryRequirementsQCOM
x (Ptr TileMemoryRequirementsQCOM -> IO b
f Ptr TileMemoryRequirementsQCOM
p)
  pokeCStruct :: forall b.
Ptr TileMemoryRequirementsQCOM
-> TileMemoryRequirementsQCOM -> IO b -> IO b
pokeCStruct Ptr TileMemoryRequirementsQCOM
p TileMemoryRequirementsQCOM{DeviceSize
size :: TileMemoryRequirementsQCOM -> DeviceSize
alignment :: TileMemoryRequirementsQCOM -> DeviceSize
size :: DeviceSize
alignment :: DeviceSize
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TileMemoryRequirementsQCOM
p Ptr TileMemoryRequirementsQCOM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TILE_MEMORY_REQUIREMENTS_QCOM)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TileMemoryRequirementsQCOM
p Ptr TileMemoryRequirementsQCOM -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TileMemoryRequirementsQCOM
p Ptr TileMemoryRequirementsQCOM -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (DeviceSize
size)
    Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TileMemoryRequirementsQCOM
p Ptr TileMemoryRequirementsQCOM -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) (DeviceSize
alignment)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr TileMemoryRequirementsQCOM -> IO b -> IO b
pokeZeroCStruct Ptr TileMemoryRequirementsQCOM
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TileMemoryRequirementsQCOM
p Ptr TileMemoryRequirementsQCOM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TILE_MEMORY_REQUIREMENTS_QCOM)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TileMemoryRequirementsQCOM
p Ptr TileMemoryRequirementsQCOM -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TileMemoryRequirementsQCOM
p Ptr TileMemoryRequirementsQCOM -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (DeviceSize
forall a. Zero a => a
zero)
    Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TileMemoryRequirementsQCOM
p Ptr TileMemoryRequirementsQCOM -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) (DeviceSize
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct TileMemoryRequirementsQCOM where
  peekCStruct :: Ptr TileMemoryRequirementsQCOM -> IO TileMemoryRequirementsQCOM
peekCStruct Ptr TileMemoryRequirementsQCOM
p = do
    size <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr TileMemoryRequirementsQCOM
p Ptr TileMemoryRequirementsQCOM -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize))
    alignment <- peek @DeviceSize ((p `plusPtr` 24 :: Ptr DeviceSize))
    pure $ TileMemoryRequirementsQCOM
             size alignment

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

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


type QCOM_TILE_MEMORY_HEAP_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_QCOM_TILE_MEMORY_HEAP_SPEC_VERSION"
pattern QCOM_TILE_MEMORY_HEAP_SPEC_VERSION :: forall a . Integral a => a
pattern $mQCOM_TILE_MEMORY_HEAP_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bQCOM_TILE_MEMORY_HEAP_SPEC_VERSION :: forall a. Integral a => a
QCOM_TILE_MEMORY_HEAP_SPEC_VERSION = 1


type QCOM_TILE_MEMORY_HEAP_EXTENSION_NAME = "VK_QCOM_tile_memory_heap"

-- No documentation found for TopLevel "VK_QCOM_TILE_MEMORY_HEAP_EXTENSION_NAME"
pattern QCOM_TILE_MEMORY_HEAP_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mQCOM_TILE_MEMORY_HEAP_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bQCOM_TILE_MEMORY_HEAP_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
QCOM_TILE_MEMORY_HEAP_EXTENSION_NAME = "VK_QCOM_tile_memory_heap"