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:       ;; The base offset of the first member of a structure is taken from the
        ;; aligned offset of the structure itself
        parent-type-aligned-offset
        ;; The base offset of all other structure members is derived by taking
        ;; the offset of the last basic machine unit consumed by the previous
        ;; member and adding one
        ;;
        ;; {TODO} see rule 4 second paragraph, sounds relevent
        ;; {TODO} see rule 9 second paragraph, sounds relevent
        (+ last-slot-aligned-offset ;; which offset?
           last-slot-machine-size
           1)))
  
  (defun calc-scalar-layout (parent-type-aligned-offset
                             last-slot-base-offset
                             last-slot-aligned-offset
                             last-slot-machine-size
  
negative.code:                     type)
    (cond
      ((scalar-type-p type)
       (calc-scalar-layout name
                           parent-type-aligned-offset
                           last-slot-base-offset
                           last-slot-aligned-offset
                           last-slot-machine-size
                           type))
      ((v-typep type 'v-vector)
       (calc-vector-layout name
                           parent-type-aligned-offset
                           last-slot-base-offset
                           last-slot-aligned-offset
                           last-slot-machine-size
                           type))
      ;; 5. If the member is a column-major matrix with C columns and R
      ;; rows, the matrix is stored identically to an array of C column
      ;; vectors with R components each, according to rule (4).
      ((v-typep type 'v-matrix)
       (let* ((array-type-spec
               (or (assocr type
                           '((v-mat2 . (v-vec2 2))
                             (v-mat3 . (v-vec3 3))
                             (v-mat4 . (v-vec4 4))
  