VirtualBox

Opened 13 years ago

Closed 10 years ago

#8329 closed enhancement (fixed)

GLX_DRAWABLE_TYPE does not report GLX_WINDOW_BIT -> fixed after 4.2

Reported by: sagaki Owned by:
Component: 3D support Version: VirtualBox 4.0.2
Keywords: Cc:
Guest type: Linux Host type: Windows

Description (last modified by Michael Thayer)

In the guest PC, I compiled an attached source (mainly borrow from http://www.opengl.org/sdk/docs/man/xhtml/glXIntro.xml ) and ran it. I noticed that glXGetFBConfigAttrib() with GLX_DRAWABLE returns only GLX_PIXMAP_BIT(=0x2).

As the sample source works fine, I suggest GLX_WINDOW_BIT(=0x1) value should also be set in GLX_DRAWABLE attribute if VirtualBox has a qualification.

My environments are follows:
Host PC

Version
VirtualBox 4.0.2
Machine
Windows 7 64-bit with NVIDIA NVS 3100M (Lenovo T410)

Guest PC

Version
Guest additions 4.0.3
OS
Ubuntu 10.10 32-bit (2.6.35-25-generic)
Library
libgl1-mesa-dev 7.9~git20100924-0ubuntu2
server glx version string
1.3 Chromium

Attachments (1)

sample.tgz (1.7 KB ) - added by sagaki 13 years ago.
sample application source

Download all attachments as: .zip

Change History (11)

by sagaki, 13 years ago

Attachment: sample.tgz added

sample application source

comment:1 by sagaki, 13 years ago

There are three points to use GLX_DRAWABLE_TYPE in the source code, glx.c:

  • glxGetConfig returns GLX_WINDOW_BIT for GLX_DRAWABLE_TYPE.
  • glxChooseFBConfig returns an error if GLX_DRAWABLE_TYPE is not GLX_WINDOW_BIT.
  • glxGetFBConfigAttrib returns GLX_PIXMAP_BIT for GLX_DRAWABLE_TYPE.

In my idea, glxGetFBConfigAttrib should return GLX_WINDOW_BIT for GLX_DRAWABLE_TYPE. Or the behaviour does not match with others.

comment:2 by Leonid Lobachev, 13 years ago

Thanks for your finding, it seems reasonable to add GLX_WINDOW_BIT indeed.

in reply to:  2 comment:3 by sagaki, 13 years ago

How about adding this feature in 4.1?

comment:4 by online2@rich, 12 years ago

Running into this problem only when 3d acceleration is enabled. Win 7 64 bit host. Fedora 15 32 bit guest.

All calls to glfwOpenWindow(800, 600, 0, 0 , 0, 0, 0, 0, GLFW_WINDOW); will fail. glfw is unusable with 3d acceleration in VirtualBox. With 3d acceleration off the call works fine. Ultimately fails in

x11_window.c around line 487 on this call

if( !( getFBConfigAttrib( fbconfigs[i], GLX_DRAWABLE_TYPE ) & GLX_WINDOW_BIT ) )

{

Only consider window GLXFBConfigs continue;

}

in reply to:  4 comment:5 by online2@rich, 12 years ago

Replying to online2@rich:

Running into this problem only when 3d acceleration is enabled. Win 7 64 bit host. Fedora 15 32 bit guest.

All calls to glfwOpenWindow(800, 600, 0, 0 , 0, 0, 0, 0, GLFW_WINDOW); will fail. glfw is unusable with 3d acceleration in VirtualBox. With 3d acceleration off the call works fine. Ultimately fails in

x11_window.c around line 487 on this call

if( !( getFBConfigAttrib( fbconfigs[i], GLX_DRAWABLE_TYPE ) & GLX_WINDOW_BIT ) )

{

Only consider window GLXFBConfigs continue;

}

Forgot to say I was running VirtualBox 4.1.6

in reply to:  1 comment:6 by Michael Thayer, 11 years ago

Description: modified (diff)

Replying to sagaki, but should be relevant to later comment authors too:

There are three points to use GLX_DRAWABLE_TYPE in the source code, glx.c:

  • glxGetConfig returns GLX_WINDOW_BIT for GLX_DRAWABLE_TYPE.
  • glxChooseFBConfig returns an error if GLX_DRAWABLE_TYPE is not GLX_WINDOW_BIT.
  • glxGetFBConfigAttrib returns GLX_PIXMAP_BIT for GLX_DRAWABLE_TYPE.

In my idea, glxGetFBConfigAttrib should return GLX_WINDOW_BIT for GLX_DRAWABLE_TYPE. Or the behaviour does not match with others.

Had a quick look at that code, and it seems to me that:

  • glxGetConfig() should not handle GLX_DRAWABLE_TYPE at all, based on all manual pages I could find for it.
  • glxChooseFBConfig() should check whether the value is one of or both of GLX_PIXMAP_BIT or GLX_WINDOW_BIT, as we seem to implement both glXCreatePixmap() and glXCreateWindow() unconditionally with respect to the FB Config.
  • glxGetFBConfigAttrib() should return GLX_PIXMAP_BIT | GLX_WINDOW_BIT based on the above.

comment:7 by Michael Thayer, 11 years ago

Summary: GLX_DRAWABLE_TYPE does not report GLX_WINDOW_BITGLX_DRAWABLE_TYPE does not report GLX_WINDOW_BIT -> fixed after 4.2

I have committed a fix for this, though not (yet) to 4.2, as I cannot be sure this won't break anything.

comment:8 by Frank Mehnert, 11 years ago

This fix is contained in VBox 4.3 Beta 2, please give it a try.

comment:9 by sag.aki, 11 years ago

Thanks. glxGetFBConfigAttrib works fine on VBox 4.3 Beta 3.

I'm not sure about glxGetConfig and glxChooseFBConfig, but my target application isn't affected these issues.

comment:10 by misha, 10 years ago

Resolution: fixed
Status: newclosed

Thanks for the feedback. VBox 4.3 is released now. Please re-open if the issue persists there.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use