module Patrol.Type.GpuContext where
import qualified Data.Aeson as Aeson
import qualified Data.Text as Text
import qualified Patrol.Extra.Aeson as Aeson
data GpuContext = GpuContext
{ GpuContext -> Text
apiType :: Text.Text,
GpuContext -> Text
graphicsShaderLevel :: Text.Text,
GpuContext -> Value
id :: Aeson.Value,
GpuContext -> Maybe Int
maxTextureSize :: Maybe Int,
GpuContext -> Maybe Double
memorySize :: Maybe Double,
GpuContext -> Maybe Bool
multiThreadedRendering :: Maybe Bool,
GpuContext -> Text
name :: Text.Text,
GpuContext -> Text
npotSupport :: Text.Text,
GpuContext -> Maybe Bool
supportsComputeShaders :: Maybe Bool,
GpuContext -> Maybe Bool
supportsGeometryShaders :: Maybe Bool,
GpuContext -> Maybe Bool
supportsRayTracing :: Maybe Bool,
GpuContext -> Text
vendorId :: Text.Text,
GpuContext -> Text
vendorName :: Text.Text,
GpuContext -> Text
version :: Text.Text
}
deriving (GpuContext -> GpuContext -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GpuContext -> GpuContext -> Bool
$c/= :: GpuContext -> GpuContext -> Bool
== :: GpuContext -> GpuContext -> Bool
$c== :: GpuContext -> GpuContext -> Bool
Eq, Int -> GpuContext -> ShowS
[GpuContext] -> ShowS
GpuContext -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GpuContext] -> ShowS
$cshowList :: [GpuContext] -> ShowS
show :: GpuContext -> String
$cshow :: GpuContext -> String
showsPrec :: Int -> GpuContext -> ShowS
$cshowsPrec :: Int -> GpuContext -> ShowS
Show)
instance Aeson.ToJSON GpuContext where
toJSON :: GpuContext -> Value
toJSON GpuContext
gpuContext =
[Pair] -> Value
Aeson.intoObject
[ forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"api_type" forall a b. (a -> b) -> a -> b
$ GpuContext -> Text
apiType GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"graphics_shader_level" forall a b. (a -> b) -> a -> b
$ GpuContext -> Text
graphicsShaderLevel GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"id" forall a b. (a -> b) -> a -> b
$ GpuContext -> Value
Patrol.Type.GpuContext.id GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"max_texture_size" forall a b. (a -> b) -> a -> b
$ GpuContext -> Maybe Int
maxTextureSize GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"memory_size" forall a b. (a -> b) -> a -> b
$ GpuContext -> Maybe Double
memorySize GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"multi_threaded_rendering" forall a b. (a -> b) -> a -> b
$ GpuContext -> Maybe Bool
multiThreadedRendering GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"name" forall a b. (a -> b) -> a -> b
$ GpuContext -> Text
name GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"npot_support" forall a b. (a -> b) -> a -> b
$ GpuContext -> Text
npotSupport GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"supports_compute_shaders" forall a b. (a -> b) -> a -> b
$ GpuContext -> Maybe Bool
supportsComputeShaders GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"supports_geometry_shaders" forall a b. (a -> b) -> a -> b
$ GpuContext -> Maybe Bool
supportsGeometryShaders GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"supports_ray_tracing" forall a b. (a -> b) -> a -> b
$ GpuContext -> Maybe Bool
supportsRayTracing GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"vendor_id" forall a b. (a -> b) -> a -> b
$ GpuContext -> Text
vendorId GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"vendor_name" forall a b. (a -> b) -> a -> b
$ GpuContext -> Text
vendorName GpuContext
gpuContext,
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"version" forall a b. (a -> b) -> a -> b
$ GpuContext -> Text
version GpuContext
gpuContext
]
empty :: GpuContext
empty :: GpuContext
empty =
GpuContext
{ apiType :: Text
apiType = Text
Text.empty,
graphicsShaderLevel :: Text
graphicsShaderLevel = Text
Text.empty,
id :: Value
Patrol.Type.GpuContext.id = Value
Aeson.Null,
maxTextureSize :: Maybe Int
maxTextureSize = forall a. Maybe a
Nothing,
memorySize :: Maybe Double
memorySize = forall a. Maybe a
Nothing,
multiThreadedRendering :: Maybe Bool
multiThreadedRendering = forall a. Maybe a
Nothing,
name :: Text
name = Text
Text.empty,
npotSupport :: Text
npotSupport = Text
Text.empty,
supportsComputeShaders :: Maybe Bool
supportsComputeShaders = forall a. Maybe a
Nothing,
supportsGeometryShaders :: Maybe Bool
supportsGeometryShaders = forall a. Maybe a
Nothing,
supportsRayTracing :: Maybe Bool
supportsRayTracing = forall a. Maybe a
Nothing,
vendorId :: Text
vendorId = Text
Text.empty,
vendorName :: Text
vendorName = Text
Text.empty,
version :: Text
version = Text
Text.empty
}