anchor.diff:          ;;
           cepl-context))))
   
  -(defun2 ensure-cepl-compatible-setup ()
  +(defn ensure-cepl-compatible-setup () boolean
  +  (declare (profile t))
     (unless (or (> (gl:major-version) 3)
                 (and (= (gl:major-version) 3)
                      (>= (gl:minor-version) 1)))
       (error "Cepl requires OpenGL 3.1 or higher. Found: ~a.~a"
              (gl:major-version) (gl:minor-version))))
   
  -(defun2 %set-default-fbo-and-viewport (surface cepl-context)
  +(defn %set-default-fbo-and-viewport ((surface t) (cepl-context cepl-context))
  +    cepl-context
  +  (declare (profile t))
     (%with-cepl-context (current-viewport
                  default-viewport
                  default-framebuffer) cepl-context
  
positive.code: ;; binding-points trying to mix them in the cache above was more confusing than
  ;; helpful.
  
  (defun2 ubo-bind-buffer-id-range
      (ctx id ubo-binding-point offset size)
    (declare (inline unknown-gl-id-p))
    (declare (optimize (speed 3) (safety 1) (debug 1) (compilation-speed 0)))
    (assert (and offset size))
    ;; don't worry about checking cache for avoiding rebinding as we dont want to
    ;; cache ranges (yet?)
    (%with-cepl-context (array-of-ubo-bindings-buffer-ids) ctx
      (ensure-vec-index array-of-ubo-bindings-buffer-ids ubo-binding-point
                        +null-gl-id+)
      (let ((bind-id (if (unknown-gl-id-p id) 0 id)))
        (%gl:bind-buffer-range
         :uniform-buffer ubo-binding-point bind-id offset size)
  
negative.code:         (when (and (>= id 0) (< (length array-of-gpu-buffers)))
            (aref array-of-gpu-buffers id))))))
  
  (defn (setf gpu-buffer-bound) ((val gpu-buffer)
                                 (ctx cepl-context)
                                 (target symbol))
      gpu-buffer
    (declare (optimize (speed 3) (safety 1) (debug 1) (compilation-speed 0))
             (profile t))
    (let ((index (buffer-kind->cache-index target)))
      (set-gpu-buffer-bound-id ctx index (gpu-buffer-id val)))
    val)
  
  ;;----------------------------------------------------------------------
  ;; Uniform Buffer Objects
  