I am attempting to create a GPGPU program using Open GLESv2. I’ve laid out the idea in some demo’s I’ve found and now I’m implementing it. I am stuck on creating the Rendering Context though.
I do not need to display anything so I create a PixelBuffer Surface and then try to make my context. However my eglCreateContext is throwing EGL_BAD_CONFIG.
Could anyone off any advice? I am attaching my configurations.
Edit: Just tried this on my Windows machine and emulator thinking it may be a VMWare and Software Accelerated OpenGL v2.0 issue. Same problem though, EGL_BAD_CONFIG.
EGLint major_ver, minor_ver, num_configs;
EGLint error;
EGLConfig config;
EGLint config_attrib[] =
{
EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_RED_SIZE, 5,
EGL_BLUE_SIZE, 6,
EGL_GREEN_SIZE, 5,
EGL_DEPTH_SIZE, 1,
EGL_NONE
};
EGLint context_attrib[] =
{
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
EGLint pb_attrib[] =
{
EGL_WIDTH, 512,
EGL_HEIGHT, 512,
EGL_LARGEST_PBUFFER, EGL_TRUE,
EGL_NONE
};
eglChooseConfig(ctx->egl_display_, attribute_list, &config, 1, &num_configs)
ctx->pb_surface_ = eglCreatePbufferSurface(ctx->egl_display_, config, pb_attrib);
ctx->egl_context_ = eglCreateContext(ctx->egl_display_, config, EGL_NO_CONTEXT, context_attrib);
The problem was that even though eglChooseConfig returned
EGL_TRUEit returned 0 configs… Make sure to check the number of configs returned…