Results 1 to 10 of 46

Thread: Multithreaded resource loading

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Hey guys, sorry been very busy lately. I'm going to be releasing JUI within the next month or so. It has a fully working multi-threaded resource loader, which does have an option for loading data (images, vertex etc) directly into an OpenGL context. But while you can do this, you really shouldn't, it's basically a waste of time. Since the render thread can't switch to back the context until the data has been uploaded, it's a lot simpler and more elegant to load data into system memory first, then copy the data across to the card in the render thread when it's ready. My resource loader is tied in with a generic scene-graph allowing you to do things like a streaming world AKA the Grand Theft Auto Series. A much better area of focus for your multi-threaded musings would be path finding and steering algorithms. Since both of these require simultaneous access to data along with the render thread, it's a lot more challenging and fun to solve
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  2. #2
    phibermon
    Quote Originally Posted by phibermon
    t's a lot simpler and more elegant to load data into system memory first, then copy the data across to the card in the render thread when it's ready
    There is no fun if it simple, so... I will waste my time with fun first
    Last edited by WILL; 09-10-2010 at 10:05 PM. Reason: General housekeeping. Moved portion of dialog to other thread.

  3. #3
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    It's not just simpler, it's the only rational solution. You can't load data to the card and render at the same time with OpenGL, at least not with version < 3.2. On higher versions you can use fence sync objects (http://www.opengl.org/registry/doc/g...e.20100725.pdf - section 5.3). With your current method, you may be loading the data in seperate thread, but your main thread will be locking on GL calls until this load is complete and the context is switched back.

    Your method will crash a PS3 and most older ATI cards too. Sorry I'm really not trying to be a killjoy but you're quite clearly a good developer and I feel your time would be better spent on learning about fence syncing, it was designed exactly for what you're trying to do.

    EDIT : But I do agree, sometimes the best solution isn't the most fun
    Last edited by phibermon; 09-10-2010 at 01:50 PM.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

Tags for this Thread

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
  •