{-# language CPP #-}
module Graphics.Vulkan.Core10.Enums.Result (Result( SUCCESS
, NOT_READY
, TIMEOUT
, EVENT_SET
, EVENT_RESET
, INCOMPLETE
, ERROR_OUT_OF_HOST_MEMORY
, ERROR_OUT_OF_DEVICE_MEMORY
, ERROR_INITIALIZATION_FAILED
, ERROR_DEVICE_LOST
, ERROR_MEMORY_MAP_FAILED
, ERROR_LAYER_NOT_PRESENT
, ERROR_EXTENSION_NOT_PRESENT
, ERROR_FEATURE_NOT_PRESENT
, ERROR_INCOMPATIBLE_DRIVER
, ERROR_TOO_MANY_OBJECTS
, ERROR_FORMAT_NOT_SUPPORTED
, ERROR_FRAGMENTED_POOL
, ERROR_UNKNOWN
, PIPELINE_COMPILE_REQUIRED_EXT
, OPERATION_NOT_DEFERRED_KHR
, OPERATION_DEFERRED_KHR
, THREAD_DONE_KHR
, THREAD_IDLE_KHR
, ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT
, ERROR_NOT_PERMITTED_EXT
, ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT
, ERROR_INCOMPATIBLE_VERSION_KHR
, ERROR_INVALID_SHADER_NV
, ERROR_VALIDATION_FAILED_EXT
, ERROR_INCOMPATIBLE_DISPLAY_KHR
, ERROR_OUT_OF_DATE_KHR
, SUBOPTIMAL_KHR
, ERROR_NATIVE_WINDOW_IN_USE_KHR
, ERROR_SURFACE_LOST_KHR
, ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS
, ERROR_FRAGMENTATION
, ERROR_INVALID_EXTERNAL_HANDLE
, ERROR_OUT_OF_POOL_MEMORY
, ..
)) where
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 Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Graphics.Vulkan.Zero (Zero)
newtype Result = Result Int32
deriving newtype (Eq, Ord, Storable, Zero)
pattern SUCCESS = Result 0
pattern NOT_READY = Result 1
pattern TIMEOUT = Result 2
pattern EVENT_SET = Result 3
pattern EVENT_RESET = Result 4
pattern INCOMPLETE = Result 5
pattern ERROR_OUT_OF_HOST_MEMORY = Result (-1)
pattern ERROR_OUT_OF_DEVICE_MEMORY = Result (-2)
pattern ERROR_INITIALIZATION_FAILED = Result (-3)
pattern ERROR_DEVICE_LOST = Result (-4)
pattern ERROR_MEMORY_MAP_FAILED = Result (-5)
pattern ERROR_LAYER_NOT_PRESENT = Result (-6)
pattern ERROR_EXTENSION_NOT_PRESENT = Result (-7)
pattern ERROR_FEATURE_NOT_PRESENT = Result (-8)
pattern ERROR_INCOMPATIBLE_DRIVER = Result (-9)
pattern ERROR_TOO_MANY_OBJECTS = Result (-10)
pattern ERROR_FORMAT_NOT_SUPPORTED = Result (-11)
pattern ERROR_FRAGMENTED_POOL = Result (-12)
pattern ERROR_UNKNOWN = Result (-13)
pattern PIPELINE_COMPILE_REQUIRED_EXT = Result 1000297000
pattern OPERATION_NOT_DEFERRED_KHR = Result 1000268003
pattern OPERATION_DEFERRED_KHR = Result 1000268002
pattern THREAD_DONE_KHR = Result 1000268001
pattern THREAD_IDLE_KHR = Result 1000268000
pattern ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT = Result (-1000255000)
pattern ERROR_NOT_PERMITTED_EXT = Result (-1000174001)
pattern ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT = Result (-1000158000)
pattern ERROR_INCOMPATIBLE_VERSION_KHR = Result (-1000150000)
pattern ERROR_INVALID_SHADER_NV = Result (-1000012000)
pattern ERROR_VALIDATION_FAILED_EXT = Result (-1000011001)
pattern ERROR_INCOMPATIBLE_DISPLAY_KHR = Result (-1000003001)
pattern ERROR_OUT_OF_DATE_KHR = Result (-1000001004)
pattern SUBOPTIMAL_KHR = Result 1000001003
pattern ERROR_NATIVE_WINDOW_IN_USE_KHR = Result (-1000000001)
pattern ERROR_SURFACE_LOST_KHR = Result (-1000000000)
pattern ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS = Result (-1000257000)
pattern ERROR_FRAGMENTATION = Result (-1000161000)
pattern ERROR_INVALID_EXTERNAL_HANDLE = Result (-1000072003)
pattern ERROR_OUT_OF_POOL_MEMORY = Result (-1000069000)
{-# complete SUCCESS,
NOT_READY,
TIMEOUT,
EVENT_SET,
EVENT_RESET,
INCOMPLETE,
ERROR_OUT_OF_HOST_MEMORY,
ERROR_OUT_OF_DEVICE_MEMORY,
ERROR_INITIALIZATION_FAILED,
ERROR_DEVICE_LOST,
ERROR_MEMORY_MAP_FAILED,
ERROR_LAYER_NOT_PRESENT,
ERROR_EXTENSION_NOT_PRESENT,
ERROR_FEATURE_NOT_PRESENT,
ERROR_INCOMPATIBLE_DRIVER,
ERROR_TOO_MANY_OBJECTS,
ERROR_FORMAT_NOT_SUPPORTED,
ERROR_FRAGMENTED_POOL,
ERROR_UNKNOWN,
PIPELINE_COMPILE_REQUIRED_EXT,
OPERATION_NOT_DEFERRED_KHR,
OPERATION_DEFERRED_KHR,
THREAD_DONE_KHR,
THREAD_IDLE_KHR,
ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT,
ERROR_NOT_PERMITTED_EXT,
ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT,
ERROR_INCOMPATIBLE_VERSION_KHR,
ERROR_INVALID_SHADER_NV,
ERROR_VALIDATION_FAILED_EXT,
ERROR_INCOMPATIBLE_DISPLAY_KHR,
ERROR_OUT_OF_DATE_KHR,
SUBOPTIMAL_KHR,
ERROR_NATIVE_WINDOW_IN_USE_KHR,
ERROR_SURFACE_LOST_KHR,
ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS,
ERROR_FRAGMENTATION,
ERROR_INVALID_EXTERNAL_HANDLE,
ERROR_OUT_OF_POOL_MEMORY :: Result #-}
instance Show Result where
showsPrec p = \case
SUCCESS -> showString "SUCCESS"
NOT_READY -> showString "NOT_READY"
TIMEOUT -> showString "TIMEOUT"
EVENT_SET -> showString "EVENT_SET"
EVENT_RESET -> showString "EVENT_RESET"
INCOMPLETE -> showString "INCOMPLETE"
ERROR_OUT_OF_HOST_MEMORY -> showString "ERROR_OUT_OF_HOST_MEMORY"
ERROR_OUT_OF_DEVICE_MEMORY -> showString "ERROR_OUT_OF_DEVICE_MEMORY"
ERROR_INITIALIZATION_FAILED -> showString "ERROR_INITIALIZATION_FAILED"
ERROR_DEVICE_LOST -> showString "ERROR_DEVICE_LOST"
ERROR_MEMORY_MAP_FAILED -> showString "ERROR_MEMORY_MAP_FAILED"
ERROR_LAYER_NOT_PRESENT -> showString "ERROR_LAYER_NOT_PRESENT"
ERROR_EXTENSION_NOT_PRESENT -> showString "ERROR_EXTENSION_NOT_PRESENT"
ERROR_FEATURE_NOT_PRESENT -> showString "ERROR_FEATURE_NOT_PRESENT"
ERROR_INCOMPATIBLE_DRIVER -> showString "ERROR_INCOMPATIBLE_DRIVER"
ERROR_TOO_MANY_OBJECTS -> showString "ERROR_TOO_MANY_OBJECTS"
ERROR_FORMAT_NOT_SUPPORTED -> showString "ERROR_FORMAT_NOT_SUPPORTED"
ERROR_FRAGMENTED_POOL -> showString "ERROR_FRAGMENTED_POOL"
ERROR_UNKNOWN -> showString "ERROR_UNKNOWN"
PIPELINE_COMPILE_REQUIRED_EXT -> showString "PIPELINE_COMPILE_REQUIRED_EXT"
OPERATION_NOT_DEFERRED_KHR -> showString "OPERATION_NOT_DEFERRED_KHR"
OPERATION_DEFERRED_KHR -> showString "OPERATION_DEFERRED_KHR"
THREAD_DONE_KHR -> showString "THREAD_DONE_KHR"
THREAD_IDLE_KHR -> showString "THREAD_IDLE_KHR"
ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT -> showString "ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT"
ERROR_NOT_PERMITTED_EXT -> showString "ERROR_NOT_PERMITTED_EXT"
ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT -> showString "ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT"
ERROR_INCOMPATIBLE_VERSION_KHR -> showString "ERROR_INCOMPATIBLE_VERSION_KHR"
ERROR_INVALID_SHADER_NV -> showString "ERROR_INVALID_SHADER_NV"
ERROR_VALIDATION_FAILED_EXT -> showString "ERROR_VALIDATION_FAILED_EXT"
ERROR_INCOMPATIBLE_DISPLAY_KHR -> showString "ERROR_INCOMPATIBLE_DISPLAY_KHR"
ERROR_OUT_OF_DATE_KHR -> showString "ERROR_OUT_OF_DATE_KHR"
SUBOPTIMAL_KHR -> showString "SUBOPTIMAL_KHR"
ERROR_NATIVE_WINDOW_IN_USE_KHR -> showString "ERROR_NATIVE_WINDOW_IN_USE_KHR"
ERROR_SURFACE_LOST_KHR -> showString "ERROR_SURFACE_LOST_KHR"
ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS -> showString "ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS"
ERROR_FRAGMENTATION -> showString "ERROR_FRAGMENTATION"
ERROR_INVALID_EXTERNAL_HANDLE -> showString "ERROR_INVALID_EXTERNAL_HANDLE"
ERROR_OUT_OF_POOL_MEMORY -> showString "ERROR_OUT_OF_POOL_MEMORY"
Result x -> showParen (p >= 11) (showString "Result " . showsPrec 11 x)
instance Read Result where
readPrec = parens (choose [("SUCCESS", pure SUCCESS)
, ("NOT_READY", pure NOT_READY)
, ("TIMEOUT", pure TIMEOUT)
, ("EVENT_SET", pure EVENT_SET)
, ("EVENT_RESET", pure EVENT_RESET)
, ("INCOMPLETE", pure INCOMPLETE)
, ("ERROR_OUT_OF_HOST_MEMORY", pure ERROR_OUT_OF_HOST_MEMORY)
, ("ERROR_OUT_OF_DEVICE_MEMORY", pure ERROR_OUT_OF_DEVICE_MEMORY)
, ("ERROR_INITIALIZATION_FAILED", pure ERROR_INITIALIZATION_FAILED)
, ("ERROR_DEVICE_LOST", pure ERROR_DEVICE_LOST)
, ("ERROR_MEMORY_MAP_FAILED", pure ERROR_MEMORY_MAP_FAILED)
, ("ERROR_LAYER_NOT_PRESENT", pure ERROR_LAYER_NOT_PRESENT)
, ("ERROR_EXTENSION_NOT_PRESENT", pure ERROR_EXTENSION_NOT_PRESENT)
, ("ERROR_FEATURE_NOT_PRESENT", pure ERROR_FEATURE_NOT_PRESENT)
, ("ERROR_INCOMPATIBLE_DRIVER", pure ERROR_INCOMPATIBLE_DRIVER)
, ("ERROR_TOO_MANY_OBJECTS", pure ERROR_TOO_MANY_OBJECTS)
, ("ERROR_FORMAT_NOT_SUPPORTED", pure ERROR_FORMAT_NOT_SUPPORTED)
, ("ERROR_FRAGMENTED_POOL", pure ERROR_FRAGMENTED_POOL)
, ("ERROR_UNKNOWN", pure ERROR_UNKNOWN)
, ("PIPELINE_COMPILE_REQUIRED_EXT", pure PIPELINE_COMPILE_REQUIRED_EXT)
, ("OPERATION_NOT_DEFERRED_KHR", pure OPERATION_NOT_DEFERRED_KHR)
, ("OPERATION_DEFERRED_KHR", pure OPERATION_DEFERRED_KHR)
, ("THREAD_DONE_KHR", pure THREAD_DONE_KHR)
, ("THREAD_IDLE_KHR", pure THREAD_IDLE_KHR)
, ("ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT", pure ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT)
, ("ERROR_NOT_PERMITTED_EXT", pure ERROR_NOT_PERMITTED_EXT)
, ("ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT", pure ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT)
, ("ERROR_INCOMPATIBLE_VERSION_KHR", pure ERROR_INCOMPATIBLE_VERSION_KHR)
, ("ERROR_INVALID_SHADER_NV", pure ERROR_INVALID_SHADER_NV)
, ("ERROR_VALIDATION_FAILED_EXT", pure ERROR_VALIDATION_FAILED_EXT)
, ("ERROR_INCOMPATIBLE_DISPLAY_KHR", pure ERROR_INCOMPATIBLE_DISPLAY_KHR)
, ("ERROR_OUT_OF_DATE_KHR", pure ERROR_OUT_OF_DATE_KHR)
, ("SUBOPTIMAL_KHR", pure SUBOPTIMAL_KHR)
, ("ERROR_NATIVE_WINDOW_IN_USE_KHR", pure ERROR_NATIVE_WINDOW_IN_USE_KHR)
, ("ERROR_SURFACE_LOST_KHR", pure ERROR_SURFACE_LOST_KHR)
, ("ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS", pure ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS)
, ("ERROR_FRAGMENTATION", pure ERROR_FRAGMENTATION)
, ("ERROR_INVALID_EXTERNAL_HANDLE", pure ERROR_INVALID_EXTERNAL_HANDLE)
, ("ERROR_OUT_OF_POOL_MEMORY", pure ERROR_OUT_OF_POOL_MEMORY)]
+++
prec 10 (do
expectP (Ident "Result")
v <- step readPrec
pure (Result v)))