GU block alignment?

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

Moderators: cheriff, TyRaNiD

Post Reply
white rabbit
Posts: 60
Joined: Wed Jul 06, 2005 7:03 pm

GU block alignment?

Post by white rabbit »

What is the block alignement size? I assume it's 64 as 480 is a multiple of 32.

I know the normal block width / alignment used is 512 for a 480 pixel wide display, but I want to render onto a memory area used for a texture in the VRAM (e.g. a remote camera displaying on a monitor type object).

The texture is only going to be about 128 texels wide, so it seems a waste to use 512, I'd rather go with the minimum alignment over the texture size.

Cheers,

Dave
white rabbit
Posts: 60
Joined: Wed Jul 06, 2005 7:03 pm

Post by white rabbit »

Having had a good luck through pspgu.h I assume it's related to the quad word alignment (16 byte)?

Not sure how that affects my calculations though?

e.g. I'm rendering with a 32 bit pixel format (4 bytes), it needs to be a multiple of 4 pixels to align... That's quite a few less than the 32 pixels used in the samples, and much less than the 64 I suggested above...

I'm stumped, but will continue to look whilst hoping somebody can put me straight.
starman2049
Posts: 75
Joined: Mon Sep 19, 2005 5:41 am

Post by starman2049 »

Did you figure this out? I'm not completely sure what you are asking. If you explain it better I am sure I can help.
white rabbit
Posts: 60
Joined: Wed Jul 06, 2005 7:03 pm

Post by white rabbit »

Not yet, but moving house, so not developing anything in my own time for the next few months :( unless I can squeeze some in at work.

Anyways...
When you setup a GU list and define the viewport, offset, etc you have to provide a buffer width. This seems to always be set to 512 in the samples. The screen width is obviously 480 (i.e. 32 less than 512). I want to know why the buffer width is set to 512?
What else can it be set to?

My reason for this is that I have a remote camera, in say a TV studio. The feed from the camera is displaying on a monitor in another room. The player gets to the monitor and sees what the camera sees via this monitor.
Now, that's quite hard, or I could use the PSP & the game code to render what the camera sees on a little bit of VRAM that isn't part of the display, draw or depth (etc) buffer.
e.g. I setup another context that offsets elsewhere into the 4096x4096 block, and use that pointer to be the texture of the monitor.

BUT if I have to draw a full screen it will take ages and/or take up a lot of VRAM it doesn't need to - I only need a 64x64 texture say. So I want to draw to a smaller buffer, but I don't know what the buffer width can be set to.

That make more sense? I think I rambled quite a lot...
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

By my rendering logic knowledge, I would suppose it has to be a power of 2, so 32,64,128,256,512 should all be possible theoretically.
This would be to calculate offsets quickly by shifts, rather then muls.
white rabbit
Posts: 60
Joined: Wed Jul 06, 2005 7:03 pm

Post by white rabbit »

Ah! Cheers Raphael, that makes sense.

Will try it out asap and come bak with my results.
Post Reply