[waffle] [PATCH 3/7] nacl: add implementation for waffle_context_create

Chad Versace chad.versace at intel.com
Tue Feb 3 10:26:13 PST 2015


On 02/03/2015 07:37 AM, Emil Velikov wrote:
> On 23 January 2015 at 07:59, Tapani Pälli <tapani.palli at intel.com> wrote:
>> Patch creates and initializes pp::Graphics3D context for OpenGL ES 2.0.
>>
>> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
>> ---
> [...]
> 
>> @@ -37,6 +43,10 @@ nacl_container_dtor(waffle::nacl_container *nc)
>>  {
>>      if (!nc)
>>          return;
>> +
> +   nc->ctx = pp::Graphics3D();
> I would guess that you want to nuke the Graphics3D ctx first ?
> 
>> +    nc->glSetCurrentContextPPAPI(0);
>> +    nc->glTerminatePPAPI();
>> +
> Imho the teardown should be symmetrical to the setup - i.e. create a
> new function nacl_context_fini (or similar) which has the above three
> calls, and gets executed in nacl_context_destroy.

I just want to echo Emil here. Writing teardown to be symmteric to
setup is generally a good idea.

> 
>> +static bool
>> +nacl_context_init(waffle::nacl_container *nc, struct nacl_config *cfg)
>> +{
> [...]
>> +
>> +    dlclose(glapi);
>> +
> Calling the function pointers after closing the handle causes
> segfaults on my Archlinux machine. Am I the only one or does nacl has
> something special in this regard ?

Hmmm... This seems wrong to me too.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/waffle/attachments/20150203/6ae8f169/attachment.sig>


More information about the waffle mailing list