I use offscreens to draw my own lines (anli-aliased), so I have to read
from the offscreen first, then add my pixels and write them back to the
offscreen.
I use offscreens to draw my own lines (anli-aliased), so I have to read
from the offscreen first, then add my pixels and write them back to the
offscreen.
Note that when you’re reading from your hard drive, the disk controller
is using bus mastering, which avoids the latency issues.
You could try getting a pointer directly to onscreen (use
PG_OSC_MAIN_DISPLAY) to avoid copying the entire area, and only touch
the pixels you need to. (I don’t know your application, so this may or
may not be an option for you).
I need a fast way to copy from memory to offscreen buffer. I have tried
several approaches and the drawing is always very slow.
I have my own low-level graphic routines and only need Photon to copy
the resulting memory surface to the video card.
I tried PgContextBlitArea with PgGetOffscreenContextPtr for offscreen
context in direct mode. When I copy the memory content with memcpy to
the offscreen buffer, 0.2 seconds is spent just in this one memcpy. The
offscreen buffer has about 768kB (800x480x16bpp). That means a speed of
about 3.75MB/s which is very low. Perhaps it has something to do with
the hardware or the shared memory implementation. Other Photon programs
run fast, with no problems (e.g. you can move a window on the screen
smoothly).
And I also tried PgDrawImage and PgDrawPhImage which is perhaps even
slower, you can see how the screen fills from top to bottom. Most time
is spent in the graphics driver in this case.
I use offscreens to draw my own lines (anli-aliased), so I have to read
from the offscreen first, then add my pixels and write them back to the
offscreen.
Note that when you’re reading from your hard drive, the disk controller
is using bus mastering, which avoids the latency issues.
You could try getting a pointer directly to onscreen (use
PG_OSC_MAIN_DISPLAY) to avoid copying the entire area, and only touch
the pixels you need to. (I don’t know your application, so this may or
may not be an option for you).
Does anybody knows how can I access directly to graphics driver without
using photon? Some example would be great.
Thanks,
Tomas
Tomas Kolda wrote:
I have very simillar problem.
I need a fast way to copy from memory to offscreen buffer. I have tried
several approaches and the drawing is always very slow.
I have my own low-level graphic routines and only need Photon to copy
the resulting memory surface to the video card.
I tried PgContextBlitArea with PgGetOffscreenContextPtr for offscreen
context in direct mode. When I copy the memory content with memcpy to
the offscreen buffer, 0.2 seconds is spent just in this one memcpy. The
offscreen buffer has about 768kB (800x480x16bpp). That means a speed of
about 3.75MB/s which is very low. Perhaps it has something to do with
the hardware or the shared memory implementation. Other Photon programs
run fast, with no problems (e.g. you can move a window on the screen
smoothly).
And I also tried PgDrawImage and PgDrawPhImage which is perhaps even
slower, you can see how the screen fills from top to bottom. Most time
is spent in the graphics driver in this case.
I need a fast way to copy from memory to offscreen buffer. I have tried
several approaches and the drawing is always very slow.
I have my own low-level graphic routines and only need Photon to copy
the resulting memory surface to the video card.
I tried PgContextBlitArea with PgGetOffscreenContextPtr for offscreen
context in direct mode. When I copy the memory content with memcpy to
the offscreen buffer, 0.2 seconds is spent just in this one memcpy. The
offscreen buffer has about 768kB (800x480x16bpp). That means a speed of
about 3.75MB/s which is very low. Perhaps it has something to do with
the hardware or the shared memory implementation. Other Photon programs
run fast, with no problems (e.g. you can move a window on the screen
smoothly).