{-# language CPP #-}
module Vulkan.Extensions.VK_AMD_shader_info  ( getShaderInfoAMD
                                             , ShaderResourceUsageAMD(..)
                                             , ShaderStatisticsInfoAMD(..)
                                             , ShaderInfoTypeAMD( SHADER_INFO_TYPE_STATISTICS_AMD
                                                                , SHADER_INFO_TYPE_BINARY_AMD
                                                                , SHADER_INFO_TYPE_DISASSEMBLY_AMD
                                                                , ..
                                                                )
                                             , AMD_SHADER_INFO_SPEC_VERSION
                                             , pattern AMD_SHADER_INFO_SPEC_VERSION
                                             , AMD_SHADER_INFO_EXTENSION_NAME
                                             , pattern AMD_SHADER_INFO_EXTENSION_NAME
                                             ) where

import Vulkan.CStruct.Utils (FixedArray)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Data.ByteString (packCStringLen)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Foreign.C.Types (CSize(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.C.Types (CChar)
import Foreign.C.Types (CSize)
import Foreign.C.Types (CSize(CSize))
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Data.Int (Int32)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import Data.Word (Word32)
import Data.Word (Word64)
import Text.Read.Lex (Lexeme(Ident))
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Dynamic (DeviceCmds(pVkGetShaderInfoAMD))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Handles (Pipeline)
import Vulkan.Core10.Handles (Pipeline(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlagBits)
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlagBits(..))
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetShaderInfoAMD
  :: FunPtr (Ptr Device_T -> Pipeline -> ShaderStageFlagBits -> ShaderInfoTypeAMD -> Ptr CSize -> Ptr () -> IO Result) -> Ptr Device_T -> Pipeline -> ShaderStageFlagBits -> ShaderInfoTypeAMD -> Ptr CSize -> Ptr () -> IO Result

-- | vkGetShaderInfoAMD - Get information about a shader in a pipeline
--
-- = Description
--
-- If @pInfo@ is @NULL@, then the maximum size of the information that
-- /can/ be retrieved about the shader, in bytes, is returned in
-- @pInfoSize@. Otherwise, @pInfoSize@ /must/ point to a variable set by
-- the user to the size of the buffer, in bytes, pointed to by @pInfo@, and
-- on return the variable is overwritten with the amount of data actually
-- written to @pInfo@.
--
-- If @pInfoSize@ is less than the maximum size that /can/ be retrieved by
-- the pipeline cache, then at most @pInfoSize@ bytes will be written to
-- @pInfo@, and 'getShaderInfoAMD' will return
-- 'Vulkan.Core10.Enums.Result.INCOMPLETE'.
--
-- Not all information is available for every shader and implementations
-- may not support all kinds of information for any shader. When a certain
-- type of information is unavailable, the function returns
-- 'Vulkan.Core10.Enums.Result.ERROR_FEATURE_NOT_PRESENT'.
--
-- If information is successfully and fully queried, the function will
-- return 'Vulkan.Core10.Enums.Result.SUCCESS'.
--
-- For @infoType@ 'SHADER_INFO_TYPE_STATISTICS_AMD', a
-- 'ShaderStatisticsInfoAMD' structure will be written to the buffer
-- pointed to by @pInfo@. This structure will be populated with statistics
-- regarding the physical device resources used by that shader along with
-- other miscellaneous information and is described in further detail
-- below.
--
-- For @infoType@ 'SHADER_INFO_TYPE_DISASSEMBLY_AMD', @pInfo@ is a pointer
-- to a UTF-8 null-terminated string containing human-readable disassembly.
-- The exact formatting and contents of the disassembly string are
-- vendor-specific.
--
-- The formatting and contents of all other types of information, including
-- @infoType@ 'SHADER_INFO_TYPE_BINARY_AMD', are left to the vendor and are
-- not further specified by this extension.
--
-- == Valid Usage (Implicit)
--
-- -   @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   @pipeline@ /must/ be a valid 'Vulkan.Core10.Handles.Pipeline' handle
--
-- -   @shaderStage@ /must/ be a valid
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' value
--
-- -   @infoType@ /must/ be a valid 'ShaderInfoTypeAMD' value
--
-- -   @pInfoSize@ /must/ be a valid pointer to a @size_t@ value
--
-- -   If the value referenced by @pInfoSize@ is not @0@, and @pInfo@ is
--     not @NULL@, @pInfo@ /must/ be a valid pointer to an array of
--     @pInfoSize@ bytes
--
-- -   @pipeline@ /must/ have been created, allocated, or retrieved from
--     @device@
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.INCOMPLETE'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_FEATURE_NOT_PRESENT'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Core10.Handles.Pipeline',
-- 'ShaderInfoTypeAMD',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits'
getShaderInfoAMD :: forall io
                  . (MonadIO io)
                 => -- | @device@ is the device that created @pipeline@.
                    Device
                 -> -- | @pipeline@ is the target of the query.
                    Pipeline
                 -> -- | @shaderStage@ identifies the particular shader within the pipeline about
                    -- which information is being queried.
                    ShaderStageFlagBits
                 -> -- | @infoType@ describes what kind of information is being queried.
                    ShaderInfoTypeAMD
                 -> io (Result, ("info" ::: ByteString))
getShaderInfoAMD :: Device
-> Pipeline
-> ShaderStageFlagBits
-> ShaderInfoTypeAMD
-> io (Result, "info" ::: ByteString)
getShaderInfoAMD device :: Device
device pipeline :: Pipeline
pipeline shaderStage :: ShaderStageFlagBits
shaderStage infoType :: ShaderInfoTypeAMD
infoType = IO (Result, "info" ::: ByteString)
-> io (Result, "info" ::: ByteString)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, "info" ::: ByteString)
 -> io (Result, "info" ::: ByteString))
-> (ContT
      (Result, "info" ::: ByteString) IO (Result, "info" ::: ByteString)
    -> IO (Result, "info" ::: ByteString))
-> ContT
     (Result, "info" ::: ByteString) IO (Result, "info" ::: ByteString)
-> io (Result, "info" ::: ByteString)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, "info" ::: ByteString) IO (Result, "info" ::: ByteString)
-> IO (Result, "info" ::: ByteString)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, "info" ::: ByteString) IO (Result, "info" ::: ByteString)
 -> io (Result, "info" ::: ByteString))
