User avatar
RichardRussell
Posts: 580
Joined: Thu Jun 21, 2012 10:48 am

glLogicOp(GL_OR) not working on Raspberry Pi 4?

Fri Aug 09, 2019 2:51 pm

This is a strange one. I have an application which contains the following code:

Code: Select all

	glEnable (GL_COLOR_LOGIC_OP) ;
	glLogicOp (GL_OR) ;  // GL_AND and GL_XOR are also used
This works as expected on the RPi 3B (with the VC4 GL driver enabled) using Raspbian Jessie, Stretch or Buster. However, according to reports I have received, it is seemingly being ignored on the RPi 4 (with Buster). I haven't a clue what might be the explanation; is it possible that the OpenGL implementation on the RPi 4 is broken in respect of this functionality? It makes my application close to unusable.

User avatar
PeterO
Posts: 5030
Joined: Sun Jul 22, 2012 4:14 pm

Re: glLogicOp(GL_OR) not working on Raspberry Pi 4?

Fri Aug 09, 2019 3:10 pm

Are you using openGL or openGL ES code ?
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
RichardRussell
Posts: 580
Joined: Thu Jun 21, 2012 10:48 am

Re: glLogicOp(GL_OR) not working on Raspberry Pi 4?

Fri Aug 09, 2019 3:37 pm

PeterO wrote:
Fri Aug 09, 2019 3:10 pm
Are you using openGL or openGL ES code ?
'Full' OpenGL (which is why I'm using the VC4 driver of course). OpenGL ES2 doesn't support the glLogicOp() function at all.

User avatar
PeterO
Posts: 5030
Joined: Sun Jul 22, 2012 4:14 pm

Re: glLogicOp(GL_OR) not working on Raspberry Pi 4?

Fri Aug 09, 2019 4:03 pm

RichardRussell wrote:
Fri Aug 09, 2019 3:37 pm
PeterO wrote:
Fri Aug 09, 2019 3:10 pm
Are you using openGL or openGL ES code ?
'Full' OpenGL (which is why I'm using the VC4 driver of course). OpenGL ES2 doesn't support the glLogicOp() function at all.
Which is why I asked !
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
RichardRussell
Posts: 580
Joined: Thu Jun 21, 2012 10:48 am

Re: glLogicOp(GL_OR) not working on Raspberry Pi 4?

Fri Aug 09, 2019 4:09 pm

PeterO wrote:
Fri Aug 09, 2019 4:03 pm
Which is why I asked !
Having stated that the identical code works fine on the RPi 3, but fails on the RPi 4, I really don't think the clarification (or the question) was necessary. Do you have any suggestion as to how I can try to get this issue resolved, because I'd rather not have to tell my users to avoid the RPi 4, which has advantages in other respects (notably speed)?

trejan
Posts: 585
Joined: Tue Jul 02, 2019 2:28 pm

Re: glLogicOp(GL_OR) not working on Raspberry Pi 4?

Fri Aug 09, 2019 4:23 pm

https://gitlab.freedesktop.org/mesa/mes ... edc935cc74 is from a month ago but the Mesa in Raspbian is from 20190429 according to the timestamp in the version.
Last edited by trejan on Fri Aug 09, 2019 4:42 pm, edited 1 time in total.

User avatar
PeterO
Posts: 5030
Joined: Sun Jul 22, 2012 4:14 pm

Re: glLogicOp(GL_OR) not working on Raspberry Pi 4?

Fri Aug 09, 2019 4:41 pm

RichardRussell wrote:
Fri Aug 09, 2019 4:09 pm
PeterO wrote:
Fri Aug 09, 2019 4:03 pm
Which is why I asked !
Having stated that the identical code works fine on the RPi 3, but fails on the RPi 4, I really don't think the clarification (or the question) was necessary.
The alphabet soup of abbreviations surrounding all these different drivers means I have no idea what " RPi 3B (with the VC4 GL driver enabled) " actually means (Especially as the Pi4 doesn't have a VC4!) but I do know that the logical ops have been dropped from ES, so I thought I'd ask you something that would clarify if that was the problem, but since you clearly know more about this than I do I shall now shut up.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
RichardRussell
Posts: 580
Joined: Thu Jun 21, 2012 10:48 am

Re: glLogicOp(GL_OR) not working on Raspberry Pi 4?

Fri Aug 09, 2019 4:56 pm

trejan wrote:
Fri Aug 09, 2019 4:23 pm
https://gitlab.freedesktop.org/mesa/mes ... edc935cc74 is from a month ago but the Mesa in Raspbian is from 20190429 according to the timestamp in the version.
Ah, so this is a known problem that has been fixed upstream but not yet incorporated in Raspbian? Should I be puzzled that it doesn't affect Raspbian Buster when running on the RPi 3B though? Is that Mesa version only enabled when running on a RPi 4?

Edit: Although, thinking about it, if the fix is for V3D and not VC4 perhaps that explains it.

trejan
Posts: 585
Joined: Tue Jul 02, 2019 2:28 pm

Re: glLogicOp(GL_OR) not working on Raspberry Pi 4?

Fri Aug 09, 2019 5:20 pm

Yeah. Different drivers inside Mesa. VC4 doesn't support logic ops either but has had a driver based implementation for a long time now. The V3D driver however didn't have support for it until that recent patch.

No idea how long you'll need to wait for a newer Mesa to appear in Raspbian.

User avatar
RichardRussell
Posts: 580
Joined: Thu Jun 21, 2012 10:48 am

Re: glLogicOp(GL_OR) not working on Raspberry Pi 4?

Fri Aug 09, 2019 5:42 pm

trejan wrote:
Fri Aug 09, 2019 5:20 pm
No idea how long you'll need to wait for a newer Mesa to appear in Raspbian.
Indeed, but I guess knowing there's a fix in the pipeline is better than nothing. If anybody from the RPF is listening, at least they now know that the issue affects a popular app (BBC BASIC).

User avatar
RichardRussell
Posts: 580
Joined: Thu Jun 21, 2012 10:48 am

Re: glLogicOp(GL_OR) not working on Raspberry Pi 4?

Tue Aug 27, 2019 3:58 pm

trejan wrote:
Fri Aug 09, 2019 5:20 pm
No idea how long you'll need to wait for a newer Mesa to appear in Raspbian.
To tie up loose ends, the issue is fixed in this Mesa release candidate:

https://www.raspberrypi.org/forums/view ... 6&t=249650

Return to “Advanced users”