GE RAM -> VRAM transfers, continued

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

GE RAM -> VRAM transfers, continued

Post by chp »

Ok, after locating a bug in a small test I did weeks ago, we now have a much speedier way of copying data from RAM to VRAM:

int sceGuCopyImage(int psm, int sx, int sy, int width, int height, int srcw, void* src, int dx, int dy, int int destw, void* dest);

using it like this:

sceGuCopyImage(GU_PSM_8888,0,0,480,272,512,src,0,0,512,(void*)((u32)dest+0x4000000));

will give you around 305 frames per second, or 151MB/s, which is triple the bandwidth amount that the blit-sample outputs right now. This requires that the source and destination are the same pixelformat though, but if you need pixelformat conversion, you can always do the standard blit afterwards, as VRAM -> VRAM blitting is much speedier (so you won't have to loose your scaling blit or bilinear filtering).

If you need the current drawbuffer pointer, remember that sceGuSwapBuffers() will return it when called.

I've updated GU and added another sample to demonstrate this technique. Thanks to Shine who inspired me to go back and re-examine this function. :)
GE Dominator
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

That's great news, thanks!

I'm kinda hoping that someone fixes the screendriver so it will support the virtual display. I experimented with setting the virtual display to 470x544, and that works, but there's no code in place yet that scrolls the screen downwards when the mouse reaches the bottom of the screen.

I'm a bit new to this kind of programming, so I'm not sure if the best way would be to use the function you mentioned, or if you can just move the vram pointer downwards a line at a time for scrolling down. What do you think would be the best approach?
Post Reply