[GEM-dev] Lua an GEM

Chris McCormick chris at mccormick.cx
Wed Jan 16 02:33:56 CET 2008


On Tue, Jan 15, 2008 at 05:21:34PM -0800, Wesley Smith wrote:
> > I might be wrong, but my impression is that this is all to do with order
> > of execution (which is why Gem can't really be considered 'dataflow').
> > You need to use [t a a ...] objects to specify where in the chain your
> > lua script is executed, and that will be your context.
> 
> Hi Chris,
> Thanks for the response.  So then how does one get any kind of
> notification if the context goes away?  Is this something the user
> making the patch would have to take care of?  For example, let's say I
> had a shader in a Lua script.  When the context the shader is compiled
> and allocated in goes away, I'd like to be able to free its resources
> just before it is deallocated.  Is there a way to do this?

I don't know that much about shaders in Gem (my copy of Gem doesn't have
the glsl stuff) , but I think I get what you're saying. So you are:

1. Compiling and allocating a shader in the LUA script.
2. Using that shader outside the lua script in some Gem stuff.
3. Finished with the shader, but you don't know how to free it's
resources.

If that's the case I guess you could just put a second lua script later
in the chain (e.g. further left on the [t a a ...]) that frees the
resources?

I'm a bit out of my depth here. What is it that makes the shader context
"go away"?

Chris.

-------------------
http://mccormick.cx




More information about the GEM-dev mailing list