I misunderstood the purpose of the mechanism used for the gl calls.
It is not to save cgo calls (in fact, it doesn't), it is to handle the fact 
that OpenGL wants to be called form a locked thread, as exemplified in:
https://godoc.org/golang.org/x/mobile/gl#Worker

On Thursday, January 26, 2017 at 7:04:36 PM UTC+1, Roberto Zanotto wrote:
>
> Hi.
>
> I'm looking at the source of mobile/gl.
> If I understand correctly, it has a mechanism to reduce the number of cgo 
> calls: the gl calls are accumulated, until a "blocking" call is reached; 
> when that happens, all the calls with associated arguments are passed at 
> once to a C function, which executes them all.
>
> I would like to implement a similar technique for some OpenGL non-ES 
> bindings.
> The question is: how is this "blocking" property defined? How do I decide 
> which function should be flagged as blocking and which one shouldn't?
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to