You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to render 16 * 16 * 16 boxes.
I collected the vertices into one list and indices into other, so all of the vertices from 4096 boxes where in the same list.
(let ((vr (make-gpu-array verts :dimensions v-count :element-type 'g-pnc))
(ir (make-gpu-array ind :dimensions i-count :element-type :unsigned-int)))
(vector-push-extend (cons id (make-buffer-stream vr :index-array ir)) meshes)
(free-gpu-array vr)
(free-gpu-array ir)
Then I rendered, and it worked. I called free-vertex-stream on the buffer-stream.
I tried to create new mesh but I got opengl error 1285 . out-of-memory
Is it correct to free the gpu arrays after the stream has been made?
What am I not freeing correctly if I run out of memory?
I was looking at cepl's source and found possible bug?
delete-vertex-arrays is not inside the loop.
(defun free-vaos (vaos)
(with-foreign-object (id :uint (length vaos))
(loop :for vao :in vaos :for i :from 0 :do
(setf (mem-aref id :uint i) vao))
(%gl:delete-vertex-arrays 1 id)))
The text was updated successfully, but these errors were encountered:
Great catch, thankyou, i'll fix this asap.
Sorry for how long it's been since I last made changes to cepl. I'll have a video out soon explaining what I've been up to.
This was a bug but not the one we thought. #'delete-vertex-arrays takes a ptr to a foreign array of uints and deletes all of them at once. The problem is that I was telling it only to delete one of the ids from the array.
(%gl:delete-vertex-arrays 1 ids)
;; ^^^ the mistake
Also you musn't delete the gpu-arrays if you have a stream using them as the stream streams the data from the gpu-arrays.
I was trying to render 16 * 16 * 16 boxes.
I collected the vertices into one list and indices into other, so all of the vertices from 4096 boxes where in the same list.
Then I rendered, and it worked. I called free-vertex-stream on the buffer-stream.
I tried to create new mesh but I got opengl error 1285 . out-of-memory
Is it correct to free the gpu arrays after the stream has been made?
What am I not freeing correctly if I run out of memory?
I was looking at cepl's source and found possible bug?
delete-vertex-arrays is not inside the loop.
The text was updated successfully, but these errors were encountered: