GU Sync?

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

Moderators: cheriff, TyRaNiD

Post Reply
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

GU Sync?

Post by subbie »

Hey guys I have a question. I am having a bit of trouble with this.

I am working on an n64 emu (if you dont already know). Anyways the n64 uses a small 4k buffer for textures. This block of memory is commonly overwriten many times while in the process of drawing a frame. So I am having problems of the memory being over writen before the gu draws the display list. So is there a way to sync the GU so it draws whats in the display list befor continuing? I've tried calling GuSync(0,0) but it locks up and crashes the application (and I guess this is because I just call it vs calling finish and gu start again).

So is there a way to sync the gu without having to flush the the display list and start a new? This sounds like it will be costly do.
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

One way might be to allocate LOTS of 4k textures and have one renderlist.

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

Post by chp »

But that 4k storage is temporary for rendering, isn't it? If you have to decode the texture before sending it to be rendered, you have store store it temporarily somewhere. Synchronizing the GE with the CPU is a BAD idea since you will lose a lot of precious time. Do what Jim suggests and use a big buffer of temporary memoryslots to hold the data prepared for upload. Decoupling the GE and the CPU is one of the most important things you have to accomplish to get good speed.
GE Dominator
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

Post by subbie »

chp wrote:But that 4k storage is temporary for rendering, isn't it? If you have to decode the texture before sending it to be rendered, you have store store it temporarily somewhere. Synchronizing the GE with the CPU is a BAD idea since you will lose a lot of precious time. Do what Jim suggests and use a big buffer of temporary memoryslots to hold the data prepared for upload. Decoupling the GE and the CPU is one of the most important things you have to accomplish to get good speed.
Thats definantly gonna hurt on the memory side. :(
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

You'll simply have to put a threshold how many textures you can cache before you wait for the GE to finish working.
GE Dominator
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

I doubt any N64 scene is big enough to fill the PSP's Video memory with different textures - there just wasn't the bandwidth to do that. But since even with only 4kb texture memory people double buffered a couple of 2k textures or used multiple palettes with the same image you might need to copy the previous texture into the new one each time.
I would guess you'll have about 1Mb of PSP video memory to play with - that's 250x4kb textures. At worst you might have to sync 2 or 3 times.

Jim
Post Reply