Results 1 to 6 of 6

Thread: glDrawPixels and DMA

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2005
    Location
    USA
    Posts
    8

    glDrawPixels and DMA

    Hopefully an easy one: if I glDrawPixels(), should I expect the GPU to perform DMA? Is this graphics-card dependent? I've run a simple loop to render an image stored in RAM, but the CPU (i.e. not GPU) runs at 100%. I've done this on high-end and low-end cards. Is there an openGL function to determine the capabilities of the graphics card (i.e. DMA Y/N)?

    I want to be able to pan around a large offscreen image, stored in RAM, at high frame rates. The large offscreen image needs to be updated (read from disk) every now and then, so I need the CPU to be available to read data from disk and decompress for extended periods (i.e. several hundred frames worth of processing). I can run this in a separate thread, but the CPU is too busy rendering by the looks of it.

    Any pointers? I've researched a fair bit (redbook etc.) without any answers yet... All docs seem to jump right into drawing triangles and things! Maybe I've got the wrong API?

    THANKS

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2003
    Posts
    369

    Re: glDrawPixels and DMA

    Well, I had a case similar with yours, only I didn't have to change the images. I don't know, maybe you should try textures. Furthermore you could check texture compression (as in S3TC). If you could get your images compressed on the disk, maybe you could see some improvement. Good luck!

  3. #3
    Guest

    Re: glDrawPixels and DMA

    Originally posted by pascalbamford:
    Hopefully an easy one: if I glDrawPixels(), should I expect the GPU to perform DMA? Is this graphics-card dependent? I've run a simple loop to render an image stored in RAM, but the CPU (i.e. not GPU) runs at 100%. I've done this on high-end and low-end cards. Is there an openGL function to determine the capabilities of the graphics card (i.e. DMA Y/N)?

    I want to be able to pan around a large offscreen image, stored in RAM, at high frame rates. The large offscreen image needs to be updated (read from disk) every now and then, so I need the CPU to be available to read data from disk and decompress for extended periods (i.e. several hundred frames worth of processing). I can run this in a separate thread, but the CPU is too busy rendering by the looks of it.

    Any pointers? I've researched a fair bit (redbook etc.) without any answers yet... All docs seem to jump right into drawing triangles and things! Maybe I've got the wrong API?

    THANKS
    glDrawPixels() does a lot more than just a simple memcopy since it depends on the setting of glPixelZoom(), glPixelStore(), glPixelMap() and glPixelTransfer().

    So in general you cant expect a OpenGL implementation do utilize a DMA transfer during a glDrawPixel call and the high CPU load is probably caused by pixelscaling, color component swizzeling etc.).

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,633

    Re: glDrawPixels and DMA

    glDrawPixels will block the calling thread until all the data is pulled, to maintain coherency. Most of the time this means 100 per cent load. Perhaps if enough people complain to implementors, we'll see some drivers that yield instead ...

    You should definitely look into using texture tiles, say 128x128. For some obscure reasons this is much more efficient on all hardware that matters today. IMO the only company that really cares about the pixel path is 3DLabs, but their market penetration is too low to rely on that.

  5. #5
    Junior Member Newbie
    Join Date
    Jun 2005
    Location
    USA
    Posts
    8

    Re: glDrawPixels and DMA

    Thanks for the tips. I'll look into textures but it sounds like I need dedicated h/w. Thanks again.

  6. #6
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: glDrawPixels and DMA

    Originally posted by pascalbamford:
    I'll look into textures but it sounds like I need dedicated h/w.
    What do you mean ? any card post 1997 is able to deal with textures efficiently.

Similar Threads

  1. Using glDrawPixels
    By Mukund in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-27-2010, 02:51 PM
  2. glDrawPixels
    By in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 06-10-2003, 07:43 AM
  3. glDrawPixels
    By sgiuser in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-07-2001, 12:10 PM
  4. glDrawPixels help; glDrawPixels vs. Texture Mapping for bitmaps
    By vorbisus in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 06-11-2001, 10:07 AM
  5. glDrawPixels
    By JBrooks in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 08-16-2000, 10:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean