packages feed

mischief-render-0.1.0.0: src/Mischief/Render/TextureFormat.hs

module Mischief.Render.TextureFormat where

import Mischief.WGPU.Types.Enums

data TextureFormat
  = Undefined
  | R8Unorm
  | R8Snorm
  | R8Uint
  | R8Sint
  | R16Unorm
  | R16Snorm
  | R16Uint
  | R16Sint
  | R16Float
  | RG8Unorm
  | RG8Snorm
  | RG8Uint
  | RG8Sint
  | R32Float
  | R32Uint
  | R32Sint
  | RG16Unorm
  | RG16Snorm
  | RG16Uint
  | RG16Sint
  | RG16Float
  | RGBA8Unorm
  | RGBA8UnormSrgb
  | RGBA8Snorm
  | RGBA8Uint
  | RGBA8Sint
  | BGRA8Unorm
  | BGRA8UnormSrgb
  | RGB10A2Uint
  | RGB10A2Unorm
  | RG11B10Ufloat
  | RGB9E5Ufloat
  | RG32Float
  | RG32Uint
  | RG32Sint
  | RGBA16Unorm
  | RGBA16Snorm
  | RGBA16Uint
  | RGBA16Sint
  | RGBA16Float
  | RGBA32Float
  | RGBA32Uint
  | RGBA32Sint
  | Stencil8
  | Depth16Unorm
  | Depth24Plus
  | Depth24PlusStencil8
  | Depth32Float
  | Depth32FloatStencil8
  | BC1RGBAUnorm
  | BC1RGBAUnormSrgb
  | BC2RGBAUnorm
  | BC2RGBAUnormSrgb
  | BC3RGBAUnorm
  | BC3RGBAUnormSrgb
  | BC4RUnorm
  | BC4RSnorm
  | BC5RGUnorm
  | BC5RGSnorm
  | BC6HRGBUfloat
  | BC6HRGBFloat
  | BC7RGBAUnorm
  | BC7RGBAUnormSrgb
  | ETC2RGB8Unorm
  | ETC2RGB8UnormSrgb
  | ETC2RGB8A1Unorm
  | ETC2RGB8A1UnormSrgb
  | ETC2RGBA8Unorm
  | ETC2RGBA8UnormSrgb
  | EACR11Unorm
  | EACR11Snorm
  | EACRG11Unorm
  | EACRG11Snorm
  | ASTC4x4Unorm
  | ASTC4x4UnormSrgb
  | ASTC5x4Unorm
  | ASTC5x4UnormSrgb
  | ASTC5x5Unorm
  | ASTC5x5UnormSrgb
  | ASTC6x5Unorm
  | ASTC6x5UnormSrgb
  | ASTC6x6Unorm
  | ASTC6x6UnormSrgb
  | ASTC8x5Unorm
  | ASTC8x5UnormSrgb
  | ASTC8x6Unorm
  | ASTC8x6UnormSrgb
  | ASTC8x8Unorm
  | ASTC8x8UnormSrgb
  | ASTC10x5Unorm
  | ASTC10x5UnormSrgb
  | ASTC10x6Unorm
  | ASTC10x6UnormSrgb
  | ASTC10x8Unorm
  | ASTC10x8UnormSrgb
  | ASTC10x10Unorm
  | ASTC10x10UnormSrgb
  | ASTC12x10Unorm
  | ASTC12x10UnormSrgb
  | ASTC12x12Unorm
  | ASTC12x12UnormSrgb
  | Force32
  deriving (Show)

toWGPUFormat :: TextureFormat -> WGPUTextureFormat
toWGPUFormat Undefined = wGPUTextureFormat_Undefined
toWGPUFormat R8Unorm = wGPUTextureFormat_R8Unorm
toWGPUFormat R8Snorm = wGPUTextureFormat_R8Snorm
toWGPUFormat R8Uint = wGPUTextureFormat_R8Uint
toWGPUFormat R8Sint = wGPUTextureFormat_R8Sint
toWGPUFormat R16Unorm = wGPUTextureFormat_R16Unorm
toWGPUFormat R16Snorm = wGPUTextureFormat_R16Snorm
toWGPUFormat R16Uint = wGPUTextureFormat_R16Uint
toWGPUFormat R16Sint = wGPUTextureFormat_R16Sint
toWGPUFormat R16Float = wGPUTextureFormat_R16Float
toWGPUFormat RG8Unorm = wGPUTextureFormat_RG8Unorm
toWGPUFormat RG8Snorm = wGPUTextureFormat_RG8Snorm
toWGPUFormat RG8Uint = wGPUTextureFormat_RG8Uint
toWGPUFormat RG8Sint = wGPUTextureFormat_RG8Sint
toWGPUFormat R32Float = wGPUTextureFormat_R32Float
toWGPUFormat R32Uint = wGPUTextureFormat_R32Uint
toWGPUFormat R32Sint = wGPUTextureFormat_R32Sint
toWGPUFormat RG16Unorm = wGPUTextureFormat_RG16Unorm
toWGPUFormat RG16Snorm = wGPUTextureFormat_RG16Snorm
toWGPUFormat RG16Uint = wGPUTextureFormat_RG16Uint
toWGPUFormat RG16Sint = wGPUTextureFormat_RG16Sint
toWGPUFormat RG16Float = wGPUTextureFormat_RG16Float
toWGPUFormat RGBA8Unorm = wGPUTextureFormat_RGBA8Unorm
toWGPUFormat RGBA8UnormSrgb = wGPUTextureFormat_RGBA8UnormSrgb
toWGPUFormat RGBA8Snorm = wGPUTextureFormat_RGBA8Snorm
toWGPUFormat RGBA8Uint = wGPUTextureFormat_RGBA8Uint
toWGPUFormat RGBA8Sint = wGPUTextureFormat_RGBA8Sint
toWGPUFormat BGRA8Unorm = wGPUTextureFormat_BGRA8Unorm
toWGPUFormat BGRA8UnormSrgb = wGPUTextureFormat_BGRA8UnormSrgb
toWGPUFormat RGB10A2Uint = wGPUTextureFormat_RGB10A2Uint
toWGPUFormat RGB10A2Unorm = wGPUTextureFormat_RGB10A2Unorm
toWGPUFormat RG11B10Ufloat = wGPUTextureFormat_RG11B10Ufloat
toWGPUFormat RGB9E5Ufloat = wGPUTextureFormat_RGB9E5Ufloat
toWGPUFormat RG32Float = wGPUTextureFormat_RG32Float
toWGPUFormat RG32Uint = wGPUTextureFormat_RG32Uint
toWGPUFormat RG32Sint = wGPUTextureFormat_RG32Sint
toWGPUFormat RGBA16Unorm = wGPUTextureFormat_RGBA16Unorm
toWGPUFormat RGBA16Snorm = wGPUTextureFormat_RGBA16Snorm
toWGPUFormat RGBA16Uint = wGPUTextureFormat_RGBA16Uint
toWGPUFormat RGBA16Sint = wGPUTextureFormat_RGBA16Sint
toWGPUFormat RGBA16Float = wGPUTextureFormat_RGBA16Float
toWGPUFormat RGBA32Float = wGPUTextureFormat_RGBA32Float
toWGPUFormat RGBA32Uint = wGPUTextureFormat_RGBA32Uint
toWGPUFormat RGBA32Sint = wGPUTextureFormat_RGBA32Sint
toWGPUFormat Stencil8 = wGPUTextureFormat_Stencil8
toWGPUFormat Depth16Unorm = wGPUTextureFormat_Depth16Unorm
toWGPUFormat Depth24Plus = wGPUTextureFormat_Depth24Plus
toWGPUFormat Depth24PlusStencil8 = wGPUTextureFormat_Depth24PlusStencil8
toWGPUFormat Depth32Float = wGPUTextureFormat_Depth32Float
toWGPUFormat Depth32FloatStencil8 = wGPUTextureFormat_Depth32FloatStencil8
toWGPUFormat BC1RGBAUnorm = wGPUTextureFormat_BC1RGBAUnorm
toWGPUFormat BC1RGBAUnormSrgb = wGPUTextureFormat_BC1RGBAUnormSrgb
toWGPUFormat BC2RGBAUnorm = wGPUTextureFormat_BC2RGBAUnorm
toWGPUFormat BC2RGBAUnormSrgb = wGPUTextureFormat_BC2RGBAUnormSrgb
toWGPUFormat BC3RGBAUnorm = wGPUTextureFormat_BC3RGBAUnorm
toWGPUFormat BC3RGBAUnormSrgb = wGPUTextureFormat_BC3RGBAUnormSrgb
toWGPUFormat BC4RUnorm = wGPUTextureFormat_BC4RUnorm
toWGPUFormat BC4RSnorm = wGPUTextureFormat_BC4RSnorm
toWGPUFormat BC5RGUnorm = wGPUTextureFormat_BC5RGUnorm
toWGPUFormat BC5RGSnorm = wGPUTextureFormat_BC5RGSnorm
toWGPUFormat BC6HRGBUfloat = wGPUTextureFormat_BC6HRGBUfloat
toWGPUFormat BC6HRGBFloat = wGPUTextureFormat_BC6HRGBFloat
toWGPUFormat BC7RGBAUnorm = wGPUTextureFormat_BC7RGBAUnorm
toWGPUFormat BC7RGBAUnormSrgb = wGPUTextureFormat_BC7RGBAUnormSrgb
toWGPUFormat ETC2RGB8Unorm = wGPUTextureFormat_ETC2RGB8Unorm
toWGPUFormat ETC2RGB8UnormSrgb = wGPUTextureFormat_ETC2RGB8UnormSrgb
toWGPUFormat ETC2RGB8A1Unorm = wGPUTextureFormat_ETC2RGB8A1Unorm
toWGPUFormat ETC2RGB8A1UnormSrgb = wGPUTextureFormat_ETC2RGB8A1UnormSrgb
toWGPUFormat ETC2RGBA8Unorm = wGPUTextureFormat_ETC2RGBA8Unorm
toWGPUFormat ETC2RGBA8UnormSrgb = wGPUTextureFormat_ETC2RGBA8UnormSrgb
toWGPUFormat EACR11Unorm = wGPUTextureFormat_EACR11Unorm
toWGPUFormat EACR11Snorm = wGPUTextureFormat_EACR11Snorm
toWGPUFormat EACRG11Unorm = wGPUTextureFormat_EACRG11Unorm
toWGPUFormat EACRG11Snorm = wGPUTextureFormat_EACRG11Snorm
toWGPUFormat ASTC4x4Unorm = wGPUTextureFormat_ASTC4x4Unorm
toWGPUFormat ASTC4x4UnormSrgb = wGPUTextureFormat_ASTC4x4UnormSrgb
toWGPUFormat ASTC5x4Unorm = wGPUTextureFormat_ASTC5x4Unorm
toWGPUFormat ASTC5x4UnormSrgb = wGPUTextureFormat_ASTC5x4UnormSrgb
toWGPUFormat ASTC5x5Unorm = wGPUTextureFormat_ASTC5x5Unorm
toWGPUFormat ASTC5x5UnormSrgb = wGPUTextureFormat_ASTC5x5UnormSrgb
toWGPUFormat ASTC6x5Unorm = wGPUTextureFormat_ASTC6x5Unorm
toWGPUFormat ASTC6x5UnormSrgb = wGPUTextureFormat_ASTC6x5UnormSrgb
toWGPUFormat ASTC6x6Unorm = wGPUTextureFormat_ASTC6x6Unorm
toWGPUFormat ASTC6x6UnormSrgb = wGPUTextureFormat_ASTC6x6UnormSrgb
toWGPUFormat ASTC8x5Unorm = wGPUTextureFormat_ASTC8x5Unorm
toWGPUFormat ASTC8x5UnormSrgb = wGPUTextureFormat_ASTC8x5UnormSrgb
toWGPUFormat ASTC8x6Unorm = wGPUTextureFormat_ASTC8x6Unorm
toWGPUFormat ASTC8x6UnormSrgb = wGPUTextureFormat_ASTC8x6UnormSrgb
toWGPUFormat ASTC8x8Unorm = wGPUTextureFormat_ASTC8x8Unorm
toWGPUFormat ASTC8x8UnormSrgb = wGPUTextureFormat_ASTC8x8UnormSrgb
toWGPUFormat ASTC10x5Unorm = wGPUTextureFormat_ASTC10x5Unorm
toWGPUFormat ASTC10x5UnormSrgb = wGPUTextureFormat_ASTC10x5UnormSrgb
toWGPUFormat ASTC10x6Unorm = wGPUTextureFormat_ASTC10x6Unorm
toWGPUFormat ASTC10x6UnormSrgb = wGPUTextureFormat_ASTC10x6UnormSrgb
toWGPUFormat ASTC10x8Unorm = wGPUTextureFormat_ASTC10x8Unorm
toWGPUFormat ASTC10x8UnormSrgb = wGPUTextureFormat_ASTC10x8UnormSrgb
toWGPUFormat ASTC10x10Unorm = wGPUTextureFormat_ASTC10x10Unorm
toWGPUFormat ASTC10x10UnormSrgb = wGPUTextureFormat_ASTC10x10UnormSrgb
toWGPUFormat ASTC12x10Unorm = wGPUTextureFormat_ASTC12x10Unorm
toWGPUFormat ASTC12x10UnormSrgb = wGPUTextureFormat_ASTC12x10UnormSrgb
toWGPUFormat ASTC12x12Unorm = wGPUTextureFormat_ASTC12x12Unorm
toWGPUFormat ASTC12x12UnormSrgb = wGPUTextureFormat_ASTC12x12UnormSrgb
toWGPUFormat Force32 = wGPUTextureFormat_Force32

fromWGPUFormat :: WGPUTextureFormat -> TextureFormat
fromWGPUFormat x
  | x == wGPUTextureFormat_Undefined = Undefined
  | x == wGPUTextureFormat_R8Unorm = R8Unorm
  | x == wGPUTextureFormat_R8Snorm = R8Snorm
  | x == wGPUTextureFormat_R8Uint = R8Uint
  | x == wGPUTextureFormat_R8Sint = R8Sint
  | x == wGPUTextureFormat_R16Unorm = R16Unorm
  | x == wGPUTextureFormat_R16Snorm = R16Snorm
  | x == wGPUTextureFormat_R16Uint = R16Uint
  | x == wGPUTextureFormat_R16Sint = R16Sint
  | x == wGPUTextureFormat_R16Float = R16Float
  | x == wGPUTextureFormat_RG8Unorm = RG8Unorm
  | x == wGPUTextureFormat_RG8Snorm = RG8Snorm
  | x == wGPUTextureFormat_RG8Uint = RG8Uint
  | x == wGPUTextureFormat_RG8Sint = RG8Sint
  | x == wGPUTextureFormat_R32Float = R32Float
  | x == wGPUTextureFormat_R32Uint = R32Uint
  | x == wGPUTextureFormat_R32Sint = R32Sint
  | x == wGPUTextureFormat_RG16Unorm = RG16Unorm
  | x == wGPUTextureFormat_RG16Snorm = RG16Snorm
  | x == wGPUTextureFormat_RG16Uint = RG16Uint
  | x == wGPUTextureFormat_RG16Sint = RG16Sint
  | x == wGPUTextureFormat_RG16Float = RG16Float
  | x == wGPUTextureFormat_RGBA8Unorm = RGBA8Unorm
  | x == wGPUTextureFormat_RGBA8UnormSrgb = RGBA8UnormSrgb
  | x == wGPUTextureFormat_RGBA8Snorm = RGBA8Snorm
  | x == wGPUTextureFormat_RGBA8Uint = RGBA8Uint
  | x == wGPUTextureFormat_RGBA8Sint = RGBA8Sint
  | x == wGPUTextureFormat_BGRA8Unorm = BGRA8Unorm
  | x == wGPUTextureFormat_BGRA8UnormSrgb = BGRA8UnormSrgb
  | x == wGPUTextureFormat_RGB10A2Uint = RGB10A2Uint
  | x == wGPUTextureFormat_RGB10A2Unorm = RGB10A2Unorm
  | x == wGPUTextureFormat_RG11B10Ufloat = RG11B10Ufloat
  | x == wGPUTextureFormat_RGB9E5Ufloat = RGB9E5Ufloat
  | x == wGPUTextureFormat_RG32Float = RG32Float
  | x == wGPUTextureFormat_RG32Uint = RG32Uint
  | x == wGPUTextureFormat_RG32Sint = RG32Sint
  | x == wGPUTextureFormat_RGBA16Unorm = RGBA16Unorm
  | x == wGPUTextureFormat_RGBA16Snorm = RGBA16Snorm
  | x == wGPUTextureFormat_RGBA16Uint = RGBA16Uint
  | x == wGPUTextureFormat_RGBA16Sint = RGBA16Sint
  | x == wGPUTextureFormat_RGBA16Float = RGBA16Float
  | x == wGPUTextureFormat_RGBA32Float = RGBA32Float
  | x == wGPUTextureFormat_RGBA32Uint = RGBA32Uint
  | x == wGPUTextureFormat_RGBA32Sint = RGBA32Sint
  | x == wGPUTextureFormat_Stencil8 = Stencil8
  | x == wGPUTextureFormat_Depth16Unorm = Depth16Unorm
  | x == wGPUTextureFormat_Depth24Plus = Depth24Plus
  | x == wGPUTextureFormat_Depth24PlusStencil8 = Depth24PlusStencil8
  | x == wGPUTextureFormat_Depth32Float = Depth32Float
  | x == wGPUTextureFormat_Depth32FloatStencil8 = Depth32FloatStencil8
  | x == wGPUTextureFormat_BC1RGBAUnorm = BC1RGBAUnorm
  | x == wGPUTextureFormat_BC1RGBAUnormSrgb = BC1RGBAUnormSrgb
  | x == wGPUTextureFormat_BC2RGBAUnorm = BC2RGBAUnorm
  | x == wGPUTextureFormat_BC2RGBAUnormSrgb = BC2RGBAUnormSrgb
  | x == wGPUTextureFormat_BC3RGBAUnorm = BC3RGBAUnorm
  | x == wGPUTextureFormat_BC3RGBAUnormSrgb = BC3RGBAUnormSrgb
  | x == wGPUTextureFormat_BC4RUnorm = BC4RUnorm
  | x == wGPUTextureFormat_BC4RSnorm = BC4RSnorm
  | x == wGPUTextureFormat_BC5RGUnorm = BC5RGUnorm
  | x == wGPUTextureFormat_BC5RGSnorm = BC5RGSnorm
  | x == wGPUTextureFormat_BC6HRGBUfloat = BC6HRGBUfloat
  | x == wGPUTextureFormat_BC6HRGBFloat = BC6HRGBFloat
  | x == wGPUTextureFormat_BC7RGBAUnorm = BC7RGBAUnorm
  | x == wGPUTextureFormat_BC7RGBAUnormSrgb = BC7RGBAUnormSrgb
  | x == wGPUTextureFormat_ETC2RGB8Unorm = ETC2RGB8Unorm
  | x == wGPUTextureFormat_ETC2RGB8UnormSrgb = ETC2RGB8UnormSrgb
  | x == wGPUTextureFormat_ETC2RGB8A1Unorm = ETC2RGB8A1Unorm
  | x == wGPUTextureFormat_ETC2RGB8A1UnormSrgb = ETC2RGB8A1UnormSrgb
  | x == wGPUTextureFormat_ETC2RGBA8Unorm = ETC2RGBA8Unorm
  | x == wGPUTextureFormat_ETC2RGBA8UnormSrgb = ETC2RGBA8UnormSrgb
  | x == wGPUTextureFormat_EACR11Unorm = EACR11Unorm
  | x == wGPUTextureFormat_EACR11Snorm = EACR11Snorm
  | x == wGPUTextureFormat_EACRG11Unorm = EACRG11Unorm
  | x == wGPUTextureFormat_EACRG11Snorm = EACRG11Snorm
  | x == wGPUTextureFormat_ASTC4x4Unorm = ASTC4x4Unorm
  | x == wGPUTextureFormat_ASTC4x4UnormSrgb = ASTC4x4UnormSrgb
  | x == wGPUTextureFormat_ASTC5x4Unorm = ASTC5x4Unorm
  | x == wGPUTextureFormat_ASTC5x4UnormSrgb = ASTC5x4UnormSrgb
  | x == wGPUTextureFormat_ASTC5x5Unorm = ASTC5x5Unorm
  | x == wGPUTextureFormat_ASTC5x5UnormSrgb = ASTC5x5UnormSrgb
  | x == wGPUTextureFormat_ASTC6x5Unorm = ASTC6x5Unorm
  | x == wGPUTextureFormat_ASTC6x5UnormSrgb = ASTC6x5UnormSrgb
  | x == wGPUTextureFormat_ASTC6x6Unorm = ASTC6x6Unorm
  | x == wGPUTextureFormat_ASTC6x6UnormSrgb = ASTC6x6UnormSrgb
  | x == wGPUTextureFormat_ASTC8x5Unorm = ASTC8x5Unorm
  | x == wGPUTextureFormat_ASTC8x5UnormSrgb = ASTC8x5UnormSrgb
  | x == wGPUTextureFormat_ASTC8x6Unorm = ASTC8x6Unorm
  | x == wGPUTextureFormat_ASTC8x6UnormSrgb = ASTC8x6UnormSrgb
  | x == wGPUTextureFormat_ASTC8x8Unorm = ASTC8x8Unorm
  | x == wGPUTextureFormat_ASTC8x8UnormSrgb = ASTC8x8UnormSrgb
  | x == wGPUTextureFormat_ASTC10x5Unorm = ASTC10x5Unorm
  | x == wGPUTextureFormat_ASTC10x5UnormSrgb = ASTC10x5UnormSrgb
  | x == wGPUTextureFormat_ASTC10x6Unorm = ASTC10x6Unorm
  | x == wGPUTextureFormat_ASTC10x6UnormSrgb = ASTC10x6UnormSrgb
  | x == wGPUTextureFormat_ASTC10x8Unorm = ASTC10x8Unorm
  | x == wGPUTextureFormat_ASTC10x8UnormSrgb = ASTC10x8UnormSrgb
  | x == wGPUTextureFormat_ASTC10x10Unorm = ASTC10x10Unorm
  | x == wGPUTextureFormat_ASTC10x10UnormSrgb = ASTC10x10UnormSrgb
  | x == wGPUTextureFormat_ASTC12x10Unorm = ASTC12x10Unorm
  | x == wGPUTextureFormat_ASTC12x10UnormSrgb = ASTC12x10UnormSrgb
  | x == wGPUTextureFormat_ASTC12x12Unorm = ASTC12x12Unorm
  | x == wGPUTextureFormat_ASTC12x12UnormSrgb = ASTC12x12UnormSrgb
  | x == wGPUTextureFormat_Force32 = Force32
  | otherwise = undefined