Skip navigation.
 
mlRe: glCopyTexSubImage2D performance
FROM : Timothy J. Wood
DATE : Sat Nov 30 16:07:01 2002


  You should post this on the mac-opengl list (see lists.apple.com).

  Still, texture copies are supposed to be VRAM-to-VRAM copies in 10.2,
so you should be able to get pretty good performance.

  Another option to explore is rendering into a texture.  10.2 adds the
ability to create an offscreen window (make sure it is non-deferred in
IB or in the NSWindow initializer).  You can then create a GL context
attached to that window and create a texture in your original context
via some new methods on NSOpenGLContext (see the header).  The caveat
to this is that there is no implicit synchronization between the two
contexts so you need to make sure rendering in the texture context is
done before you use the texture (either via a WaitFenceAPPLE or Finish
call on the texture context).  The archives for the mac-opengl context
should have more info.

  (I suppose it is also worth mentioning that it's probably a bad idea
to copy into a texture that is using client storage since that would
imply a VRAM-to-system copy)

  In the grand scheme of things, though, you should NOT have to switch
your approach on this between the Mac and PC.  If texture copies are
too slow, you should log a bug (with a test case) showing that the Mac
drivers aren't performing adequately.

-tim



On Saturday, November 30, 2002, at 10:00  AM, Alexander Powell wrote:

> Was wondering if one of y'all could answer this:
>
> I have an OpenGL program which I'm developing for PC and Mac which has
> a
> special effect that it demonstrates, but which requires a call to
> glCopyTexSubImage2D (or similar) to copy the framebuffer to a texture
> for later
> use.  Unfortunately, I get performance that is amazing using any
> nVidia card on
> the PC with the latest drivers, and horrible performance on the Mac
> using any
> card I can get my hands on.  Actually, when I run OpenGL profiler on
> it, it
> says that over 90% of the OpenGL call overhead occurs with the
> glCopyTexSubImage2D call.
>
> So, is there anything I should be using instead, which would be
> faster?  My the
> copy *shouldn't* take too much time because its only a 32x32 texture
> and I'm
> only doing 3 copies per frame (I get about 1 fps).
>
> Thanks a bunch,
>
> --
> Alexander Powell
> <email_removed>
> Georgia Institute of Technology - Studio 100
>
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev



Related mailsAuthorDate
mlglCopyTexSubImage2D performance Alexander Powell Nov 30, 10:08
mlRe: glCopyTexSubImage2D performance Timothy J. Wood Nov 30, 16:07