eglCreatePBufferSurface

If you can’t find a config where EGL_BIND_TO_TEXTURE_RGB[A] is EGL_TRUE, then the implementation doesn’t allow the creation of texture-bindable pbuffers.

Following up on the Last Post , i wanted to ask what shall be Done in order to make sure that pBuffer after createpBufferSurafce isnt NULL ?

But Xmas in that case if EGL_BIND_TO_TEXTURE_RGB[A] , EGL_TRUE returned Failure , shall EGL_FALSE for it ,return Success ? When i tried this just for curiousity , I got a Failure.
Anyways if it doesnt allow me to have Texture Bindable pBuffers , there isnt any way left so that i could use pBuffer :? ???

I am giving you the Entire Function flow and the values Returned for it :




EGLint pConfigAttrib[]={// as mentioned in earlier post
};

eglChooseConfig(eglDisplay ,pConfigAttrib,&eglconfig,1,&iConfigs);
// without using BIND_TO_TEXTURE_RGB[A] ,EGL_TRUE ; eglConfig is 3, iConfigs is 1  else it fails


EGLint red,blue,green,alpha;
eglGetConfigAttrib(eglDisplay,eglConfig,EGL_GREEN_SIZE,&green);
//gets green =8
//similarly red= 8, blue =8,alpha =8
   

eglSurface = eglCreateWindowSurface(eglDisplay,eglConfig,eglWindow,NULL); //gets a valid surface

eglContext = eglCreateContext(eglDisplay,eglConfig,NULL,NULL);

eglMakeCurrent(eglDisplay,eglSurface,eglSurface,eglContext);



Uptill this place all is fine.After this as soon as i try creating the pBuffer, it gives NULL :



EGLint pBufferAttrib[]={
EGL_WIDTH,   128,
EGL_HEIGHT,    128,
EGL_TEXTURE_FORMAT,  EGL_TEXTURE_RGB,
EGL_TEXTUIRE_TARGET,   EGL_TEXTURE_2D,
EGL_NONE
};


EGLSurface pbuffer = eglCreatePbufferSurface(eglDisplay,eglConfig,NULL);

The error code after this is always EGL_BAD_MATCH , no matter what pbuffer attrib we specify.Please throw some light , on what shall be done.

Also as you said that Texture Bindable pBuffer isnt supported , what shall we try for using Textures?

You mean both these code snippets fail to get a valid config?

EGLint attrib[]={ EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE, EGL_NONE }; 
EGLBoolean res = eglchooseConfig(eglDisplay,attrib,&eglconfig,1,&iConfig);
EGLint attrib[]={ EGL_BIND_TO_TEXTURE_RGB, EGL_FALSE, EGL_NONE }; 
EGLBoolean res = eglchooseConfig(eglDisplay,attrib,&eglconfig,1,&iConfig);

If so, could you please check the EGL version as returned by the device, and post the value of EGL_BIND_TO_TEXTURE_RGB in your egl.h header file?

Anyways if it doesnt allow me to have Texture Bindable pBuffers , there isnt any way left so that i could use pBuffer :? ???

I suggested pbuffers as a way to speed up texture upload at the expense of runtime performance. If you can’t create a texture bindable pbuffer then you have to use normal textures.

The EGL version is 1.
I checked it as Returned by major and minor by EglInitialize .
Also the EGL_BIND_TO_TEXTURE_RGBA has value 303A(Hexadecimal).

You mean 1.0? Or 1.1?
If it’s 1.0 you’re out of luck as this version does not support texture bindable pbuffers.

Hi,
When I use eglCreatePbufferSurface, I set attribute like that:

	EGLint attr[]={ 
		EGL_WIDTH, 320, 
		EGL_HEIGHT, 240,      // doesn't take effect
		EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB, 
		EGL_TEXTURE_TARGET, EGL_TEXTURE_2D, 
		EGL_NONE
	};

But the EGL_HEIGHT value I set does not work. The height seems to be always 320 whatever value I set.
What is the problem?

Which implementation are you using?

Sorry for that.
I develop with VC8.0 in pocket PC, windows mobile 5.0.
I just want to draw something in egl buffer (i use memory dc), and display it like a bitmap.

I use 6 egl functions to initialize:
eglGetDisplay, eglInitialize, eglChooseConfig, eglCreatePbufferSurface, eglCreateContext, eglMakeCurrent
For config attribute, I set like that:

	int i = 0;
	EGLint pi32ConfigAttribs[11];
	pi32ConfigAttribs[i++] = EGL_RED_SIZE;
	pi32ConfigAttribs[i++] = 5;
	pi32ConfigAttribs[i++] = EGL_GREEN_SIZE;
	pi32ConfigAttribs[i++] = 6;
	pi32ConfigAttribs[i++] = EGL_BLUE_SIZE;
	pi32ConfigAttribs[i++] = 5;
	pi32ConfigAttribs[i++] = EGL_BIND_TO_TEXTURE_RGB;
	pi32ConfigAttribs[i++] = EGL_TRUE;
	pi32ConfigAttribs[i++] = EGL_SURFACE_TYPE;
	pi32ConfigAttribs[i++] = EGL_PBUFFER_BIT;
	pi32ConfigAttribs[i++] = EGL_NONE;

I want a scene 320240, but what i got was 320320 at last.

Again, which EGL/OpenGL ES implementation are you using?

OpenGL ES 1.1 implementation!

Yes, and which one?

In other words, what strings do these function calls return?

eglQueryString(eglDisplay, EGL_VENDOR);
eglQueryString(eglDisplay, EGL_VERSION);
glGetString(GL_VENDOR);
glGetString(GL_RENDERER);
glGetString(GL_VERSION);

The strings those function calls returned are as following:
EGL_VENDOR: Hans-Martin Will
EGL_VERSION: 0.84 Software JIT
GL_VENDOR: Hans-Martin Will
GL_RENDERER: Software
GL_VERSION: OpenGL ES-CL 1.1

Thanks.

In the future, please post support requests specific to Vincent in the corresponding help forums. I did not follow the complete thread (I believe all the earlier questions indeed concerned the Imagination implementation), but Vincent currently only comes with egl 1.0, so in particular it has no render to texture capabilities.
Hope that helps.

  • HM

Hi, I’m trying to put the OGLESRenderToTexture sample of the OpenGL ES SDk to run but the results aren’t very good. I’m trying to understand what’s wrong but the only strange thing that I hava seen is the message “Error: Failed to find a suitable config.”. It means that the eglChooseConfig are not able to choose a good configuration.


EGLint conflist[] =
	{		
		EGL_CONFIG_CAVEAT, EGL_NONE,
		/* 
			Tell it the minimum size we want for our colour buffer and the depth size so 
			eglChooseConfig will choose the config that is the closest match.
		*/
		EGL_BUFFER_SIZE, i32BufferSize,
		EGL_DEPTH_SIZE, 16,
		/* The PBuffer bit is the important part as it shows we want a PBuffer */
		EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
		EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE, //it is here the problem, if I delete this line no error ocurrs
		EGL_NONE
	};

this is the configurations list. The final result is always a fractal rendered in the window but all the polygons are white.

My questions are
1- Is this really the problem, or maybe its not so relevant?
2- If true, why it’s not working and how can I resolve this?

Thanks, and sorry for the english.

  1. Yes, this is a problem.
  2. Because the implementation you are working on does not export a matching config.

Try to reduce the attribute list to either:
{
EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE,
EGL_NONE
}
or
{
EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
EGL_BIND_TO_TEXTURE_RGBA, EGL_TRUE,
EGL_NONE
}

If eglChooseConfig doesn’t return a valid config for either of those attribute lists, your implementation does not support pbuffer textures.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.