module Graphics.Caramia.Shader.Internal where
import Graphics.Caramia.Internal.OpenGLCApi
import Graphics.Caramia.Prelude
import Graphics.Caramia.Resource
data Shader = Shader
{ resource :: !(Resource Shader_)
, viewStage :: !ShaderStage
, identifier :: !Unique
}
deriving ( Typeable )
instance Eq Shader where
(resource -> res1) == (resource -> res2) = res1 == res2
instance Ord Shader where
(identifier -> id1) `compare` (identifier -> id2) = id1 `compare` id2
data Shader_ = CompiledShader !GLuint
data Pipeline = Pipeline
{ resourcePL :: !(Resource Pipeline_)
, pipelineIdentifier :: !Unique
, shaders :: [Shader] }
deriving ( Typeable )
instance Eq Pipeline where
p1 == p2 = resourcePL p1 == resourcePL p2
instance Ord Pipeline where
p1 `compare` p2 = pipelineIdentifier p1 `compare` pipelineIdentifier p2
newtype Pipeline_ = Pipeline_ GLuint
data ShaderStage =
Vertex
| Fragment
| Geometry
deriving ( Eq, Ord, Show, Read )