packages feed

vulkan-3.27: src/Vulkan/Core10/Enums/MemoryHeapFlagBits.hs

{-# language CPP #-}
-- No documentation found for Chapter "MemoryHeapFlagBits"
module Vulkan.Core10.Enums.MemoryHeapFlagBits  ( MemoryHeapFlags
                                               , MemoryHeapFlagBits( MEMORY_HEAP_DEVICE_LOCAL_BIT
                                                                   , MEMORY_HEAP_TILE_MEMORY_BIT_QCOM
                                                                   , MEMORY_HEAP_SEU_SAFE_BIT
                                                                   , MEMORY_HEAP_MULTI_INSTANCE_BIT
                                                                   , ..
                                                                   )
                                               ) where

import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import GHC.Show (showString)
import Numeric (showHex)
import Vulkan.Zero (Zero)
import Foreign.Storable (Storable)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Vulkan.Core10.FundamentalTypes (Flags)
type MemoryHeapFlags = MemoryHeapFlagBits

-- | VkMemoryHeapFlagBits - Bitmask specifying attribute flags for a heap
--
-- = Description
--
-- -   'MEMORY_HEAP_DEVICE_LOCAL_BIT' specifies that the heap corresponds
--     to device-local memory. Device-local memory /may/ have different
--     performance characteristics than host-local memory, and /may/
--     support different memory property flags.
--
-- -   'MEMORY_HEAP_MULTI_INSTANCE_BIT' specifies that in a logical device
--     representing more than one physical device, there is a per-physical
--     device instance of the heap memory. By default, an allocation from
--     such a heap will be replicated to each physical device’s instance of
--     the heap.
--
-- -   'MEMORY_HEAP_TILE_MEMORY_BIT_QCOM' bit specifies that the heap
--     corresponds to tile memory.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>,
-- 'MemoryHeapFlags'
newtype MemoryHeapFlagBits = MemoryHeapFlagBits Flags
  deriving newtype (Eq, Ord, Storable, Zero, Bits, FiniteBits)

-- No documentation found for Nested "VkMemoryHeapFlagBits" "VK_MEMORY_HEAP_DEVICE_LOCAL_BIT"
pattern MEMORY_HEAP_DEVICE_LOCAL_BIT = MemoryHeapFlagBits 0x00000001

-- No documentation found for Nested "VkMemoryHeapFlagBits" "VK_MEMORY_HEAP_TILE_MEMORY_BIT_QCOM"
pattern MEMORY_HEAP_TILE_MEMORY_BIT_QCOM = MemoryHeapFlagBits 0x00000008

-- No documentation found for Nested "VkMemoryHeapFlagBits" "VK_MEMORY_HEAP_SEU_SAFE_BIT"
pattern MEMORY_HEAP_SEU_SAFE_BIT = MemoryHeapFlagBits 0x00000004

-- No documentation found for Nested "VkMemoryHeapFlagBits" "VK_MEMORY_HEAP_MULTI_INSTANCE_BIT"
pattern MEMORY_HEAP_MULTI_INSTANCE_BIT = MemoryHeapFlagBits 0x00000002

conNameMemoryHeapFlagBits :: String
conNameMemoryHeapFlagBits = "MemoryHeapFlagBits"

enumPrefixMemoryHeapFlagBits :: String
enumPrefixMemoryHeapFlagBits = "MEMORY_HEAP_"

showTableMemoryHeapFlagBits :: [(MemoryHeapFlagBits, String)]
showTableMemoryHeapFlagBits =
  [
    ( MEMORY_HEAP_DEVICE_LOCAL_BIT
    , "DEVICE_LOCAL_BIT"
    )
  ,
    ( MEMORY_HEAP_TILE_MEMORY_BIT_QCOM
    , "TILE_MEMORY_BIT_QCOM"
    )
  , (MEMORY_HEAP_SEU_SAFE_BIT, "SEU_SAFE_BIT")
  ,
    ( MEMORY_HEAP_MULTI_INSTANCE_BIT
    , "MULTI_INSTANCE_BIT"
    )
  ]

instance Show MemoryHeapFlagBits where
  showsPrec =
    enumShowsPrec
      enumPrefixMemoryHeapFlagBits
      showTableMemoryHeapFlagBits
      conNameMemoryHeapFlagBits
      (\(MemoryHeapFlagBits x) -> x)
      (\x -> showString "0x" . showHex x)

instance Read MemoryHeapFlagBits where
  readPrec =
    enumReadPrec
      enumPrefixMemoryHeapFlagBits
      showTableMemoryHeapFlagBits
      conNameMemoryHeapFlagBits
      MemoryHeapFlagBits