-- Buffers are indexed by ints.

setBuffer :: BufferView -> Index -> RenderM ()
setBuffer buffer index = modify set
  where set s = let binding = input s -- very ugly here. but can be fixed ;)
                in s { input = binding { bufferBinding = setBuffer' binding } }
        setBuffer' = M.insert index buffer . bufferBinding 

-- Render lives in RenderM 
setBuffer :: BufferView -> Index -> RenderM ()
setBuffer buffer index = modify set
  where set s = let binding = input s -- very ugly here. but can be fixed ;)
                in s { input = binding { bufferBinding = setBuffer' binding } }
        setBuffer' = M.insert index buffer . bufferBinding 

-- Render lives in RenderM 
setBuffer buffer index = modify set
  where set s = let binding = input s -- very ugly here. but can be fixed ;)
                in s { input = binding { bufferBinding = setBuffer' binding } }
        setBuffer' = M.insert index buffer . bufferBinding 

-- Render lives in RenderM 