oomek
Posts: 16
Joined: Wed Oct 31, 2018 1:51 pm

undefined reference to BlendFuncSeparateOES

Sun May 12, 2019 8:57 pm

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)

User avatar
Paeryn
Posts: 2560
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: undefined reference to BlendFuncSeparateOES

Mon May 13, 2019 12:37 am

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");
  }
She who travels light — forgot something.

oomek
Posts: 16
Joined: Wed Oct 31, 2018 1:51 pm

Re: undefined reference to BlendFuncSeparateOES

Tue May 14, 2019 12:57 pm

It seems that I have no other option, but to migrate to GLES 2.0 Thanks

oomek
Posts: 16
Joined: Wed Oct 31, 2018 1:51 pm

Re: undefined reference to BlendFuncSeparateOES

Tue Jun 11, 2019 12:55 am

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

User avatar
Paeryn
Posts: 2560
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: undefined reference to BlendFuncSeparateOES

Tue Jun 11, 2019 8:05 pm

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.
She who travels light — forgot something.

oomek
Posts: 16
Joined: Wed Oct 31, 2018 1:51 pm

Re: undefined reference to BlendFuncSeparateOES

Tue Jun 11, 2019 9:36 pm

It would be awesome if it worked. Thank you for your reply.

Return to “OpenGLES”