Closed trungtle closed 8 years ago
@kenrussell do you want to look at this before we merge?
Looks good. One comment.
So basically all deconstructings are unnecessary in webgl or just in chrome? Thanks for pointing thIs out
On Saturday, February 13, 2016, Ken Russell notifications@github.com wrote:
Looks good. One comment.
— Reply to this email directly or view it on GitHub https://github.com/WebGLSamples/WebGL2Samples/pull/86#issuecomment-183689326 .
Cleanup of WebGL resources upon page unload is not necessary in any browser.
However, if you have a long-running page that allocates a lot of resources, it's very important to explicitly delete the ones you are no longer using, rather than letting the browser's garbage collector clean them up.
On Sat, Feb 13, 2016 at 7:46 AM, Shuai Shao (Shrek) < notifications@github.com> wrote:
So basically all deconstructings are unnecessary in webgl or just in chrome? Thanks for pointing thIs out
On Saturday, February 13, 2016, Ken Russell notifications@github.com wrote:
Looks good. One comment.
— Reply to this email directly or view it on GitHub < https://github.com/WebGLSamples/WebGL2Samples/pull/86#issuecomment-183689326
.
— Reply to this email directly or view it on GitHub https://github.com/WebGLSamples/WebGL2Samples/pull/86#issuecomment-183690306 .
Thanks @pjcozzi and @kenrussell for the feedback. I removed the onunload cleanup code and updated u_time properly now. Should be good to go.
Most real WebGL apps are long-running pages that need to do this sort of cleanup, and we want to encourage property memory management. With that said, if it is a bad practice for this case with the onunload
event (as opposed to many of our other samples that only render the frame once and can delete resources right away), then perhaps we could leave the delete code in, but commented out and not in the onunload
? I'm open to other ideas, but proper resource management is too important to just completely leave out.
We could:
What I don't know is if we can rely on page refresh or page navigation across all browsers to delete resources.
2 is a workaround. 1 still sort of promotes the onunload bad practice. Why not leave just the delete code commented out at the end with a comment that says something like "For explicit WebGL resource cleanup for long-running pages:"
It sounds good to me! Updated, sorry so late to update this.
Looks good to me otherwise.
@trungtle let me know when you have the final wording for this.
@pjcozzi Updated the comment.
I cleaned it up more.
Particle sym transform feedback. @pjcozzi I removed the self-executing pattern in init program, but wonder if this is clean enough.