-> ContT
     (Result, "info" ::: ByteString) IO (Result, "info" ::: ByteString)
-> io (Result, "info" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetShaderInfoAMDPtr :: FunPtr
  (Ptr Device_T
   -> Pipeline
   -> ShaderStageFlagBits
   -> ShaderInfoTypeAMD
   -> ("pInfoSize" ::: Ptr CSize)
   -> ("pInfo" ::: Ptr ())
   -> IO Result)
vkGetShaderInfoAMDPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Pipeline
      -> ShaderStageFlagBits
      -> ShaderInfoTypeAMD
      -> ("pInfoSize" ::: Ptr CSize)
      -> ("pInfo" ::: Ptr ())
      -> IO Result)
pVkGetShaderInfoAMD (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT (Result, "info" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "info" ::: ByteString) IO ())
-> IO () -> ContT (Result, "info" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Pipeline
   -> ShaderStageFlagBits
   -> ShaderInfoTypeAMD
   -> ("pInfoSize" ::: Ptr CSize)
   -> ("pInfo" ::: Ptr ())
   -> IO Result)
vkGetShaderInfoAMDPtr FunPtr
  (Ptr Device_T
   -> Pipeline
   -> ShaderStageFlagBits
   -> ShaderInfoTypeAMD
   -> ("pInfoSize" ::: Ptr CSize)
   -> ("pInfo" ::: Ptr ())
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> Pipeline
      -> ShaderStageFlagBits
      -> ShaderInfoTypeAMD
      -> ("pInfoSize" ::: Ptr CSize)
      -> ("pInfo" ::: Ptr ())
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Pipeline
   -> ShaderStageFlagBits
   -> ShaderInfoTypeAMD
   -> ("pInfoSize" ::: Ptr CSize)
   -> ("pInfo" ::: Ptr ())
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetShaderInfoAMD is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetShaderInfoAMD' :: Ptr Device_T
-> Pipeline
-> ShaderStageFlagBits
-> ShaderInfoTypeAMD
-> ("pInfoSize" ::: Ptr CSize)
-> ("pInfo" ::: Ptr ())
-> IO Result
vkGetShaderInfoAMD' = FunPtr
  (Ptr Device_T
   -> Pipeline
   -> ShaderStageFlagBits
   -> ShaderInfoTypeAMD
   -> ("pInfoSize" ::: Ptr CSize)
   -> ("pInfo" ::: Ptr ())
   -> IO Result)
-> Ptr Device_T
-> Pipeline
-> ShaderStageFlagBits
-> ShaderInfoTypeAMD
-> ("pInfoSize" ::: Ptr CSize)
-> ("pInfo" ::: Ptr ())
-> IO Result
mkVkGetShaderInfoAMD FunPtr
  (Ptr Device_T
   -> Pipeline
   -> ShaderStageFlagBits
   -> ShaderInfoTypeAMD
   -> ("pInfoSize" ::: Ptr CSize)
   -> ("pInfo" ::: Ptr ())
   -> IO Result)
vkGetShaderInfoAMDPtr
  let device' :: Ptr Device_T
device' = Device -> Ptr Device_T
deviceHandle (Device
device)
  "pInfoSize" ::: Ptr CSize
pPInfoSize <- ((("pInfoSize" ::: Ptr CSize)
  -> IO (Result, "info" ::: ByteString))
 -> IO (Result, "info" ::: ByteString))
-> ContT
     (Result, "info" ::: ByteString) IO ("pInfoSize" ::: Ptr CSize)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfoSize" ::: Ptr CSize)
   -> IO (Result, "info" ::: ByteString))
  -> IO (Result, "info" ::: ByteString))
 -> ContT
      (Result, "info" ::: ByteString) IO ("pInfoSize" ::: Ptr CSize))
