Results 1 to 17 of 17

Thread: pbuffers on intel cards - no luck

  1. #1

    Default pbuffers on intel cards - no luck

    AFAIK pbuffers are not supported on intel cards, are they?
    The problem is when I'm using CL_GUIWindowManagerTexture to manage windows in my application the following occurs:

    WARNING: Application calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported! This is an application bug!
    X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)
    Major opcode of failed request: 136 (DRI2)
    Minor opcode of failed request: 3 (DRI2CreateDrawable)
    Resource id in failed request: 0x500000c
    Serial number of failed request: 64
    Current serial number in output stream: 65
    The same thing can be observed in GUICustomComponent demo.

    Everything works fine using the CL_GUIWindowManagerSystem... let's say almost everything, because when integrating this with my game component the input is very laggy.

    Is there a simple way to prevent this?
    Attached Files Attached Files

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,765

    Default

    You could detect if glXCreatePbuffer extension is available in Sources/GL1/GLX/puffer_impl.cpp

    And if it is not, use glXCreateGLXPbufferSGIX instead.

    See - http://www.opengl.org/registry/specs/SGIX/pbuffer.txt

    Code:
        GLXPbuffer glXCreateGLXPbufferSGIX(Display *dpy,
    				       GLXFBConfig config,
    				       unsigned int width,
    				       unsigned int height,
    				       int *attrib_list);
    
        void glXDestroyGLXPbufferSGIX(Display *dpy,
    			          GLXPbuffer pbuf);
    
        void glXQueryGLXPbufferSGIX(Display *dpy,
    			        GLXPbuffer pbuf,
    			        int attribute,
    			        unsigned int *value);
    
        void glXSelectEventSGIX(Display *dpy,
    	  		    GLXDrawable drawable,
    			    unsigned long mask);
    
        void glXGetSelectedEventSGIX(Display *dpy,
      		                 GLXDrawable drawable,
    			         unsigned long *mask);
    And send us a patch ... I don't have the time, knowledge and hardware at the moment.

    The gui system wm should work, afaik.

  3. #3

    Default

    Thanks for reply!

    I implemented this extension. Everything was running fine on my machine (forced SGIX) but on intel... I've just lost one of my nine cat lives.

    X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)
    Major opcode of failed request: 136 (DRI2)
    Minor opcode of failed request: 3 (DRI2CreateDrawable)
    Resource id in failed request: 0x520000c
    Serial number of failed request: 64
    Current serial number in output stream: 65
    AFAiK there is second method for offscreen rendering. I'm saying about rendering to texture object. This is older method than pbuffers and maybe will be better for legacy graphics cards. What do you think? Edit: I see that the other method is working with newer cards only. Is this a dead end?
    Last edited by genail; 11-08-2009 at 07:39 PM.

  4. #4
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,765

    Default

    It depends when it says the "Error of failed request: BadDrawable (invalid Pixmap or Window parameter)" error

    Put a breakpoint on CL_PBuffer_GL1_Impl::create(), and keep stepping through, until the error is shown.

    If you can isolate it so a single function, it maybe easy to fix.

    Maybe it's because you need to use: glXChooseFBConfigSGIX
    ( http://www.opengl.org/registry/specs/SGIX/fbconfig.txt ) instead of glXChooseFBConfig()

    - The same with the rest of the functions in there

  5. #5

    Default

    It would be much easier if this hardware was not remote computer with my friend before it listening to my requests like. "now try to launch this, and that, and then give me the output". Unfortunately I cannot run and trace remote application that is using OpenGL because of GLX restriction.

    So I will try what I can from here and when everything else fails then I'll say "Hey! Would you like to visit me this weekend?" and I will do tracing and everything else that I cannot do remotely :-)

    Now let's see...

  6. #6

    Default

    Unfortunately effect is the same as last one. We're now trying to find some time to meet together and get this laptop into my hands. I will let you know if I find out something useful. This is a promise :-)

  7. #7
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,765

    Default

    It is possible that the problem is due to the incorrect opengl library being used. See - http://www.rtsoft.com/forums/showthr...1748#post11748 .Hopefully, i'll have a look before the end of the month

  8. #8
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,765

    Default

    Quote Originally Posted by rombust View Post
    It is possible that the problem is due to the incorrect opengl library being used. See - http://www.rtsoft.com/forums/showthr...1748#post11748 .Hopefully, i'll have a look before the end of the month
    That's now complete. ( svn://esoteric.clanlib.org/ClanLib/Development/ClanLib-2.1 )

  9. #9

    Default

    Thanks to keep me up to date! Unfortunately this doesn't resolve my problem, but it resolves another (deploying binaries will no longer be linked with my nvidia opengl drivers).

    Anyway I found a workaround for my problem. I will develop part of code that will display final game scene without window manager but directly into screen. This will allow the other developer (he's got this nasty Intel GMA card) to work with us a little longer.

  10. #10
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,765

    Default

    ( See http://www.rtsoft.com/forums/showthread.php?t=2953 )

    Note: The glXCreatePbuffer problem may be caused by the target computer only having less than GLX_VERSION_1_3 .It should be easy to fix via the SGIX extension "GLX_SGIX_fbconfig" and "GLX_SGIX_pbuffer". I can't do it, I don't have the hardware.

  11. #11

    Default

    I was confused why you said it second time after I pronounced that "Unfortunately effect is the same as last one." so i double-checked this problem outside of clanlib code. After changing pbuffer creation calls to SIGX ones with proper arguments (according to documentation) SGIX pbuffers are working but not on Intel GMA.

    Right now I'm thinking of creating a WindowManager that doesn't use pbuffers.

  12. #12
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,765

    Default

    Sorry, my misunderstanding.

    CL_GUIWindowManagerSystem does not use framebuffers / pbuffer's

    I personally have never used it. But some examples use it

  13. #13

    Default

    I was using CL_GUIWindowManagerSystem before but there was another issue with very slow reaction to input events. Looks like there is event overflow somewhere. Again I can provide sample code by modifying GUICustomComponent example to use CL_GUIWindowManagerSystem instead of CL_GUIWindowManagerTexture.

    Edit: Ok! Is just enough to replace 53 line of GUICustomComponent/app.cpp to:
    CL_GUIWindowManagerSystem wm;
    And you will see visible reaction delays to mouse events. Look at this action circle component.

    Edit2: I've just received information from my Intel-GMA friend, that frame buffer objects are working just great! Maybe I will try to hack ClanLib later to use frame buffers instead of pbuffers ;-)
    Last edited by genail; 12-12-2009 at 12:10 PM. Reason: 1) Info about changes for GUICustomComponent example 2) additional info on Intel GMA

  14. #14
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,765

    Default

    Quote Originally Posted by genail View Post
    Edit: Ok! Is just enough to replace 53 line of GUICustomComponent/app.cpp to:

    And you will see visible reaction delays to mouse events. Look at this action circle component.

    Edit2: I've just received information from my Intel-GMA friend, that frame buffer objects are working just great! Maybe I will try to hack ClanLib later to use frame buffers instead of pbuffers ;-)
    In "GameComponent", you can set set_constant_repaint(true)
    "Enabled whether the GUI will constantly repaint this component when there are no other messages to process. "

    You may want to add CL_System::sleep(xxx) somewhere to stop 100% cpu usage

    Your second edit confused me:
    OpenGL 1.3 does not have framebuffers. ClanLib emulates framebuffers using pbuffer's

    Unless you mean framebuffers work on his pc without clanlib ... strange if it does, and pbuffers don't work!

  15. #15

    Default

    Quote Originally Posted by rombust View Post
    In "GameComponent", you can set set_constant_repaint(true)
    in game_component.cpp:8 there already is "set_constant_repaint(true);"

    Setting CL_System:sleep(); is only a temporary solution. I was using that combination before, but on low-end machines when fps is dropping from 60 to ~30 problem with slowly reacting input is back again. But that works only if I'll manually try to call CL_KeepAlive::process() instead of CL_GuiManager::exec().
    I tried to put little sleep to GameComponent::on_render and later to GameComponent::on_message. The effect is worse than before.

    Quote Originally Posted by rombust View Post
    strange if it does, and pbuffers don't work!
    Again I double-checked this and I've even got a movie from his desktop ;-) See the attachment.
    Attached Files Attached Files

  16. #16
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,765

    Default

    1) Ref CL_System::sleep(xxx)
    I meant for you have control in your application speed. For example to keep it running at maximum set rate 100fps, instead of 500fps
    That means you have a CL_System::sleep(slow_me_down_value) that increases when the game goes faster than 100fps

    Either way, it won't solve your problem.

    2) Ref Movie
    Sorry I can't view it at the moment, will have to wait for next week

    3) Ref "set_constant_repaint(true);"
    Strange, that should work then (looking at CL_GUIManager::exec() )

    Hope you find a solution

  17. #17

    Default

    About the movie. This is the proof that frame buffer objects really works on his Intel.

    Edit: Maybe I've found temporary solution:

    while(!gui.exec(false)) {
    CL_System::sleep(20); // this will be changed to time that will keep ~60 fps
    }
    Because:
    Any sleep in on_render or on_message methods caused extreme input lag. This is quite logical, because all other events were forced to wait for this sleep to end.
    But can you explain me what is happening when cpu reaches 100%? I don't want the game to be unplayable when someone has slow machine.

    Edit2:
    I remember now why this solution was that bad. For some strange reason on this Intel GMA machine application working like that just went furious. SWAP space jumped and fell very quickly with no logical reason. One thing that can partly explain this is that Intel cards doesn't have their own memory and everything goes to system RAM. But this is quite strange because only SWAP usage is rising and more of that, CPU usage stays at very low value all the time. Are there series of heavy graphics memory allocations when using CL_GUIWindowManagerSystem?
    Last edited by genail; 12-12-2009 at 06:29 PM. Reason: Found solution? (2) not really

Similar Threads

  1. Intel i915
    By madmark in forum ClanLib: Help
    Replies: 1
    Last Post: 12-06-2007, 11:48 PM
  2. Question about Luck
    By Discoveria in forum Funeral Quest
    Replies: 1
    Last Post: 03-26-2007, 10:35 PM
  3. Replies: 0
    Last Post: 11-06-2006, 08:44 PM
  4. what is luck potion
    By -aj- in forum Dink Smallwood HD
    Replies: 3
    Last Post: 04-05-2005, 07:26 PM
  5. Luck bonus for top seller
    By mimifish in forum Funeral Quest
    Replies: 7
    Last Post: 12-25-2002, 11:13 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •