anchor.diff:  
                   GLSLType.Struct(name, newFields, offset), largestAlign, offset
                   
  -            | GLSLType.DynamicArray _ ->
  -                failwith "[GLSL] Images cannot be part of a UniformBuffer"
  -
  -            | GLSLType.Image _ ->
  -                failwith "[GLSL] Images cannot be part of a UniformBuffer"
  -                
  -            | GLSLType.Sampler _ ->
  -                failwith "[GLSL] Samplers cannot be part of a UniformBuffer"
  +            | GLSLType.DynamicArray(e,_) ->
  +                let (e,align,s) = layout e
  +                let s =
  +                    if s % 16 = 0 then s
  +                    else s + 16 - (s % 16)
  +
  +                GLSLType.DynamicArray(e, s), 16, 0
  +
  +            | GLSLType.Image i ->
  +                GLSLType.Image i, 1, 0
  +                
  +            | GLSLType.Sampler s ->
  +                GLSLType.Sampler s, 1, 0
   
       let applyLayout (ub : GLSLUniformBuffer) : GLSLUniformBuffer =
           let mutable offset = 0
  
positive.code:     | Array of len : int * elem : GLSLType * stride : int
      | Image of GLSLImageType
      | Sampler of GLSLSamplerType
      | DynamicArray of GLSLType
  
  and GLSLImageType =
      {
  
negative.code:                             | GLSLSampler t -> GLSLType.Sampler t
                      | _ -> failwithf "[GLSL] bad intrinsic type: %A" a
  
              | CType.CPointer(_,e) -> GLSLType.DynamicArray (ofCType e, -1)
  
  
  module LayoutStd140 =
  