anchor.diff:        ;; 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
  +    ;; 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 (name
  +                           parent-type-aligned-offset
                              last-slot-base-offset
                              last-slot-aligned-offset
                              last-slot-machine-size
  
positive.code: ;;----------------------------------------------------------------------
  ;; Common
  
  (defun machine-unit-size (name)
    (cffi:foreign-type-size name))
  
  (defun round-to-next-multiple (val multiple)
    (* (ceiling val multiple) multiple))
  
negative.code:     ;; the member following the sub-structure is rounded up to the
      ;; next multiple of the base alignment of the structure.
      ((v-typep type 'v-struct)
       'TODO-PADDING
       (calc-struct-layout name
                           parent-type-aligned-offset
                           last-slot-base-offset
                           last-slot-aligned-offset
                           last-slot-machine-size
                           type))
      ;; 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 (v-typep type 'v-array)
            (v-typep (v-element-type type) 'v-matrix))
       (let ((len (first (v-dimensions type)))
             (elem-type (v-element-type type)))
         (destructuring-bind (rows cols) (v-dimensions elem-type)
           (let* ((new-elem-spec (ecase= rows
                                   (2 :vec2)
                                   (3 :vec3)
                                   (4 :vec4)))
                  (equiv-array-type-spec (list new-elem-spec (* cols len)))
                  (equiv-array-type (type-spec->type equiv-array-type-spec)))
             (calc-layout name
                          parent-type-base-offset
                          parent-type-aligned-offset
                          last-slot-base-offset
                          last-slot-aligned-offset
                          last-slot-machine-size
                          equiv-array-type)))))
      ;; 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 (v-typep type 'v-array)
            (v-typep (v-element-type type) 'v-struct))
       (let ((elem-layout (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))))
         (setf (slot-value elem-layout 'machine-unit-size)
               (* (slot-value elem-layout 'machine-unit-size)
                  (first (v-dimensions type))))
         elem-layout))
      ;; 4. If the member is an array of scalars or vectors, the base
      ;;    alignment and array stride are set to match the base alignment of
      ;;    a single array element, according to rules (1), (2), and (3), and
  