-> ((("pInfoSize" ::: Ptr CSize)
     -> IO (Result, "info" ::: ByteString))
    -> IO (Result, "info" ::: ByteString))
-> ContT
     (Result, "info" ::: ByteString) IO ("pInfoSize" ::: Ptr CSize)
forall a b. (a -> b) -> a -> b
$ IO ("pInfoSize" ::: Ptr CSize)
-> (("pInfoSize" ::: Ptr CSize) -> IO ())
-> (("pInfoSize" ::: Ptr CSize)
    -> IO (Result, "info" ::: ByteString))
-> IO (Result, "info" ::: ByteString)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pInfoSize" ::: Ptr CSize)
forall a. Int -> IO (Ptr a)
callocBytes @CSize 8) ("pInfoSize" ::: Ptr CSize) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT (Result, "info" ::: ByteString) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT (Result, "info" ::: ByteString) IO Result)
-> IO Result -> ContT (Result, "info" ::: ByteString) IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> Pipeline
-> ShaderStageFlagBits
-> ShaderInfoTypeAMD
-> ("pInfoSize" ::: Ptr CSize)
-> ("pInfo" ::: Ptr ())
-> IO Result
vkGetShaderInfoAMD' Ptr Device_T
device' (Pipeline
pipeline) (ShaderStageFlagBits
shaderStage) (ShaderInfoTypeAMD
infoType) ("pInfoSize" ::: Ptr CSize
pPInfoSize) ("pInfo" ::: Ptr ()
forall a. Ptr a
nullPtr)
  IO () -> ContT (Result, "info" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "info" ::: ByteString) IO ())
-> IO () -> ContT (Result, "info" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  CSize
pInfoSize <- IO CSize -> ContT (Result, "info" ::: ByteString) IO CSize
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO CSize -> ContT (Result, "info" ::: ByteString) IO CSize)
-> IO CSize -> ContT (Result, "info" ::: ByteString) IO CSize
forall a b. (a -> b) -> a -> b
$ ("pInfoSize" ::: Ptr CSize) -> IO CSize
forall a. Storable a => Ptr a -> IO a
peek @CSize "pInfoSize" ::: Ptr CSize
pPInfoSize
  "pInfo" ::: Ptr ()
pPInfo <- ((("pInfo" ::: Ptr ()) -> IO (Result, "info" ::: ByteString))
 -> IO (Result, "info" ::: ByteString))
-> ContT (Result, "info" ::: ByteString) IO ("pInfo" ::: Ptr ())
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfo" ::: Ptr ()) -> IO (Result, "info" ::: ByteString))
  -> IO (Result, "info" ::: ByteString))
 -> ContT (Result, "info" ::: ByteString) IO ("pInfo" ::: Ptr ()))
-> ((("pInfo" ::: Ptr ()) -> IO (Result, "info" ::: ByteString))
    -> IO (Result, "info" ::: ByteString))
-> ContT (Result, "info" ::: ByteString) IO ("pInfo" ::: Ptr ())
forall a b. (a -> b) -> a -> b
$ IO ("pInfo" ::: Ptr ())
-> (("pInfo" ::: Ptr ()) -> IO ())
-> (("pInfo" ::: Ptr ()) -> IO (Result, "info" ::: ByteString))
-> IO (Result, "info" ::: ByteString)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pInfo" ::: Ptr ())
forall a. Int -> IO (Ptr a)
callocBytes @(()) (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (((\(CSize a :: Word64
a) -> Word64
a) CSize
pInfoSize)))) ("pInfo" ::: Ptr ()) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r' <- IO Result -> ContT (Result, "info" ::: ByteString) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT (Result, "info" ::: ByteString) IO Result)
-> IO Result -> ContT (Result, "info" ::: ByteString) IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> Pipeline
-> ShaderStageFlagBits
-> ShaderInfoTypeAMD
-> ("pInfoSize" ::: Ptr CSize)
-> ("pInfo" ::: Ptr ())
-> IO Result
vkGetShaderInfoAMD' Ptr Device_T
device' (Pipeline
pipeline) (ShaderStageFlagBits
shaderStage) (ShaderInfoTypeAMD
infoType) ("pInfoSize" ::: Ptr CSize
pPInfoSize) ("pInfo" ::: Ptr ()
pPInfo)
  IO () -> ContT (Result, "info" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "info" ::: ByteString) IO ())
-> IO () -> ContT (Result, "info" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r'))
  CSize
pInfoSize'' <- IO CSize -> ContT (Result, "info" ::: ByteString) IO CSize
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO CSize -> ContT (Result, "info" ::: ByteString) IO CSize)
-> IO CSize -> ContT (Result, "info" ::: ByteString) IO CSize
forall a b. (a -> b) -> a -> b
$ ("pInfoSize" ::: Ptr CSize) -> IO CSize
forall a. Storable a => Ptr a -> IO a
peek @CSize "pInfoSize" ::: Ptr CSize
pPInfoSize
  "info" ::: ByteString
pInfo' <- IO ("info" ::: ByteString)
-> ContT (Result, "info" ::: ByteString) IO ("info" ::: ByteString)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("info" ::: ByteString)
 -> ContT
      (Result, "info" ::: ByteString) IO ("info" ::: ByteString))
-> IO ("info" ::: ByteString)
-> ContT (Result, "info" ::: ByteString) IO ("info" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ CStringLen -> IO ("info" ::: ByteString)
packCStringLen  (("pInfo" ::: Ptr ()) -> Ptr CChar
forall a b. Ptr a -> Ptr b
castPtr @() @CChar "pInfo" ::: Ptr ()
pPInfo, (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (((\(CSize a :: Word64
a) -> Word64
a) CSize
pInfoSize''))))
  (Result, "info" ::: ByteString)
-> ContT
     (Result, "info" ::: ByteString) IO (Result, "info" ::: ByteString)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, "info" ::: ByteString)
 -> ContT
      (Result, "info" ::: ByteString) IO (Result, "info" ::: ByteString))
-> (Result, "info" ::: ByteString)
-> ContT
     (Result, "info" ::: ByteString) IO (Result, "info" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ ((Result
r'), "info" ::: ByteString
pInfo')


-- | VkShaderResourceUsageAMD - Resource usage information about a particular
-- shader within a pipeline
--
-- = See Also
--
-- 'ShaderStatisticsInfoAMD'
data ShaderResourceUsageAMD = ShaderResourceUsageAMD
  { -- | @numUsedVgprs@ is the number of vector instruction general-purpose
    -- registers used by this shader.
    ShaderResourceUsageAMD -> Word32
numUsedVgprs :: Word32
  , -- | @numUsedSgprs@ is the number of scalar instruction general-purpose
    -- registers used by this shader.
    ShaderResourceUsageAMD -> Word32
numUsedSgprs :: Word32
  , -- | @ldsSizePerLocalWorkGroup@ is the maximum local data store size per work
    -- group in bytes.
    ShaderResourceUsageAMD -> Word32
ldsSizePerLocalWorkGroup :: Word32
  , -- | @ldsUsageSizeInBytes@ is the LDS usage size in bytes per work group by
    -- this shader.
    ShaderResourceUsageAMD -> Word64
ldsUsageSizeInBytes :: Word64
  , -- | @scratchMemUsageInBytes@ is the scratch memory usage in bytes by this
    -- shader.
    ShaderResourceUsageAMD -> Word64
scratchMemUsageInBytes :: Word64
  }
  deriving (Typeable, ShaderResourceUsageAMD -> ShaderResourceUsageAMD -> Bool
(ShaderResourceUsageAMD -> ShaderResourceUsageAMD -> Bool)
-> (ShaderResourceUsageAMD -> ShaderResourceUsageAMD -> Bool)
-> Eq ShaderResourceUsageAMD
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShaderResourceUsageAMD -> ShaderResourceUsageAMD -> Bool
$c/= :: ShaderResourceUsageAMD -> ShaderResourceUsageAMD -> Bool
== :: ShaderResourceUsageAMD -> ShaderResourceUsageAMD -> Bool
$c== :: ShaderResourceUsageAMD -> ShaderResourceUsageAMD -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ShaderResourceUsageAMD)
#endif
deriving instance Show ShaderResourceUsageAMD

instance ToCStruct ShaderResourceUsageAMD where
  withCStruct :: ShaderResourceUsageAMD
-> (Ptr ShaderResourceUsageAMD -> IO b) -> IO b
withCStruct x :: ShaderResourceUsageAMD
x f :: Ptr ShaderResourceUsageAMD -> IO b
f = Int -> Int -> (Ptr ShaderResourceUsageAMD -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr ShaderResourceUsageAMD -> IO b) -> IO b)
-> (Ptr ShaderResourceUsageAMD -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ShaderResourceUsageAMD
p -> Ptr ShaderResourceUsageAMD
-> ShaderResourceUsageAMD -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ShaderResourceUsageAMD
p ShaderResourceUsageAMD
x (Ptr ShaderResourceUsageAMD -> IO b
f Ptr ShaderResourceUsageAMD
p)
  pokeCStruct :: Ptr ShaderResourceUsageAMD
-> ShaderResourceUsageAMD -> IO b -> IO b
pokeCStruct p :: Ptr ShaderResourceUsageAMD
p ShaderResourceUsageAMD{..} f :: IO b
f = do
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) (Word32
numUsedVgprs)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) (Word32
numUsedSgprs)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) (Word32
ldsSizePerLocalWorkGroup)
    ("pInfoSize" ::: Ptr CSize) -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> "pInfoSize" ::: Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
ldsUsageSizeInBytes))
    ("pInfoSize" ::: Ptr CSize) -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> "pInfoSize" ::: Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
scratchMemUsageInBytes))
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr ShaderResourceUsageAMD -> IO b -> IO b
pokeZeroCStruct p :: Ptr ShaderResourceUsageAMD
p f :: IO b
f = do
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    ("pInfoSize" ::: Ptr CSize) -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> "pInfoSize" ::: Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
forall a. Zero a => a
zero))
    ("pInfoSize" ::: Ptr CSize) -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> "pInfoSize" ::: Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct ShaderResourceUsageAMD where
  peekCStruct :: Ptr ShaderResourceUsageAMD -> IO ShaderResourceUsageAMD
peekCStruct p :: Ptr ShaderResourceUsageAMD
p = do
    Word32
numUsedVgprs <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32))
    Word32
numUsedSgprs <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32))
    Word32
ldsSizePerLocalWorkGroup <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32))
    CSize
ldsUsageSizeInBytes <- ("pInfoSize" ::: Ptr CSize) -> IO CSize
forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> "pInfoSize" ::: Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CSize))
    CSize
scratchMemUsageInBytes <- ("pInfoSize" ::: Ptr CSize) -> IO CSize
forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr ShaderResourceUsageAMD
p Ptr ShaderResourceUsageAMD -> Int -> "pInfoSize" ::: Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr CSize))
    ShaderResourceUsageAMD -> IO ShaderResourceUsageAMD
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ShaderResourceUsageAMD -> IO ShaderResourceUsageAMD)
-> ShaderResourceUsageAMD -> IO ShaderResourceUsageAMD
forall a b. (a -> b) -> a -> b
$ Word32
-> Word32 -> Word32 -> Word64 -> Word64 -> ShaderResourceUsageAMD
ShaderResourceUsageAMD
             Word32
numUsedVgprs Word32
numUsedSgprs Word32
ldsSizePerLocalWorkGroup ((\(CSize a :: Word64
a) -> Word64
a) CSize
ldsUsageSizeInBytes) ((\(CSize a :: Word64
a) -> Word64
a) CSize
scratchMemUsageInBytes)

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

instance Zero ShaderResourceUsageAMD where
  zero :: ShaderResourceUsageAMD
zero = Word32
-> Word32 -> Word32 -> Word64 -> Word64 -> ShaderResourceUsageAMD
ShaderResourceUsageAMD
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word64
forall a. Zero a => a
zero
           Word64
forall a. Zero a => a
zero


-- | VkShaderStatisticsInfoAMD - Statistical information about a particular
-- shader within a pipeline
--
-- = Description
--
-- Some implementations may merge multiple logical shader stages together
-- in a single shader. In such cases, @shaderStageMask@ will contain a
-- bitmask of all of the stages that are active within that shader.
-- Consequently, if specifying those stages as input to 'getShaderInfoAMD',
-- the same output information /may/ be returned for all such shader stage
-- queries.
--
-- The number of available VGPRs and SGPRs (@numAvailableVgprs@ and
-- @numAvailableSgprs@ respectively) are the shader-addressable subset of
-- physical registers that is given as a limit to the compiler for register
-- assignment. These values /may/ further be limited by implementations due
-- to performance optimizations where register pressure is a bottleneck.
--
-- = See Also
--
-- 'ShaderResourceUsageAMD',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlags'
data ShaderStatisticsInfoAMD = ShaderStatisticsInfoAMD
  { -- | @shaderStageMask@ are the combination of logical shader stages contained
    -- within this shader.
    ShaderStatisticsInfoAMD -> ShaderStageFlagBits
shaderStageMask :: ShaderStageFlags
  , -- | @resourceUsage@ is a 'ShaderResourceUsageAMD' structure describing
    -- internal physical device resources used by this shader.
    ShaderStatisticsInfoAMD -> ShaderResourceUsageAMD
resourceUsage :: ShaderResourceUsageAMD
  , -- | @numPhysicalVgprs@ is the maximum number of vector instruction
    -- general-purpose registers (VGPRs) available to the physical device.
    ShaderStatisticsInfoAMD -> Word32
numPhysicalVgprs :: Word32
  , -- | @numPhysicalSgprs@ is the maximum number of scalar instruction
    -- general-purpose registers (SGPRs) available to the physical device.
    ShaderStatisticsInfoAMD -> Word32
numPhysicalSgprs :: Word32
  , -- | @numAvailableVgprs@ is the maximum limit of VGPRs made available to the
    -- shader compiler.
    ShaderStatisticsInfoAMD -> Word32
numAvailableVgprs :: Word32
  , -- | @numAvailableSgprs@ is the maximum limit of SGPRs made available to the
    -- shader compiler.
    ShaderStatisticsInfoAMD -> Word32
numAvailableSgprs :: Word32
  , -- | @computeWorkGroupSize@ is the local workgroup size of this shader in {
    -- X, Y, Z } dimensions.
    ShaderStatisticsInfoAMD -> (Word32, Word32, Word32)
computeWorkGroupSize :: (Word32, Word32, Word32)
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ShaderStatisticsInfoAMD)
#endif
deriving instance Show ShaderStatisticsInfoAMD

