keid-core-0.1.9.0: Core parts of Keid engine.
Safe HaskellSafe-Inferred
LanguageGHC2021

Resource.Model.Observer

Description

Experimental helpers for managing models with multiple instance buffers.

Only works with fully-coherent models and atomic stores. Not particularly efficient: when any element is changed, everything gets fully updated.

Documentation

observeCoherent :: (MonadVulkan env m, HasOutput output, UpdateCoherent bufs (GetOutput output)) => output -> ObserverIO bufs -> m () Source #

class VertexBuffers a where Source #

Minimal complete definition

Nothing

Methods

createInitial :: forall env m. MonadVulkan env m => Int -> Text -> ResourceT m a Source #

default createInitial :: forall env m. (Generic a, GVertexBuffers (Rep a), MonadVulkan env m) => Int -> Text -> ResourceT m a Source #

destroyCurrent :: forall env. HasVulkan env => env -> a -> IO () Source #

default destroyCurrent :: forall env. (Generic a, GVertexBuffers (Rep a), HasVulkan env) => env -> a -> IO () Source #

Instances

Instances details
VertexBuffers ExampleBuffers Source # 
Instance details

Defined in Resource.Model.Observer.Example

Methods

createInitial :: forall env (m :: Type -> Type). MonadVulkan env m => Int -> Text -> ResourceT m ExampleBuffers Source #

destroyCurrent :: HasVulkan env => env -> ExampleBuffers -> IO () Source #

Storable a => VertexBuffers (Allocated 'Coherent a) Source # 
Instance details

Defined in Resource.Model.Observer

Methods

createInitial :: forall env (m :: Type -> Type). MonadVulkan env m => Int -> Text -> ResourceT m (Allocated 'Coherent a) Source #

destroyCurrent :: HasVulkan env => env -> Allocated 'Coherent a -> IO () Source #

genericCreateInitial :: (Generic a, GVertexBuffers (Rep a), MonadVulkan env m) => Int -> Text -> ResourceT m a Source #

genericDestroyCurrent :: (Generic a, GVertexBuffers (Rep a), HasVulkan env) => env -> a -> IO () Source #

class UpdateCoherent bufs stores where Source #

Minimal complete definition

Nothing

Methods

updateCoherent :: forall env m. MonadVulkan env m => bufs -> stores -> m bufs Source #

default updateCoherent :: forall env m. (Generic bufs, Generic stores, GUpdateCoherent (Rep bufs) (Rep stores), MonadVulkan env m) => bufs -> stores -> m bufs Source #

genericUpdateCoherent :: (Generic bufs, Generic stores, GUpdateCoherent (Rep bufs) (Rep stores), MonadVulkan env m) => bufs -> stores -> m bufs Source #