anchor.diff:  ;;           :texture-binding-2d-multisample
   ;;           :texture-binding-2d-multisample-array))
   
  -(let ((cache-id->enum-id
  -       #(32872 32873 32874 35868 35869 34038 34068 36874 35884 37124 37125)))
  -  (defun2 %texture-binding (gl-ctx index)
  -    (declare (ignore gl-ctx))
  -    (declare (optimize (speed 3) (safety 1) (debug 1) (compilation-speed 0)))
  -    (let ((enum-val (aref cache-id->enum-id index)))
  -      (cl-opengl:get-integer enum-val 1))))
  +(defn %texture-binding ((gl-ctx gl-context)
  +                        (index (integer 0 11)))
  +    (signed-byte 32)
  +  (declare (optimize (speed 3) (safety 1) (debug 1) (compilation-speed 0))
  +           (ignore gl-ctx) (profile t))
  +  (let* ((cache-id->enum-id #(32872 32873 32874 35868 35869 34038
  +                              34068 36874 35884 37124 37125))
  +         (enum-val (aref cache-id->enum-id index)))
  +    (the (signed-byte 32) (cl-opengl:get-integer enum-val 1))))
   
   ;; (mapcar (lambda (x) (cffi:foreign-enum-value '%gl::enum x))
   ;;         '(:texture-1d :texture-2d :texture-3d :texture-1d-array
   ;;           :texture-2d-array :texture-rectangle :texture-cube-map
   ;;           :texture-cube-map-array :texture-buffer :texture-2d-multisample
   ;;           :texture-2d-multisample-array))
  -(let ((cache-id->enum-id
  -       #(3552 3553 32879 35864 35866 34037 34067 36873 35882 37120 37122)))
  -  (defun2 (setf %texture-binding) (id gl-ctx index)
  -    (declare (ignore gl-ctx))
  -    (declare (optimize (speed 3) (safety 1) (debug 1) (compilation-speed 0)))
  -    (let ((target-val (aref cache-id->enum-id index)))
  -      ;; {TODO} we have already calculated the enum, try and remove the
  -      ;;        condition checking if keyword
  -      (gl:bind-texture target-val id))
  -    id))
  +(defn (setf %texture-binding) ((id gl-id)
  +                               (gl-ctx gl-context)
  +                               (index (integer 0 11)))
  +    gl-id
  +  (declare (optimize (speed 3) (safety 1) (debug 1) (compilation-speed 0))
  +           (ignore gl-ctx) (profile t))
  +  (let* ((cache-id->enum-id #(3552 3553 32879 35864 35866 34037 34067 36873
  +                              35882 37120 37122))
  +         (target-val (aref cache-id->enum-id index)))
  +    ;; {TODO} we have already calculated the enum, try and remove the
  +    ;;        condition checking if keyword
  +    (gl:bind-texture target-val id))
  +  id)
   
   ;; Raw cached index part
   
  -(declaim (inline texture-bound-id))
  -(defun2 texture-bound-id (ctx index)
  +(defn-inline texture-bound-id ((ctx cepl-context)
  +                               (index array-index))
  +    gl-id
     (declare (optimize (speed 3) (safety 1) (debug 1) (compilation-speed 0)))
     (%with-cepl-context (array-of-bound-texture-ids) ctx
       (aref array-of-bound-texture-ids index)))
   
  -(defun2 set-texture-bound-id (ctx index id)
  -  (declare (inline unknown-gl-id-p))
  -  (declare (optimize (speed 3) (safety 1) (debug 1) (compilation-speed 0)))
  +(defn set-texture-bound-id ((ctx cepl-context)
  +                            (index array-index)
  +                            (id gl-id))
  +    gl-id
  +  (declare (optimize (speed 3) (safety 1) (debug 1) (compilation-speed 0))
  +           (inline unknown-gl-id-p) (profile t))
     (%with-cepl-context (array-of-bound-texture-ids gl-context)
         ctx
       (let ((current (texture-bound-id ctx index))
  
positive.code:         ;;
          cepl-context))))
  
  (defun2 ensure-cepl-compatible-setup ()
    (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)
    (%with-cepl-context (current-viewport
                 default-viewport
                 default-framebuffer) cepl-context
  
negative.code:       (ensure-vec-index array-of-textures id +null-texture+)
        (setf (aref array-of-textures id) texture))))
  
  (defn register-fbo ((cepl-context cepl-context) (fbo fbo)) fbo
    (declare (optimize (speed 3) (safety 1) (debug 1) (compilation-speed 0))
             (profile t))
    (%with-cepl-context (fbos) cepl-context
      (let ((id (%fbo-id fbo)))
        (ensure-vec-index fbos id +null-fbo+)
  