instance ToCStruct ShaderStatisticsInfoAMD where
  withCStruct :: ShaderStatisticsInfoAMD
-> (Ptr ShaderStatisticsInfoAMD -> IO b) -> IO b
withCStruct x :: ShaderStatisticsInfoAMD
x f :: Ptr ShaderStatisticsInfoAMD -> IO b
f = Int -> Int -> (Ptr ShaderStatisticsInfoAMD -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 72 8 ((Ptr ShaderStatisticsInfoAMD -> IO b) -> IO b)
-> (Ptr ShaderStatisticsInfoAMD -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ShaderStatisticsInfoAMD
p -> Ptr ShaderStatisticsInfoAMD
-> ShaderStatisticsInfoAMD -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ShaderStatisticsInfoAMD
p ShaderStatisticsInfoAMD
x (Ptr ShaderStatisticsInfoAMD -> IO b
f Ptr ShaderStatisticsInfoAMD
p)
  pokeCStruct :: Ptr ShaderStatisticsInfoAMD
-> ShaderStatisticsInfoAMD -> IO b -> IO b
pokeCStruct p :: Ptr ShaderStatisticsInfoAMD
p ShaderStatisticsInfoAMD{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ShaderStageFlagBits -> ShaderStageFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr ShaderStageFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr ShaderStageFlags)) (ShaderStageFlagBits
shaderStageMask)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ShaderResourceUsageAMD
-> ShaderResourceUsageAMD -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr ShaderResourceUsageAMD
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr ShaderResourceUsageAMD)) (ShaderResourceUsageAMD
resourceUsage) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) (Word32
numPhysicalVgprs)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32)) (Word32
numPhysicalSgprs)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32)) (Word32
numAvailableVgprs)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Word32)) (Word32
numAvailableSgprs)
    let pComputeWorkGroupSize' :: Ptr Word32
pComputeWorkGroupSize' = Ptr (FixedArray 3 Word32) -> Ptr Word32
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr (FixedArray 3 Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr (FixedArray 3 Word32)))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ case ((Word32, Word32, Word32)
computeWorkGroupSize) of
      (e0 :: Word32
e0, e1 :: Word32
e1, e2 :: Word32
e2) -> do
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pComputeWorkGroupSize' :: Ptr Word32) (Word32
e0)
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pComputeWorkGroupSize' Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32) (Word32
e1)
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pComputeWorkGroupSize' Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32) (Word32
e2)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 72
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr ShaderStatisticsInfoAMD -> IO b -> IO b
pokeZeroCStruct p :: Ptr ShaderStatisticsInfoAMD
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ShaderStageFlagBits -> ShaderStageFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr ShaderStageFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr ShaderStageFlags)) (ShaderStageFlagBits
forall a. Zero a => a
zero)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ShaderResourceUsageAMD
-> ShaderResourceUsageAMD -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr ShaderResourceUsageAMD
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr ShaderResourceUsageAMD)) (ShaderResourceUsageAMD
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    let pComputeWorkGroupSize' :: Ptr Word32
pComputeWorkGroupSize' = Ptr (FixedArray 3 Word32) -> Ptr Word32
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr (FixedArray 3 Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr (FixedArray 3 Word32)))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ case ((Word32
forall a. Zero a => a
zero, Word32
forall a. Zero a => a
zero, Word32
forall a. Zero a => a
zero)) of
      (e0 :: Word32
e0, e1 :: Word32
e1, e2 :: Word32
e2) -> do
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pComputeWorkGroupSize' :: Ptr Word32) (Word32
e0)
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pComputeWorkGroupSize' Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32) (Word32
e1)
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pComputeWorkGroupSize' Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32) (Word32
e2)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct ShaderStatisticsInfoAMD where
  peekCStruct :: Ptr ShaderStatisticsInfoAMD -> IO ShaderStatisticsInfoAMD
peekCStruct p :: Ptr ShaderStatisticsInfoAMD
p = do
    ShaderStageFlagBits
shaderStageMask <- Ptr ShaderStageFlagBits -> IO ShaderStageFlagBits
forall a. Storable a => Ptr a -> IO a
peek @ShaderStageFlags ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr ShaderStageFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr ShaderStageFlags))
    ShaderResourceUsageAMD
resourceUsage <- Ptr ShaderResourceUsageAMD -> IO ShaderResourceUsageAMD
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ShaderResourceUsageAMD ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr ShaderResourceUsageAMD
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr ShaderResourceUsageAMD))
    Word32
numPhysicalVgprs <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32))
    Word32
numPhysicalSgprs <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32))
    Word32
numAvailableVgprs <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32))
    Word32
numAvailableSgprs <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Word32))
    let pcomputeWorkGroupSize :: Ptr Word32
