VirtualBox

Ticket #7125 (new defect)

Opened 4 years ago

Last modified 4 years ago

glsl in linux guest os does not work

Reported by: mvdhoning Owned by:
Priority: major Component: 3D support
Version: VirtualBox 3.2.6 Keywords: glsl linux opengl
Cc: Guest type: Linux
Host type: Linux

Description

glsl in linux guest os (ubuntu 9.10) does not work when run on the host the glsl application works. under windows xp guest it also does work both use the same host linux os (ubuntu 10.04) with ati binary driver if needed i can supply additional detailed info on request

Change History

comment:1 follow-up: ↓ 2 Changed 4 years ago by leonid

What exactly doesn't work for you?

comment:2 in reply to: ↑ 1 Changed 4 years ago by mvdhoning

Replying to leonid:

What exactly doesn't work for you?

The glsl shader does not work the program should draw an triangle with each corner either being red green or blue, but instead it draws an white triangle ...

Making calls to glGetObjectParameterivARB and glGetInfoLogARB give wrong results. When ran on the linux host machine that gives: lengte: 62 s-lengte: 61 frag: Fragment shader was successfully compiled to run on hardware.

As expected. But on the linux guest: lengte: 5619219 s-lengte: 5544336 vert: 8[

As it turns out the call to glGetObjectParameterivARB does not return an value on the virtualbox guest machine but does on the host linux machine and windows xp guest.

With the triangle being white and not colored on the linux virtual guest machine calls to enable/load the glsl have also failed.

comment:3 Changed 4 years ago by leonid

How do you obtain glGetObjectParameterivARB and glGetInfoLogARB function pointers? As well as glCreateShaderObjectARB and other extension functions?

Seems like you're not calling glXGetProcAddress and that's the reason.

comment:4 Changed 4 years ago by mvdhoning

I am using glXGetProcAddress/glXGetProcAddressARB if obtaining the function pointer had failed, it would have gotten an null pointer exception on calling the command. The calling of the command seems to work, yet does not fill the variable with an value...

Also the same executeable works on the linux host machine, but not on the virtualbox guest linux machine.

comment:5 Changed 4 years ago by mvdhoning

actually the first call to fail is: glCreateShaderObjectARB that does not create an shaderobject.

e.g. the shaderobject id on the main linux pc becomes 2

but on the virtualbox linux machine it becomes 0 and that explains why all other calls after that fail.

But why does glCreateShaderObjectARB work on my main linux pc and not on the linux virtualbox client. I know the function pointer is assigned an address so it should not fail on that.

comment:6 follow-up: ↓ 7 Changed 4 years ago by leonid

"I am using glXGetProcAddress/glXGetProcAddressARB if obtaining the function pointer had failed, it would have gotten an null pointer exception on calling the command."

That doesn't make any sense for me at all.

Are you using glXGetProcAddress explicitly in your code or not? If not then you're violating opengl spec and that's the reason why your app doesn't work. If it works on some "real" linux it's a "luck" and nothing more. Consider reading something like  http://dri.freedesktop.org/wiki/glXGetProcAddressNeverReturnsNULL Another good idea would be to use glew library which solves those issues as well.

comment:7 in reply to: ↑ 6 Changed 4 years ago by mvdhoning

Replying to leonid:

Are you using glXGetProcAddress explicitly in your code or not? If not then you're violating opengl spec and that's the reason why your app doesn't work. If it works on some "real" linux it's a "luck" and nothing more. Consider reading something like  http://dri.freedesktop.org/wiki/glXGetProcAddressNeverReturnsNULL Another good idea would be to use glew library which solves those issues as well.

Found the problem. In the function i use to load opengl functions i first call dlsym check if the result is <> null if it is null a call is made to glXGetProcAddress. Now that gives me a dummy function of some kind (and glXGetProcAddres not being called at all)

Now i first call glXGetProcAddres and if that is null i place a call to dlsym.

With that order of calling i get a working situation on guest virtualbox pc and also on the linux host.

I am not able to use GLEW as i do not program in c/cpp but in freepascal.

I am sorry for drawing the wrong conclusions.

Thank for being patient with my and showing the right way.

So this bugreport may be closed as it was not a virtualbux bug.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use