luminance-0.11.0.4: Type-safe, type-level and stateless graphics framework

Copyright(C) 2015, 2016 Dimitri Sabadie
LicenseBSD3
MaintainerDimitri Sabadie <dimitri.sabadie@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Graphics.Luminance.Shader.Stage

Contents

Description

 

Synopsis

Shader stage creation

data Stage Source #

A shader Stage.

Instances

Eq Stage Source # 

Methods

(==) :: Stage -> Stage -> Bool #

(/=) :: Stage -> Stage -> Bool #

Show Stage Source # 

Methods

showsPrec :: Int -> Stage -> ShowS #

show :: Stage -> String #

showList :: [Stage] -> ShowS #

createStage :: (HasStageError e, MonadError e m, MonadResource m) => StageType -> String -> m Stage Source #

Create a shader stage from a String representation of its source code and its type.

Note: on some hardware and backends, tessellation shaders aren’t available. That function throws UnsupportedStage error in such cases.

Error handling

data StageError Source #

Error type of shaders.

'CompilationFailed reason' occurs when a shader fails to compile, and the String reason contains a description of the failure.

'UnsupportedStage stage' occurs when you try to create a shader which type is not supported on the current hardware.

class HasStageError a where Source #

Types that can handle StageError.

Minimal complete definition

fromStageError