Results 1 to 3 of 3

Thread: GL1 framebuffer optimization

  1. #1
    Lesser Knight
    Join Date
    Mar 2009
    Posts
    54

    Default GL1 framebuffer optimization

    The problem: the current framebuffer emulation code deallocate/reallocates the pbuffer for every CL_FrameBuffer::attach_color_buffer call, thus producing a bottleneck.

    The solution: cache the previously created pbuffers using std::map and remove the deallocate call.

    The result: fast like it should be!
    Attached Files Attached Files

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

    Default

    Wonderful

    The patch will need tweaked slightly though.

    At the moment, it stores CL_Texture's in the provider.

    Ideally, it should store it using it's CL_WeakPtr implemention. ( using http://clanlib.org/docs/clanlib-2.0.....get_impl.html )

    That way, you can delete orphaned pbuffer's.
    And the texture_pbuffer_map won't keep increasing forever (when the user creates/destroys CL_Textures used by CL_FrameBuffers)

    I can have a look next week

  3. #3
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,785

    Default

    Patch applied. Many thanks

Similar Threads

  1. Does ClanLib support the Linux framebuffer or DirectFB?
    By stodge in forum ClanLib: General Discussion
    Replies: 1
    Last Post: 11-03-2007, 07:47 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
  •