anchor.diff:      ;;    The array may have padding at the end; the base offset of the member
       ;;    following the array is rounded up to the next multiple of the base
       ;;    alignment.
  -    ((and (array-type-p self)
  -          (or (scalar-type-p (element-type self))
  -              (vector-type-p (element-type self))))
  -     (round-to-next-multiple (base-alignment :nope :nope (element-type type))
  -                             (base-alignment :nope :nope :vec4)))
  -    ;; 6. If the member is an array of S column-major matrices with C
  -    ;; columns and R rows, the matrix is stored identically to a row of
  -    ;; S × C column vectors with R components each, according to rule (4).
  -    ((and (array-type-p type)
  -          (matrix-type-p (element-type type)))
  -     todo)
  -    ;; 10. If the member is an array of S structures, the S elements of
  -    ;; the array are laid out in order, according to rule (9).
  -    ((and (array-type-p type)
  -          (struct-type-p (element-type type)))
  -     todo)
  +    ((v-typep type 'v-array)
  +     'TODO-PADDING
  +     (let* ((base-offset (calc-base-offset parent-type-aligned-offset
  +                                           last-slot-base-offset
  +                                           last-slot-aligned-offset
  +                                           last-slot-machine-size))
  +            (dummy (calc-layout :dummy
  +                                parent-type-base-offset
  +                                parent-type-aligned-offset
  +                                last-slot-base-offset
  +                                last-slot-aligned-offset
  +                                last-slot-machine-size
  +                                (v-element-type type)))
  +            (base-alignment (round-to-next-multiple
  +                             (layout-base-alignment dummy)
  +                             (calc-vector-base-alignment
  +                              (type-spec->type :vec4)))))
  +       (make-instance
  +        'std-140
  +        :name name
  +        :base-offset base-offset
  +        :aligned-offset (calc-aligned-offset base-offset base-alignment)
  +        :base-alignment base-alignment
  +        :machine-unit-size (machine-unit-size type))))
       ;;
  -    (t (error "shiit")))))
  +    (t (error "shiit"))))
   
   (defun calc-aligned-offset (base-offset base-alignment)
     ;; A structure and each structure member have a base offset and a base
  
positive.code: ;;
  ;; - slots in memory will be in same order as in definition
  
  (defun calc-block-layout (varjo-struct-type-name)
    (let ((type (type-spec->type varjo-struct-type-name))
          (base-offset 0)
          (aligned-offset 0))
      (assert (v-typep type 'v-struct))
      (calc-struct-layout varjo-struct-type-name
                          base-offset
                          aligned-offset)))
  
  (defun calc-struct-layout (name
                             base-offset
                             aligned-offset)
    ;; The members of a top-level uniform block are laid out in buffer
    ;; storage by treating the uniform block as a structure with a base
    ;; offset of zero.
    (let* ((slots (varjo.internals:v-slots
                   (varjo:type-spec->type 'cepl:g-pnt)))
           (members (let ((last-slot-base-offset nil)
                          (last-slot-aligned-offset nil)
                          (last-slot-machine-size nil))
                      (loop :for (name stype) :in slots :collect
                         (let* ((layout (calc-layout base-offset
                                                     aligned-offset
                                                     last-slot-base-offset
                                                     last-slot-aligned-offset
                                                     last-slot-machine-size
                                                     stype)))
                           (destructuring-bind
                                 (name
                                  &key base-offset aligned-offset
                                  machine-unit-size members)
                               layout
                             (declare (ignore name members))
                             (setf last-slot-base-offset base-offset
                                   last-slot-aligned-offset aligned-offset
                                   last-slot-machine-size machine-unit-size))
                           layout)))))
      (list name
            :base-offset
            :aligned-offset 0
            :machine-unit-size :TODO
            :members members)))
  
  (defun calc-base-offset (parent-type-aligned-offset
                           last-slot-base-offset
  
negative.code:                            (v-dmat4 . (v-dvec4 4))))
                   (error "woops")))
              (array-type (type-spec->type array-type-spec)))
         (calc-layout name
                      parent-type-base-offset
                      parent-type-aligned-offset
                      last-slot-base-offset
                      last-slot-aligned-offset
  