pcomputeWorkGroupSize = Ptr (FixedArray 3 Word32) -> Ptr Word32
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @Word32 ((Ptr ShaderStatisticsInfoAMD
p Ptr ShaderStatisticsInfoAMD -> Int -> Ptr (FixedArray 3 Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr (FixedArray 3 Word32)))
    Word32
computeWorkGroupSize0 <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pcomputeWorkGroupSize Ptr Word32 -> Int -> Ptr Word32
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 0 :: Ptr Word32))
    Word32
computeWorkGroupSize1 <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pcomputeWorkGroupSize Ptr Word32 -> Int -> Ptr Word32
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 4 :: Ptr Word32))
    Word32
computeWorkGroupSize2 <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pcomputeWorkGroupSize Ptr Word32 -> Int -> Ptr Word32
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 8 :: Ptr Word32))
    ShaderStatisticsInfoAMD -> IO ShaderStatisticsInfoAMD
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ShaderStatisticsInfoAMD -> IO ShaderStatisticsInfoAMD)
-> ShaderStatisticsInfoAMD -> IO ShaderStatisticsInfoAMD
forall a b. (a -> b) -> a -> b
$ ShaderStageFlagBits
-> ShaderResourceUsageAMD
-> Word32
-> Word32
-> Word32
-> Word32
-> (Word32, Word32, Word32)
-> ShaderStatisticsInfoAMD
ShaderStatisticsInfoAMD
             ShaderStageFlagBits
shaderStageMask ShaderResourceUsageAMD
resourceUsage Word32
numPhysicalVgprs Word32
numPhysicalSgprs Word32
numAvailableVgprs Word32
numAvailableSgprs ((Word32
computeWorkGroupSize0, Word32
computeWorkGroupSize1, Word32
computeWorkGroupSize2))

instance Zero ShaderStatisticsInfoAMD where
  zero :: ShaderStatisticsInfoAMD
zero = ShaderStageFlagBits
-> ShaderResourceUsageAMD
-> Word32
-> Word32
-> Word32
-> Word32
-> (Word32, Word32, Word32)
-> ShaderStatisticsInfoAMD
ShaderStatisticsInfoAMD
           ShaderStageFlagBits
forall a. Zero a => a
zero
           ShaderResourceUsageAMD
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           (Word32
forall a. Zero a => a
zero, Word32
forall a. Zero a => a
zero, Word32
forall a. Zero a => a
zero)


-- | VkShaderInfoTypeAMD - Enum specifying which type of shader info to query
--
-- = See Also
--
-- 'getShaderInfoAMD'
newtype ShaderInfoTypeAMD = ShaderInfoTypeAMD Int32
  deriving newtype (ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
(ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool)
-> (ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool)
-> Eq ShaderInfoTypeAMD
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
$c/= :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
== :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
$c== :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
Eq, Eq ShaderInfoTypeAMD
Eq ShaderInfoTypeAMD =>
(ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Ordering)
-> (ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool)
-> (ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool)
-> (ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool)
-> (ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool)
-> (ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> ShaderInfoTypeAMD)
-> (ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> ShaderInfoTypeAMD)
-> Ord ShaderInfoTypeAMD
ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Ordering
ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> ShaderInfoTypeAMD
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> ShaderInfoTypeAMD
$cmin :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> ShaderInfoTypeAMD
max :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> ShaderInfoTypeAMD
$cmax :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> ShaderInfoTypeAMD
>= :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
$c>= :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
> :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
$c> :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
<= :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
$c<= :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
< :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
$c< :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Bool
compare :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Ordering
$ccompare :: ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> Ordering
$cp1Ord :: Eq ShaderInfoTypeAMD
Ord, Ptr b -> Int -> IO ShaderInfoTypeAMD
Ptr b -> Int -> ShaderInfoTypeAMD -> IO ()
Ptr ShaderInfoTypeAMD -> IO ShaderInfoTypeAMD
Ptr ShaderInfoTypeAMD -> Int -> IO ShaderInfoTypeAMD
Ptr ShaderInfoTypeAMD -> Int -> ShaderInfoTypeAMD -> IO ()
Ptr ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> IO ()
ShaderInfoTypeAMD -> Int
(ShaderInfoTypeAMD -> Int)
-> (ShaderInfoTypeAMD -> Int)
-> (Ptr ShaderInfoTypeAMD -> Int -> IO ShaderInfoTypeAMD)
-> (Ptr ShaderInfoTypeAMD -> Int -> ShaderInfoTypeAMD -> IO ())
-> (forall b. Ptr b -> Int -> IO ShaderInfoTypeAMD)
-> (forall b. Ptr b -> Int -> ShaderInfoTypeAMD -> IO ())
-> (Ptr ShaderInfoTypeAMD -> IO ShaderInfoTypeAMD)
-> (Ptr ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> IO ())
-> Storable ShaderInfoTypeAMD
forall b. Ptr b -> Int -> IO ShaderInfoTypeAMD
forall b. Ptr b -> Int -> ShaderInfoTypeAMD -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> IO ()
$cpoke :: Ptr ShaderInfoTypeAMD -> ShaderInfoTypeAMD -> IO ()
peek :: Ptr ShaderInfoTypeAMD -> IO ShaderInfoTypeAMD
$cpeek :: Ptr ShaderInfoTypeAMD -> IO ShaderInfoTypeAMD
pokeByteOff :: Ptr b -> Int -> ShaderInfoTypeAMD -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> ShaderInfoTypeAMD -> IO ()
peekByteOff :: Ptr b -> Int -> IO ShaderInfoTypeAMD
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ShaderInfoTypeAMD
pokeElemOff :: Ptr ShaderInfoTypeAMD -> Int -> ShaderInfoTypeAMD -> IO ()
$cpokeElemOff :: Ptr ShaderInfoTypeAMD -> Int -> ShaderInfoTypeAMD -> IO ()
peekElemOff :: Ptr ShaderInfoTypeAMD -> Int -> IO ShaderInfoTypeAMD
$cpeekElemOff :: Ptr ShaderInfoTypeAMD -> Int -> IO ShaderInfoTypeAMD
alignment :: ShaderInfoTypeAMD -> Int
$calignment :: ShaderInfoTypeAMD -> Int
sizeOf :: ShaderInfoTypeAMD -> Int
$csizeOf :: ShaderInfoTypeAMD -> Int
Storable, ShaderInfoTypeAMD
ShaderInfoTypeAMD -> Zero ShaderInfoTypeAMD
forall a. a -> Zero a
zero :: ShaderInfoTypeAMD
$czero :: ShaderInfoTypeAMD
Zero)

