regl icon indicating copy to clipboard operation
regl copied to clipboard

Treat programs as resources

Open wizgrav opened this issue 7 years ago • 2 comments

Right now, programs are wrapped inside draw commands. Could they be exposed as resources to enable management (.deleteProgram etc) like buffers & textures? They could be passed to commands as a program: property and the current behavior could stay as is for convenience. Sorry if I've missed something obvious, the issue in my case is that I need to recompile shaders very often and if I don't manually delete the previous shaders the app crashes at some point. Thank you

wizgrav avatar Jan 17 '17 15:01 wizgrav

Maybe a better solution would be to implement some sort of reference counting or garbage collection. I think there is a way we could make live reloading work without having to expose this machinery. Will circle back to this later once I've finally got housing sorted out.

mikolalysenko avatar Feb 13 '17 00:02 mikolalysenko

See also: #481, though garbage collecting + reference counting is a slightly different goal.

Is it valid to instantiate a single command and treat the shader source as a dynamic prop?

rreusser avatar May 17 '18 00:05 rreusser