module Language.SpirV.SourceLanguage where
import Data.Word (Word32)
import Language.SpirV.SpirEnum
import qualified Language.SpirV.Capability as Capability
data SourceLanguage =
Unknown
| ESSL
| GLSL
| OpenCLC
| OpenCLCPP
deriving(Read, Show, Eq, Ord)
instance SpirEnum SourceLanguage Word32 where
toWord Unknown = 0
toWord ESSL = 1
toWord GLSL = 2
toWord OpenCLC = 3
toWord OpenCLCPP = 4
fromWord 0 = Just Unknown
fromWord 1 = Just ESSL
fromWord 2 = Just GLSL
fromWord 3 = Just OpenCLC
fromWord 4 = Just OpenCLCPP
fromWord _ = Nothing
requiredCapabilities _ = []