-- | 'SHADER_INFO_TYPE_STATISTICS_AMD' specifies that device resources used
-- by a shader will be queried.
pattern $bSHADER_INFO_TYPE_STATISTICS_AMD :: ShaderInfoTypeAMD
$mSHADER_INFO_TYPE_STATISTICS_AMD :: forall r. ShaderInfoTypeAMD -> (Void# -> r) -> (Void# -> r) -> r
SHADER_INFO_TYPE_STATISTICS_AMD = ShaderInfoTypeAMD 0
-- | 'SHADER_INFO_TYPE_BINARY_AMD' specifies that implementation-specific
-- information will be queried.
pattern $bSHADER_INFO_TYPE_BINARY_AMD :: ShaderInfoTypeAMD
$mSHADER_INFO_TYPE_BINARY_AMD :: forall r. ShaderInfoTypeAMD -> (Void# -> r) -> (Void# -> r) -> r
SHADER_INFO_TYPE_BINARY_AMD = ShaderInfoTypeAMD 1
-- | 'SHADER_INFO_TYPE_DISASSEMBLY_AMD' specifies that human-readable
-- dissassembly of a shader.
pattern $bSHADER_INFO_TYPE_DISASSEMBLY_AMD :: ShaderInfoTypeAMD
$mSHADER_INFO_TYPE_DISASSEMBLY_AMD :: forall r. ShaderInfoTypeAMD -> (Void# -> r) -> (Void# -> r) -> r
SHADER_INFO_TYPE_DISASSEMBLY_AMD = ShaderInfoTypeAMD 2
{-# complete SHADER_INFO_TYPE_STATISTICS_AMD,
             SHADER_INFO_TYPE_BINARY_AMD,
             SHADER_INFO_TYPE_DISASSEMBLY_AMD :: ShaderInfoTypeAMD #-}

instance Show ShaderInfoTypeAMD where
  showsPrec :: Int -> ShaderInfoTypeAMD -> ShowS
showsPrec p :: Int
p = \case
    SHADER_INFO_TYPE_STATISTICS_AMD -> String -> ShowS
showString "SHADER_INFO_TYPE_STATISTICS_AMD"
    SHADER_INFO_TYPE_BINARY_AMD -> String -> ShowS
showString "SHADER_INFO_TYPE_BINARY_AMD"
    SHADER_INFO_TYPE_DISASSEMBLY_AMD -> String -> ShowS
showString "SHADER_INFO_TYPE_DISASSEMBLY_AMD"
    ShaderInfoTypeAMD x :: Int32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "ShaderInfoTypeAMD " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11 Int32
x)

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


type AMD_SHADER_INFO_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_AMD_SHADER_INFO_SPEC_VERSION"
pattern AMD_SHADER_INFO_SPEC_VERSION :: forall a . Integral a => a
pattern $bAMD_SHADER_INFO_SPEC_VERSION :: a
$mAMD_SHADER_INFO_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
AMD_SHADER_INFO_SPEC_VERSION = 1


type AMD_SHADER_INFO_EXTENSION_NAME = "VK_AMD_shader_info"

-- No documentation found for TopLevel "VK_AMD_SHADER_INFO_EXTENSION_NAME"
pattern AMD_SHADER_INFO_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bAMD_SHADER_INFO_EXTENSION_NAME :: a
$mAMD_SHADER_INFO_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
AMD_SHADER_INFO_EXTENSION_NAME = "VK_AMD_shader_info"