hi,

i think i found a memory leak with shaders. these shaders cannot be cached, so (clear-shader-cache) does not help. (collect-garbage) does not solve this either, because no scheme objects are created. and even if they were, i'm not sure how deleting the scheme object would delete the c++ shader object. maybe by registering a finalizer function, that we haven't done anywhere in fluxus yet, i think.

memory leak example script:

(clear)

(every-frame
    (with-state
        (shader-source
            "void main(void)
            {
                gl_Position = ftransform();
                gl_FrontColor = gl_Color;
            }"

            "void main(void)
            {
                gl_FragColor = gl_Color;
            }")
        (draw-cube)))

any ideas how we should deal with this issue?

best,
gabor

Reply via email to