Page 1 of 1

undefined reference to BlendFuncSeparateOES

Posted: Sun May 12, 2019 8:57 pm
by oomek
Please correct me if I'm wrong.

I'm trying to call glBlendFuncSeparateOES in GLES 1.1 context which is defined in /opt/vc/include/GLES/glext.h but I'm getting linker errors. Since this is a legacy function that supposed to work in GLES 1.1 it should reside in /opt/vc/include/GLES/libGLESv1_CM.so right? But this is just a symlink to libGLESv2.so. I'm confused, has this function been deprecated, or it's declared in some other library?

I've tried glBlendFuncSeparate from GLES2, but it has no effect on the alpha channel.

(Dispmanx, EGL context, no X11 dependency)

Re: undefined reference to BlendFuncSeparateOES

Posted: Mon May 13, 2019 12:37 am
by Paeryn
glBlendFuncSeparateOES() is an extension, if the driver doesn't say that it supports it then you can't call it.

The driver doesn't say that it supports it, read the string returned by

Code: Select all

glGetString(GL_EXTENTIONS)
If it was supported then GL_OES_blend_func_separate would be in that string.

Code: Select all

  char *exts = glGetString(GL_EXTENSIONS);
  if (strstr(exts, "GL_OES_blend_func_separate")) {
    printf("we have glBlendFuncSeparateOES()\n");
  } else {
    printf("we don't have glBlendFuncSeparateOES()\n");
  }

Re: undefined reference to BlendFuncSeparateOES

Posted: Tue May 14, 2019 12:57 pm
by oomek
It seems that I have no other option, but to migrate to GLES 2.0 Thanks

Re: undefined reference to BlendFuncSeparateOES

Posted: Tue Jun 11, 2019 12:55 am
by oomek
There is still one more thing that wonders me. When I look at the userland repo I see that glBlendFunc and glBlendFuncSeparate are calling the same function set_blend_func() that is taking 4 blending parameters, but it's restricted by the IS_OPENGLES_20() check.

Could anyone explain please why it's restricted to just GLES 2.0 if the destination function takes 4 blending parameters in both cases?

https://github.com/raspberrypi/userland ... ent.c#L364

Re: undefined reference to BlendFuncSeparateOES

Posted: Tue Jun 11, 2019 8:05 pm
by Paeryn
At a guess, the driver (that is the one running on the VC4) doesn't support separate blend modes for alpha when running in an ES1 context. There's nothing preventing the hardware from doing it as blending is done in software on the QPUs but the driver that generates QPU code for ES1 might assume the blending modes are the same.

If nobody from the Foundation replies in the next few days as to whether the VC4 driver would allow glBlendFuncSeparate to work under ES1 I'll modify the ARM driver to accept it and see what happens.

Re: undefined reference to BlendFuncSeparateOES

Posted: Tue Jun 11, 2019 9:36 pm
by oomek
It would be awesome if it worked. Thank you for your reply.