# Using PBuffers on N95

**URL:** <https://forums.imgtec.com/t/using-pbuffers-on-n95/303>\
**Category:** PowerVR Insider\
**Created:** [April 1, 2009, 9:53am UTC](https://forums.imgtec.com/t/using-pbuffers-on-n95/303 "2009-04-01T09:53:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mark](https://forums.imgtec.com/u/mark)\
**Post date:** [April 1, 2009, 9:53am UTC](https://forums.imgtec.com/t/using-pbuffers-on-n95/303/1 "2009-04-01T09:53:44Z")

</div>

Hello there,

&nbsp;
  

I'm trying to get PBuffers to work on N95. Everything works okay if I create my pbuffer using the same EGL config as my main context.
  

&nbsp;
  

On my handset there is only one config with EGL\_WINDOW\_BIT set, so this is obviously the config the main context needs. However there are many tempting looking other configs with EGL\_PBUFFER\_BIT set that would be preferable for the pbuffer (16 bit, no alpha channel, etc.)
  

&nbsp;
  

If I create a pbuffer using any of these configs I cannot select the display into the main context (eglMakeCurrent returns EGL\_BAD\_MATCH). Fair enough, so I create a context for each pbuffer. This seems to basically 'work' (no errors), however I can't make these sub-contexts share texture objects with the main context (eglCreateContext returns EGL\_BAD\_MATCH). AFAICT this means I cannot get my surface into a texture object that&nbsp;I can render to the main surface (or a compatible surface) with...
  

&nbsp;
  

Am I missing something really obvious? I've spend the last day or so reading descriptions of how it's supposed to work and I think I'm doing the right thing. I haven't seen any examples that create a seperate context for the pbuffer, so is there some special way of forcing the main context to take the incompatible pbuffer? Surely all these extra configs must be accessible somehow?
  

&nbsp;
  

It would be great if someone could help me out with this one...
  

&nbsp;
  

Mark.

---

<div class="post-metadata">

**Author:** ![xmas](https://avatars.discourse-cdn.com/v4/letter/x/958977/32.png) [@xmas](https://forums.imgtec.com/u/xmas)\
**Post date:** [April 2, 2009, 2:37pm UTC](https://forums.imgtec.com/t/using-pbuffers-on-n95/303/2 "2009-04-02T14:37:12Z")

</div>

Unfortunately EGL has a restriction that limits the EGL surfaces you can use with a context to “compatible” ones, i.e. ones with the same colour depth as the config that was used with eglCreateContext. So using context sharing is indeed the only way to use a 32-bit EGL window surface and a 16-bit EGL pbuffer together. This should generally work, though, although it is not a requirement for EGL implementations to support context sharing. Your best bet would be to contact Nokia about this.  
  
  
  
  
  
Have you tried using a 32-bit pbuffer with the same context?

---

<div class="post-metadata">

**Author:** ![mark](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mark](https://forums.imgtec.com/u/mark)\
**Post date:** [April 2, 2009, 3:02pm UTC](https://forums.imgtec.com/t/using-pbuffers-on-n95/303/3 "2009-04-02T15:02:22Z")

</div>

Yes, it works fine with a 32bit pbuffer. I wanted to save some memory by using a 16bit one.
