# PBuffer usage with GLES2

**URL:** <https://forums.imgtec.com/t/pbuffer-usage-with-gles2/748>\
**Category:** PowerVR Insider\
**Created:** [July 1, 2010, 10:36am UTC](https://forums.imgtec.com/t/pbuffer-usage-with-gles2/748 "2010-07-01T10:36:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amz](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@amz](https://forums.imgtec.com/u/amz)\
**Post date:** [July 1, 2010, 10:36am UTC](https://forums.imgtec.com/t/pbuffer-usage-with-gles2/748/1 "2010-07-01T10:36:47Z")

</div>

Hi,  
  
I want to make usage of the PBuffer surface to implement some off-screen rendering. (No render to texture). I have to use PBuffer because of some kind of abstraction, where we do not have access to the final window. The PBuffer content will copied into a bitmap container where it will finally blitted into a window screen.  
  
I already had some problems with the GLES 1.1 emulation win32 sdk, but finally found a workaround by creating an invisible window, call eglMakeCurrent to that surface and creating afterwards a Pbuffer surface. (I was already confused, why I have to do this. But PBuffer creation without a window surface always failed).  
  
Now I switched to the latest GLES 2.0 emulation win32 sdk (OGLES2\_WINDOWS\_PCEMULATION\_2.06.26.0649) and the same config attrib list (only extended by the EGL\_RENDERABLE\_TYPE to use EGL\_OPENGL\_ES2\_BIT) does not return a   
valid configuration, that supports PBuffer surfaces.  
  
Here is the attribute list, I want to query:  
  
  
&nbsp;&nbsp; static const EGLint configAttribs[] =&nbsp;&nbsp;&nbsp; {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_BUFFER\_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 32,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_RED\_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_GREEN\_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_BLUE\_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_ALPHA\_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_DEPTH\_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_COLOR\_BUFFER\_TYPE,&nbsp; EGL\_RGB\_BUFFER,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_STENCIL\_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_DONT\_CARE,  
#if defined (GLES   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_RENDERABLE\_TYPE,&nbsp;&nbsp;&nbsp; EGL\_OPENGL\_ES\_BIT,  
#elif defined (GLES2)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_RENDERABLE\_TYPE,&nbsp;&nbsp;&nbsp; EGL\_OPENGL\_ES2\_BIT,  
#endif&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_SURFACE\_TYPE,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_PBUFFER\_BIT | EGL\_WINDOW\_BIT,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL\_NONE  
&nbsp;&nbsp; };  
[/CODE]  
  
Any idea whats going wrong here?  
It would be also nice to know, why I have to create a window surface before I am allowed to create a PBuffer surface with the GLES 1.1 sdk.  
  
Some additional infos, I am using an ATI Radeon HD 5450 and use only the emulation sdks at the moment.  
  
Regards

`<br>&nbsp;&nbsp; static const EGLint configAttribs[] =&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_BUFFER_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 32,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_RED_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_GREEN_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_BLUE_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_ALPHA_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_DEPTH_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_COLOR_BUFFER_TYPE,&nbsp; EGL_RGB_BUFFER,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_STENCIL_SIZE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_DONT_CARE,<br>#if defined (GLES <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_RENDERABLE_TYPE,&nbsp;&nbsp;&nbsp; EGL_OPENGL_ES_BIT,<br>#elif defined (GLES2)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_RENDERABLE_TYPE,&nbsp;&nbsp;&nbsp; EGL_OPENGL_ES2_BIT,<br>#endif&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_SURFACE_TYPE,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_PBUFFER_BIT | EGL_WINDOW_BIT,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EGL_NONE<br>&nbsp;&nbsp; };<br>`  
  
Any idea whats going wrong here?  
It would be also nice to know, why I have to create a window surface before I am allowed to create a PBuffer surface with the GLES 1.1 sdk.  
  
Some additional infos, I am using an ATI Radeon HD 5450 and use only the emulation sdks at the moment.  
  
Regards

---

<div class="post-metadata">

**Author:** ![amz](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@amz](https://forums.imgtec.com/u/amz)\
**Post date:** [July 6, 2010, 5:57am UTC](https://forums.imgtec.com/t/pbuffer-usage-with-gles2/748/2 "2010-07-06T05:57:27Z")

</div>

Push…  
No comments to that problem?  
At least some statement would be nice. I am currently a little bit lost with the sdk.  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![GordonMaclachlan](https://avatars.discourse-cdn.com/v4/letter/g/c68b51/32.png) [@GordonMaclachlan](https://forums.imgtec.com/u/GordonMaclachlan)\
**Post date:** [July 6, 2010, 9:08am UTC](https://forums.imgtec.com/t/pbuffer-usage-with-gles2/748/3 "2010-07-06T09:08:40Z")

</div>

I'm afraid the engineer who works on PC emulation has been unable to look at this yet and I can't really shed much light on these issues. However, I don't believe that PBuffers are supported in PC emulation for OpenGL ES 2.0 at this time.  
  
What device platform are you targetting and what OS? Is there a specific reason that you can't use FBOs?  
Gordon2010-07-06 11:15:50

---

<div class="post-metadata">

**Author:** ![amz](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@amz](https://forums.imgtec.com/u/amz)\
**Post date:** [July 6, 2010, 11:32am UTC](https://forums.imgtec.com/t/pbuffer-usage-with-gles2/748/4 "2010-07-06T11:32:17Z")

</div>

Thanks for the response.  
  
I wanted to be sure, that I am not doing something wrong with PBuffers or with my EGL queries, because PBuffers were available with the GLES 1.1 emulation sdk, but not with the GLES 2.0 sdk.  
  
I have a running workaround for PC emulation, so I am happe for now.  
  
The decision for the target platform is not done yet, but I wanted to use the emulation SDK as a development plattform for a first prototyp.  
  
I wanted to prevent the FBO usage currently, because I am not so familiar with them. I will try to change that soon.  
  
Regards
